Re: [PATCH v1] mtd: spinand: micron: correct parameters

Frieder Schrempf
2023-08-16T15:36:45Z

On 16.08.23 17:28, Martin Kurbanov wrote:
> Hi Frieder.
>
> On 16.08.2023 10:21, Frieder Schrempf wrote:
>> I'm okay with 1. and with adjusting region->offset to 4. But I don't
>> really get why we want to restrict the free oob data to the
>> non-ECC-protected area only. Is this specific to Micron? Other SPI NAND
>> drivers also spread the free area over both, the ECC-protected and the
>> non-protected bytes. Why do it differently here?
>
> We encountered a problem with the JFFS2 file system: JFFS2 marks erased
> blocks with a marker to avoid re-erasing them. To do this, it writes
> a special marker (cleanmarker) in the free OOB area. And if this OOB
> area is protected by ECC, the ECC will be written. However, during
> the next write to the main area of the same block, the ECC will be
> incorrect because it's necessary to program both the main area and
> the OOB area at one programming time, so that the ECC parity code can
> be calculated properly. Other SPI NAND flash also susceptible to
> this problem.

Thanks for the explanation. As this is a generic issue, we need to fix
it in the core and not in the Micron driver.

Also I wonder if JFFS2 should instead write the cleanmarker with ECC
being turned of explicitly.

I don't know enough about NAND and JFFS2 to point out a correct fix, but
I hope Miquel and Richard have some ideas.