From: Miquel Raynal Date: Thu, 26 Mar 2026 16:47:16 +0000 (+0100) Subject: mtd: spinand: Make sure continuous read is always disabled during probe X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=7845161edef8008710230efea3839757d0b03d25;p=thirdparty%2Flinux.git mtd: spinand: Make sure continuous read is always disabled during probe 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 --- diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index 99a2494554ef..1d631054bb24 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -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; } }