[PATCH 2/4] mtd: spinand: Make sure continuous read is always disabled during probe

From: Miquel Raynal

Date: Thu Mar 26 2026 - 13:18:55 EST


Recent changes made sure whenever we were using continuous reads, we
would first start by disabling the feature to ensure a well proven and
stable probe sequence. For development purposes, it might also matter to
make sure we always disable continuous reads at first, in case the ECC
configuration would change. Doing this "automatically" will become even
more relevant when we add extra controller flags to prevent continuous
reads at all.

Ensure we disable continuous reads if the feature is available on the
chip, regardless of whether it will be used or not.

Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
---
drivers/mtd/nand/spi/core.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 45c3afb9cceb..dbe2c463fe01 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -953,11 +953,7 @@ static void spinand_cont_read_init(struct spinand_device *spinand)
enum nand_ecc_engine_type engine_type = nand->ecc.ctx.conf.engine_type;

/* OOBs cannot be retrieved so external/on-host ECC engine won't work */
- if (spinand->set_cont_read &&
- (engine_type == NAND_ECC_ENGINE_TYPE_ON_DIE ||
- engine_type == NAND_ECC_ENGINE_TYPE_NONE)) {
- spinand->cont_read_possible = true;
-
+ if (spinand->set_cont_read) {
/*
* Ensure continuous read is disabled on probe.
* Some devices retain this state across soft reset,
@@ -965,6 +961,10 @@ static void spinand_cont_read_init(struct spinand_device *spinand)
* in false positive returns from spinand_isbad().
*/
spinand_cont_read_enable(spinand, false);
+
+ if (engine_type == NAND_ECC_ENGINE_TYPE_ON_DIE ||
+ engine_type == NAND_ECC_ENGINE_TYPE_NONE)
+ spinand->cont_read_possible = true;
}
}


--
2.51.1