[PATCH 15/58] mtd: rawnand: tegra: retain open-handle state on removal
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Sat Nov 7 12:32:11 PST 2026
Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] mtd: rawnand: tegra: unclocked register access in
tegra_nand_irq() [1]
--
commit 6164eede324ed80f4bb2c1a0eea0f8635af28e57
Author: James Hilliard <james.hilliard1 at gmail.com>
mtd: rawnand: tegra: retain open-handle state on removal
This commit switches the Tegra NAND chip and controller allocations to
reference-counted release callbacks and disconnects the chip before
suspending the controller on removal.
> diff --git a/drivers/mtd/nand/raw/tegra_nand.c b/drivers/mtd/nand/raw/tegra_nand.c
> index 7f9eb5f042a7e..da7791741b9d4 100644
> --- a/drivers/mtd/nand/raw/tegra_nand.c
> +++ b/drivers/mtd/nand/raw/tegra_nand.c
[ ... ]
> @@ -1232,10 +1254,11 @@ static void tegra_nand_remove(struct platform_device *pdev)
>
> WARN_ON(mtd_device_unregister(mtd));
>
> - nand_cleanup(chip);
> + nand_disconnect(chip);
>
> pm_runtime_put_sync_suspend(ctrl->dev);
> pm_runtime_force_suspend(ctrl->dev);
> + mtd_put_master(mtd);
> }
[Severity: High]
This problem wasn't introduced by this patch, but can tegra_nand_irq()
access unclocked registers after pm_runtime_force_suspend() [1]?
tegra_nand_probe() registers tegra_nand_irq() with devm_request_irq(), so
the IRQ remains active until devres cleanup runs after tegra_nand_remove()
(and after the err_put_pm path in tegra_nand_probe()) returns. In the
meantime, pm_runtime_force_suspend() disables ctrl->clk, and any pending or
spurious interrupt before devres frees the IRQ causes tegra_nand_irq() to
read ISR and DMA_MST_CTRL while the controller is unclocked, triggering an
asynchronous external abort on Tegra.
[1] https://sashiko.dev/#/bug/linux-ae385c5a-5cfb-462a-ab95-dd13d6f5e107
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261107-submit-rawnand-retained-handle-lifetime-v1-v1-0-0181ef0cc4c8@gmail.com?part=15
More information about the linux-mtd
mailing list