]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mtd: spinand: Make sure continuous read is always disabled during probe
authorMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 26 Mar 2026 16:47:16 +0000 (17:47 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 4 May 2026 13:27:03 +0000 (15:27 +0200)
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@bootlin.com>
drivers/mtd/nand/spi/core.c

index 99a2494554ef1461b3338da6130032e8d29cc5f3..1d631054bb24eb81168630ed83610397b58f0435 100644 (file)
@@ -967,11 +967,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,
@@ -979,6 +975,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;
        }
 }