All of lore.kernel.org
 help / color / mirror / Atom feed
* [NAND Question] When oob_required is used?
@ 2017-02-28  7:21 Masahiro Yamada
  2017-02-28  8:02 ` Boris Brezillon
  0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2017-02-28  7:21 UTC (permalink / raw)
  To: Boris Brezillon, linux-mtd; +Cc: masahiroy, Linux Kernel Mailing List

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [NAND Question] When oob_required is used?
  2017-02-28  7:21 [NAND Question] When oob_required is used? Masahiro Yamada
@ 2017-02-28  8:02 ` Boris Brezillon
  2017-02-28  8:26   ` Masahiro Yamada
  0 siblings, 1 reply; 3+ messages in thread
From: Boris Brezillon @ 2017-02-28  8:02 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-mtd, masahiroy, Linux Kernel Mailing List

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).

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [NAND Question] When oob_required is used?
  2017-02-28  8:02 ` Boris Brezillon
@ 2017-02-28  8:26   ` Masahiro Yamada
  0 siblings, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2017-02-28  8:26 UTC (permalink / raw)
  To: Boris Brezillon; +Cc: linux-mtd, Linux Kernel Mailing List

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-28  8:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-28  7:21 [NAND Question] When oob_required is used? Masahiro Yamada
2017-02-28  8:02 ` Boris Brezillon
2017-02-28  8:26   ` Masahiro Yamada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.