From cc46fe91eb0eb7fd933fd75ee400d97a0b24537c Mon Sep 17 00:00:00 2001 From: Heinrich Toews Date: Wed, 20 May 2026 16:10:36 +0200 Subject: [PATCH] mtd: spi-nor: core: Restrict blind MRAM reset to mram nodes The spi_nor_everspin_reboot_fix() was executing unconditionally for any SPI NOR device lacking a dedicated reset GPIO. This caused unintended 8-8-8 soft reset sequences and an unnecessary boot delay for unrelated flashes. While the new WOSM p0004263 hardware revision routes the MRAM nRST to a GPIO, older revisions (e.g. p0000042) still rely on nPORz and therefore need this fallback to escape Octal-STR mode during a warm reboot. Limit the blind reset strictly to nodes named "mram" to avoid breaking standard SPI NOR flash initializations. Signed-off-by: Heinrich Toews --- drivers/mtd/spi-nor/core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 58a54e1075c9..e96a7eb8661e 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -3466,6 +3466,13 @@ static void spi_nor_everspin_reboot_fix(struct spi_nor *nor) if (!nor->spimem || !nor->dev) return; + /* + * Limit this hack to nodes explicitly named "mram" to prevent + * sending blind 8-8-8 resets to unrelated SPI NOR flashes. + */ + if (!nor->dev->of_node || !of_node_name_eq(nor->dev->of_node, "mram")) + return; + /* * Logging as dev_info so it appears in dmesg during boot. * This helps verify if the fix is being executed.