Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1589245 > unrolled thread

[NAND Question] When oob_required is used?

Started byMasahiro Yamada <yamada.masahiro@socionext.com>
First post2017-02-28 08:30 +0100
Last post2017-02-28 09:40 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [NAND Question] When oob_required is used? Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-02-28 08:30 +0100
    Re: [NAND Question] When oob_required is used? Boris Brezillon <boris.brezillon@free-electrons.com> - 2017-02-28 09:20 +0100
      Re: [NAND Question] When oob_required is used? Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-02-28 09:40 +0100

#1589245 — [NAND Question] When oob_required is used?

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2017-02-28 08:30 +0100
Subject[NAND Question] When oob_required is used?
Message-ID<tfKop-1dc-3@gated-at.bofh.it>
Hi.


I am seeing the reference implementations for the callback
in drivers/mtd/nand/nand_base.c


I see only some of them use the argument "oob_required".


- oob_required is used
nand_read_page_raw()
nand_write_page_raw()
nand_write_subpage_hwecc()


- oob_required is ignored
nand_read_page_raw_syndrome()
nand_read_page_swecc()
nand_read_page_hwecc()
nand_read_page_hwecc_oob_first()
nand_read_page_syndrome()
nand_write_page_raw_syndrome()
nand_write_page_swecc()
nand_write_page_hwecc()
nand_write_page_syndrome()



I could not get the logic
when "oob_required" is used.



When implementing drivers, the "oob_required"
should be respected (i.e. oob_poi should be transferred as well),
or is it OK to ignore it?




-- 
Best Regards
Masahiro Yamada

[toc] | [next] | [standalone]


#1589268

FromBoris Brezillon <boris.brezillon@free-electrons.com>
Date2017-02-28 09:20 +0100
Message-ID<tfLaN-1Kw-1@gated-at.bofh.it>
In reply to#1589245
On Tue, 28 Feb 2017 16:21:50 +0900
Masahiro Yamada <yamada.masahiro@socionext.com> wrote:

> Hi.
> 
> 
> I am seeing the reference implementations for the callback
> in drivers/mtd/nand/nand_base.c
> 
> 
> I see only some of them use the argument "oob_required".
> 
> 
> - oob_required is used
> nand_read_page_raw()
> nand_write_page_raw()
> nand_write_subpage_hwecc()
> 
> 
> - oob_required is ignored
> nand_read_page_raw_syndrome()
> nand_read_page_swecc()
> nand_read_page_hwecc()
> nand_read_page_hwecc_oob_first()
> nand_read_page_syndrome()
> nand_write_page_raw_syndrome()
> nand_write_page_swecc()
> nand_write_page_hwecc()
> nand_write_page_syndrome()
> 
> 
> 
> I could not get the logic
> when "oob_required" is used.
> 
> 
> 
> When implementing drivers, the "oob_required"
> should be respected (i.e. oob_poi should be transferred as well),
> or is it OK to ignore it?
> 
> 

oob_required = true => you must retrieve OOB bytes
oob_required = false => you can optimize the process and ignore OOB
bytes, but you can also retrieve them if you don't care about
optimization. That's usually what's done when you have to retrieve ECC
bytes (retrieving a few extra OOB bytes is not expensive and usually
simplifies the logic, especially when free and ECC bytes are
interleaved in the OOB region).

[toc] | [prev] | [next] | [standalone]


#1589280

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2017-02-28 09:40 +0100
Message-ID<tfLu9-1T9-13@gated-at.bofh.it>
In reply to#1589268
Hi Boris,


2017-02-28 17:02 GMT+09:00 Boris Brezillon <boris.brezillon@free-electrons.com>:
> On Tue, 28 Feb 2017 16:21:50 +0900
> Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>
>> Hi.
>>
>>
>> I am seeing the reference implementations for the callback
>> in drivers/mtd/nand/nand_base.c
>>
>>
>> I see only some of them use the argument "oob_required".
>>
>>
>> - oob_required is used
>> nand_read_page_raw()
>> nand_write_page_raw()
>> nand_write_subpage_hwecc()
>>
>>
>> - oob_required is ignored
>> nand_read_page_raw_syndrome()
>> nand_read_page_swecc()
>> nand_read_page_hwecc()
>> nand_read_page_hwecc_oob_first()
>> nand_read_page_syndrome()
>> nand_write_page_raw_syndrome()
>> nand_write_page_swecc()
>> nand_write_page_hwecc()
>> nand_write_page_syndrome()
>>
>>
>>
>> I could not get the logic
>> when "oob_required" is used.
>>
>>
>>
>> When implementing drivers, the "oob_required"
>> should be respected (i.e. oob_poi should be transferred as well),
>> or is it OK to ignore it?
>>
>>
>
> oob_required = true => you must retrieve OOB bytes
> oob_required = false => you can optimize the process and ignore OOB
> bytes, but you can also retrieve them if you don't care about
> optimization. That's usually what's done when you have to retrieve ECC
> bytes (retrieving a few extra OOB bytes is not expensive and usually
> simplifies the logic, especially when free and ECC bytes are
> interleaved in the OOB region).

Ah, I see.

The functions that ignore "oob_required"
always transfer the oob_poi.


Thanks!


-- 
Best Regards
Masahiro Yamada

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web