[PATCH] mtd: rawnand: intel: disable NAND when probe fails after scanning
James Hilliard
james.hilliard1 at gmail.com
Sun Nov 8 13:05:17 PST 2026
Operations issued by nand_scan() enable NAND mode in EBU_NAND_CON through
ebu_select_chip(). A failed scan or MTD registration releases the DMA
channels and other probe resources without clearing that enable bit.
Disable NAND mode on both error paths, as the removal path already does.
Keep failures before scanning on their existing cleanup path.
Fixes: 0b1039f016e8 ("mtd: rawnand: Add NAND controller support on Intel LGM SoC")
Cc: stable at vger.kernel.org
Signed-off-by: James Hilliard <james.hilliard1 at gmail.com>
---
drivers/mtd/nand/raw/intel-nand-controller.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/intel-nand-controller.c b/drivers/mtd/nand/raw/intel-nand-controller.c
index 477a427dac1f..97c82e9c1af2 100644
--- a/drivers/mtd/nand/raw/intel-nand-controller.c
+++ b/drivers/mtd/nand/raw/intel-nand-controller.c
@@ -690,7 +690,7 @@ static int ebu_nand_probe(struct platform_device *pdev)
/* Scan to find existence of the device */
ret = nand_scan(&ebu_host->chip, 1);
if (ret)
- goto err_cleanup_dma;
+ goto err_disable_nand;
ret = mtd_device_register(mtd, NULL, 0);
if (ret)
@@ -700,6 +700,8 @@ static int ebu_nand_probe(struct platform_device *pdev)
err_clean_nand:
nand_cleanup(&ebu_host->chip);
+err_disable_nand:
+ ebu_nand_disable(&ebu_host->chip);
err_cleanup_dma:
ebu_dma_cleanup(ebu_host);
err_of_node_put:
---
base-commit: 30daaf3e7897b4a8d9b72e5b0c86dd6e2a4d7d85
change-id: 20261107-submit-intel-nand-probe-disable-v1-0605dd04ac6c
Best regards,
--
James Hilliard <james.hilliard1 at gmail.com>
More information about the linux-mtd
mailing list