mtd: rawnand: Prevent crossing LUN boundaries during sequential reads
authorMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 15 Dec 2023 12:32:05 +0000 (13:32 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 22 Dec 2023 11:38:46 +0000 (12:38 +0100)
commitbbcd80f53a5e8c27c2511f539fec8c373f500cf4
treefa2a8a82d0eb77a13c54e37c2845301f0e04d9cc
parenta43bdc376deab5fff1ceb93dca55bcab8dbdc1d6
mtd: rawnand: Prevent crossing LUN boundaries during sequential reads

The ONFI specification states that devices do not need to support
sequential reads across LUN boundaries. In order to prevent such event
from happening and possibly failing, let's introduce the concept of
"pause" in the sequential read to handle these cases. The first/last
pages remain the same but any time we cross a LUN boundary we will end
and restart (if relevant) the sequential read operation.

Cc: stable@vger.kernel.org
Fixes: 003fe4b9545b ("mtd: rawnand: Support for sequential cache reads")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Tested-by: Martin Hundebøll <martin@geanix.com>
Link: https://lore.kernel.org/linux-mtd/20231215123208.516590-2-miquel.raynal@bootlin.com
drivers/mtd/nand/raw/nand_base.c
include/linux/mtd/rawnand.h