Skip to content

Commit a62c459

Browse files
committed
mtd: rawnand: Prevent sequential reads with on-die ECC engines
Some devices support sequential reads when using the on-die ECC engines, some others do not. It is a bit hard to know which ones will break other than experimentally, so in order to avoid such a difficult and painful task, let's just pretend all devices should avoid using this optimization when configured like this. Cc: stable@vger.kernel.org Fixes: 003fe4b ("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-4-miquel.raynal@bootlin.com
1 parent 7c9414c commit a62c459

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/mtd/nand/raw/nand_base.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5170,6 +5170,14 @@ static void rawnand_late_check_supported_ops(struct nand_chip *chip)
51705170
/* The supported_op fields should not be set by individual drivers */
51715171
WARN_ON_ONCE(chip->controller->supported_op.cont_read);
51725172

5173+
/*
5174+
* Too many devices do not support sequential cached reads with on-die
5175+
* ECC correction enabled, so in this case refuse to perform the
5176+
* automation.
5177+
*/
5178+
if (chip->ecc.engine_type == NAND_ECC_ENGINE_TYPE_ON_DIE)
5179+
return;
5180+
51735181
if (!nand_has_exec_op(chip))
51745182
return;
51755183

0 commit comments

Comments
 (0)