On Fri, 2023-12-15 at 12:32:06 UTC, Miquel Raynal wrote: > A couple of reports pointed at some strange failures happening a bit > randomly since the introduction of sequential page reads support. After > investigation it turned out the most likely reason for these issues was > the fact that sometimes a (longer) read might happen, starting at the > same page that was read previously. This is optimized by the raw NAND > core, by not sending the READ_PAGE command to the NAND device and just > reading out the data in a local cache. When this page is also flagged as > being the starting point for a sequential read, it means the page right > next will be accessed without the right instructions. The NAND chip will > be confused and will not output correct data. In order to avoid such > situation from happening anymore, we can however handle this case with a > bit of additional logic, to postpone the initialization of the read > sequence by one page. > > Reported-by: Alexander Shiyan <eagle.alexander923@xxxxxxxxx> > Closes: https://lore.kernel.org/linux-mtd/CAP1tNvS=NVAm-vfvYWbc3k9Cx9YxMc2uZZkmXk8h1NhGX877Zg@xxxxxxxxxxxxxx/ > Reported-by: Måns Rullgård <mans@xxxxxxxxx> > Closes: https://lore.kernel.org/linux-mtd/yw1xfs6j4k6q.fsf@xxxxxxxxx/ > Reported-by: Martin Hundebøll <martin@xxxxxxxxxx> > Closes: https://lore.kernel.org/linux-mtd/9d0c42fcde79bfedfe5b05d6a4e9fdef71d3dd52.camel@xxxxxxxxxx/ > Fixes: 003fe4b9545b ("mtd: rawnand: Support for sequential cache reads") > Cc: stable@xxxxxxxxxxxxxxx > Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx> Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next. Miquel