]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mtd: spinand: Disable continuous read during probe
authorDavid LaPorte <dalaport@amazon.com>
Fri, 30 Jan 2026 01:33:22 +0000 (17:33 -0800)
committerSasha Levin <sashal@kernel.org>
Wed, 4 Mar 2026 12:21:19 +0000 (07:21 -0500)
commitbc1492651253e59936eab1858efa9033c8086ed7
treebf4962287a6d944d39526d1b269aa9e56306edf9
parent5a435b0e460988f70e17fd248c47774b4bfa66ab
mtd: spinand: Disable continuous read during probe

[ Upstream commit b4af7d194dc879353829f3c56988a68fbba1fbdd ]

Macronix serial NAND devices with continuous read support do not
clear the configuration register on soft reset and lack a hardware
reset pin. When continuous read is interrupted (e.g., during reboot),
the feature remains enabled at the device level.

With continuous read enabled, the OOB area becomes inaccessible and
all reads are instead directed to the main area. As a result, during
partition allocation as part of MTD device registration, the first two
bytes of the main area for the master block are read and indicate that
the block is bad. This process repeats for every subsequent block for
the partition.

All reads and writes that reference the BBT find no good blocks and
fail.

The only paths for recovery from this state are triggering the
continuous read feature by way of raw MTD reads or through a NAND
device power drain.

Disable continuous read explicitly during spinand probe to ensure
quiescent feature state.

Fixes: 631cfdd0520d ("mtd: spi-nand: Add continuous read support")
Cc: stable@vger.kernel.org
Signed-off-by: David LaPorte <dalaport@amazon.com>
Reviewed-by: Gunnar Kudrjavets <gunnarku@amazon.com>
Reviewed-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mtd/nand/spi/core.c