linux/drivers/mtd/nand/spi
Sagnik Sasmal 1c1a342ace mtd: spinand: Do not update the QE bit on devices without one
Commit be0b86c648 ("mtd: spinand: Gather all the bus interface
steps in one single function") moved quad-enable setup into
spinand_configure_chip(). The new code only determines whether quad
mode is needed when SPINAND_HAS_QE_BIT is set, but calls
spinand_init_quad_enable() unconditionally. This clears configuration
register bit 0 on devices without a QE bit.

That bit is not universally a QE bit. On the Winbond W25N02KV it is
H-DIS, which disables the active-low HOLD function. Clearing H-DIS
enables HOLD during single and dual I/O operations. If IO3 is not kept
high, the flash can pause a command and ignore clock and data.

H-DIS is not restored by the FFh reset command, allowing the incorrect
state to survive an SoC warm reboot while the flash remains powered.

Before the refactoring, spinand_init_quad_enable() returned without
touching the configuration register on devices without
SPINAND_HAS_QE_BIT. Restore that behavior by only calling the helper
when the flag is set.

Return zero explicitly once SSDR configuration completes, as all errors
are returned immediately. This avoids returning an uninitialized value
when neither optional configuration step runs.

The regression was reproduced on a JioRouter JIDU6401 with an MT7986
SoC and a W25N02KV. With Linux 6.18.44, sysupgrade failed and the
following warm reboot hung in BL2. With this change applied, both
sysupgrade and warm reboot completed successfully.

Fixes: be0b86c648 ("mtd: spinand: Gather all the bus interface steps in one single function")
Cc: stable@vger.kernel.org
Suggested-by: Miquel Raynal <miquel.raynal@bootlin.com>
Assisted-by: LLM
Signed-off-by: Sagnik Sasmal <sagnik@sagnik.me>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
2026-09-25 16:53:51 +02:00
..
alliancememory.c mtd: spinand: Add a frequency field to all READ_FROM_CACHE variants 2025-07-30 11:32:16 +02:00
ato.c mtd: spinand: Add a frequency field to all READ_FROM_CACHE variants 2025-07-30 11:32:16 +02:00
core.c mtd: spinand: Do not update the QE bit on devices without one 2026-09-25 16:53:51 +02:00
dosilicon.c mtd: spinand: add support for Dosilicon DS35Q1GA/DS35M1GA 2025-12-16 09:13:46 +01:00
esmt.c * MTD 2026-02-13 15:06:58 -08:00
fmsh.c mtd: spinand: fmsh: fix FM25G01B/FM25G02B Quad I/O read dummy cycles 2026-08-07 15:54:21 +02:00
foresee.c mtd: spinand: add Foresee F35SQB002G flash support 2026-01-29 20:22:14 +01:00
gigadevice.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
heyangtek.c mtd: spinand: add support for HeYangTek HYF1GQ4UDACAE 2026-06-29 16:46:32 +02:00
Kconfig mtd: spinand: Use the external ECC engine logic 2020-12-10 22:37:30 +01:00
macronix.c mtd: spinand: macronix: Enable randomizer support 2026-05-27 11:07:10 +02:00
Makefile mtd: spinand: add support for HeYangTek HYF1GQ4UDACAE 2026-06-29 16:46:32 +02:00
micron.c mtd: spinand: Make use of the operation templates through SPINAND_OP() 2026-01-29 20:21:40 +01:00
otp.c mtd: spinand: otp: add helpers functions 2025-02-10 15:52:59 +01:00
paragon.c mtd: spinand: Add a frequency field to all READ_FROM_CACHE variants 2025-07-30 11:32:16 +02:00
skyhigh.c mtd: spinand: Add a frequency field to all READ_FROM_CACHE variants 2025-07-30 11:32:16 +02:00
toshiba.c mtd: spinand: Make use of the operation templates through SPINAND_OP() 2026-01-29 20:21:40 +01:00
winbond.c mtd: spinand: winbond: Add support for continuous reads on W25NxxJW 2026-05-04 15:25:12 +02:00
xtx.c mtd: spinand: Add a frequency field to all READ_FROM_CACHE variants 2025-07-30 11:32:16 +02:00