Re: [PATCH v2] mtd: rawnand: Ensure the nand chip supports cached reads

From: Miquel Raynal
Date: Mon Oct 02 2023 - 09:50:16 EST


Hi Martin,

martin@xxxxxxxxxx wrote on Thu, 28 Sep 2023 09:19:56 +0200:

> Hi Miquel,
>
> On Wed, 2023-09-27 at 17:05 +0200, Miquel Raynal wrote:
> > Hi Martin,
> >
> > miquel.raynal@xxxxxxxxxxx wrote on Tue, 26 Sep 2023 13:27:25 +0200:
> >
> > > Hi Martin,
> > >
> > > + Bean and Domenico, there is a question for you below.
> > >
> > > martin@xxxxxxxxxx wrote on Mon, 25 Sep 2023 13:01:06 +0200:
> > >
> > > > Hi Rouven,
> > > >
> > > > On Fri, 2023-09-22 at 16:17 +0200, Rouven Czerwinski wrote: 
> > > > > Both the JEDEC and ONFI specification say that read cache
> > > > > sequential
> > > > > support is an optional command. This means that we not only
> > > > > need to
> > > > > check whether the individual controller supports the command,
> > > > > we also
> > > > > need to check the parameter pages for both ONFI and JEDEC NAND
> > > > > flashes
> > > > > before enabling sequential cache reads.
> > > > >
> > > > > This fixes support for NAND flashes which don't support
> > > > > enabling
> > > > > cache
> > > > > reads, i.e. Samsung K9F4G08U0F or Toshiba TC58NVG0S3HTA00.
> > > > >
> > > > > Sequential cache reads are now only available for ONFI and
> > > > > JEDEC
> > > > > devices, if individual vendors implement this, it needs to be
> > > > > enabled
> > > > > per vendor.
> > > > >
> > > > > Tested on i.MX6Q with a Samsung NAND flash chip that doesn't
> > > > > support
> > > > > sequential reads.
> > > > >
> > > > > Fixes: 003fe4b9545b ("mtd: rawnand: Support for sequential
> > > > > cache
> > > > > reads")
> > > > > Cc: stable@xxxxxxxxxxxxxxx
> > > > > Signed-off-by: Rouven Czerwinski
> > > > > <r.czerwinski@xxxxxxxxxxxxxx>   
> > > >
> > > > Thanks for this. It works as expected for my Toshiba chip,
> > > > obviously
> > > > because it doesn't use ONFI or JEDEC.
> > > >
> > > > Unfortunately, my Micron chip does use ONFI, and it sets the
> > > > cached-
> > > > read-supported bit. It then fails when reading afterwords:
> >
> > I might have over reacted regarding my findings in Micron's
> > datasheet,
> > I need to know if you use the on-die ECC engine or if you use the one
> > on the controller. In the former case the failure is expected. In the
> > latter case, it's not.
>
> I use the default, which seems to be the controller engine?

Yeah, you're using the gpmi NAND controller right? If that's the case,
it seems that only ECC correction is supported.

Thanks,
Miquèl