summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiawen Liu <1298662399@qq.com>2026-08-18 17:05:50 +0400
committerMark Brown <broonie@kernel.org>2026-09-09 16:29:22 +0100
commit34e32e9ade58e32daf933974c9b697d066fc5aaa (patch)
tree9c158132db4f30d0522b405cdbc750cb4565e83a
parentc595dcbce20f55c98cd9b0003c26db3787e0ddee (diff)
downloadlinux-next-34e32e9ade58e32daf933974c9b697d066fc5aaa.tar.gz
linux-next-34e32e9ade58e32daf933974c9b697d066fc5aaa.zip
spi: rockchip-sfc: disable runtime PM in remove
rockchip_sfc_probe enables runtime PM and leaves the device active with a usage count held by pm_runtime_get_noresume(). The remove callback only disables the clocks and does not disable runtime PM, leaving the device in an inconsistent state and leaking the runtime PM reference. Add the missing runtime PM teardown in rockchip_sfc_remove to balance the probe's enable and get_noresume calls. Signed-off-by: jiawen <1298662399@qq.com> Link: https://patch.msgid.link/tencent_DD16C0EEDFEF4ACAFAB5A23EC8235D462707@qq.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi-rockchip-sfc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c
index 662a994da60b..43e91b49bb1d 100644
--- a/drivers/spi/spi-rockchip-sfc.c
+++ b/drivers/spi/spi-rockchip-sfc.c
@@ -743,6 +743,11 @@ static void rockchip_sfc_remove(struct platform_device *pdev)
struct spi_controller *host = sfc->host;
spi_unregister_controller(host);
+ pm_runtime_get_sync(&pdev->dev);
+ pm_runtime_put_noidle(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
+ pm_runtime_set_suspended(&pdev->dev);
+ pm_runtime_dont_use_autosuspend(&pdev->dev);
dma_unmap_single(&pdev->dev, sfc->dma_buffer, sfc->max_iosize,
DMA_BIDIRECTIONAL);
free_pages((unsigned long)sfc->buffer, get_order(sfc->max_iosize));