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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Feb 2024 00:18:50 +0000 (16:18 -0800)
commitf813840066ca4908cda00de6562e2a4055ac619b
treed261ab358da3b65ddac2ec88296e59bc80b51fa4
parent38c12f10990ad6e63ddef2f20c1b066e5e4d34fd
mtd: rawnand: Prevent crossing LUN boundaries during sequential reads

commit bbcd80f53a5e8c27c2511f539fec8c373f500cf4 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/nand/raw/nand_base.c
include/linux/mtd/rawnand.h