[PATCH v3 09/10] mtd: nand: utilize oob_required parameter

Brian Norris computersforpeace at gmail.com
Mon Apr 30 16:12:03 EDT 2012


On Mon, Apr 30, 2012 at 12:59 PM, Brian Norris
<computersforpeace at gmail.com> wrote:
> On Sun, Apr 29, 2012 at 5:47 AM, Shmulik Ladkani
> <shmulik.ladkani at gmail.com> wrote:
>> - Fix your 02/10 patch, in away that the passed 'oob_required' argument
>>  will be somehow set according to the 'snd_cmd'
>
> I'm fine with adding an 'else' to the 'if (likely(sndcmd))', so that
> we get something like this in patch 2:
>
>               if (likely(sndcmd)) {
>                       chip->cmdfunc(mtd, NAND_CMD_READ0, 0x00, page);
>                       sndcmd = 0;
> +              } else {
> +                      /* force driver to read OOB, for sequential read */
> +                      oob_required = 1;
>               }
>
> I think that would take care of the corner case where we use autoincrement.

On second thought, this is not good enough. I need to actually check
for CANAUTOINCR(chip). This is a better candidate:

+ /* force read OOB, for auto-incremented read */
+ if (unlikely(NAND_CANAUTOINCR(chip)))
+         oob_required = 1;

Brian



More information about the linux-mtd mailing list