]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
spi: fsl-qspi: use devm function instead of driver remove
authorHan Xu <han.xu@nxp.com>
Sat, 6 Sep 2025 20:53:20 +0000 (16:53 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Sep 2025 16:56:29 +0000 (18:56 +0200)
commit50ae352c1848cab408fb4f7d7f50c71f818bbdbf
treeb7d666bb8f190bab0a61c565d5a0608f29df849c
parent0ef7058b4dc6fcef622ac23b45225db57f17b83f
spi: fsl-qspi: use devm function instead of driver remove

[ Upstream commit 40369bfe717e96e26650eeecfa5a6363563df6e4 ]

Driver use devm APIs to manage clk/irq/resources and register the spi
controller, but the legacy remove function will be called first during
device detach and trigger kernel panic. Drop the remove function and use
devm_add_action_or_reset() for driver cleanup to ensure the release
sequence.

Trigger kernel panic on i.MX8MQ by
echo 30bb0000.spi >/sys/bus/platform/drivers/fsl-quadspi/unbind

Cc: stable@vger.kernel.org
Fixes: 8fcb830a00f0 ("spi: spi-fsl-qspi: use devm_spi_register_controller")
Reported-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Han Xu <han.xu@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20250326224152.2147099-1-han.xu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
[ Adjust context ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spi-fsl-qspi.c