[PATCH] mtd: nand: Disable subpage writes for drivers without ecc->hwctl

Helmut Schaa helmut.schaa at googlemail.com
Wed Apr 9 04:57:55 PDT 2014


On Wed, Apr 9, 2014 at 12:33 PM, Gupta, Pekon <pekon at ti.com> wrote:
>>From: Helmut Schaa [mailto:helmut.schaa at googlemail.com]
>>>On Wed, Apr 9, 2014 at 11:38 AM, Gupta, Pekon <pekon at ti.com> wrote:
> [...]
>>>
>>> (1) if chip->ecc.hwctl() and chip->ecc.calculate are not implemented but you
>>>  still want to use subpage write feature, then you need to provide custom
>>>  implementation for chip->ecc.write_subpage().
>>>  that's same for other interfaces of nand_chip like chip->ecc.write_page().
>>
>>But these don't cause panics :)
>>
> because fsl_elbc_nand.c uses custom implementations of chip->ecc.write_page()
>         @@ fsl_elbc_chip_init(...)
>                 chip->ecc.write_page = fsl_elbc_write_page;
>
> Same needs to be done if subpage write is needed. However, as this is
> a regression so please check if following patch solves your problem.[1]

That was my first approach too, seems to work ok for fsl_elbc_nand but some
other drivers might still experience crashes. A quick grep shows that
sh_flctl might
be affected as well.

So, I'd still argue that it would make more sense to keep the driver interface
behavior sane either by setting NAND_NO_SUBPAGE_WRITE as default or
by using some checks as proposed initially.

Thanks,
Helmut



More information about the linux-mtd mailing list