Re: [PATCH] mtd: rawnand: onfi: read parameter pages in one go

Miquel Raynal
2024-05-16T08:14:01Z

Hi Sascha,

s.hauer@pengutronix.de wrote on Tue, 14 May 2024 15:41:40 +0200:

> nand_read_data_op() is not supported by all NAND controllers.
> nand_change_read_column_op() is not supported or at least is hard to
> support by NAND controllers that use a different page layout than
> expected by the NAND core.

I'm sorry but RNDOUT is not so hard to support, and I know no NAND
controller without this feature (I think even the first mxc controller
supports it?). However, the command does not exist on small page NANDs
(512 bytes). TBH I have never seen such a device myself, so I wonder
how spread they still are.

What may not be supported however are the DATA_IN cycles.

> Instead of relying on these functions
> just read the three parameter pages in one go.

Bitflips in parameter pages are very rare, they are normally quite
robust. The proposed solution impacts *all* NANDs, because the I/O
chip speed is at its lowest. There is no reason in most cases to do
that.

I agree there is a problem with the patch I proposed and we need to
settle. And we simply cannot make RNDOUT calls randomly here as long as
we want to support small page NANDs.

I believe we should do something like:

nand_read_param_page_op(0)
if (corrupted) {
if (supported.datain)
data_in(); /* this is faster */
else
nand_read_param_page_op(1)
}

I'll try to draft something (also applies to the jedec discovery).