* [PATCH] spi: rockchip-sfc: disable runtime PM in remove
@ 2026-08-18 13:05 Jiawen Liu
2026-08-18 13:14 ` Mark Brown
2026-08-20 9:48 ` Markus Elfring
0 siblings, 2 replies; 3+ messages in thread
From: Jiawen Liu @ 2026-08-18 13:05 UTC (permalink / raw)
To: Mark Brown, Heiko Stuebner, linux-spi, linux-arm-kernel,
linux-rockchip, linux-kernel
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>
---
diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c
--- a/drivers/spi/spi-rockchip-sfc.c
+++ b/drivers/spi/spi-rockchip-sfc.c
@@ -743,6 +743,11 @@
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));
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] spi: rockchip-sfc: disable runtime PM in remove
2026-08-18 13:05 [PATCH] spi: rockchip-sfc: disable runtime PM in remove Jiawen Liu
@ 2026-08-18 13:14 ` Mark Brown
2026-08-20 9:48 ` Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-08-18 13:14 UTC (permalink / raw)
To: Jiawen Liu
Cc: Heiko Stuebner, linux-spi, linux-arm-kernel, linux-rockchip,
linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 670 bytes --]
On Tue, Aug 18, 2026 at 05:05:50PM +0400, Jiawen Liu wrote:
> 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>
Your name here doesn't match the name you're using in the From: of your
mail, that's going to make tooling think you've not provided a signoff.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] spi: rockchip-sfc: disable runtime PM in remove
2026-08-18 13:05 [PATCH] spi: rockchip-sfc: disable runtime PM in remove Jiawen Liu
2026-08-18 13:14 ` Mark Brown
@ 2026-08-20 9:48 ` Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2026-08-20 9:48 UTC (permalink / raw)
To: 1298662399, linux-spi, linux-rockchip, linux-arm-kernel,
Heiko Stübner, Mark Brown
Cc: LKML, kernel-janitors
…
> Add the missing runtime PM teardown in rockchip_sfc_remove to balance
> the probe's enable and get_noresume calls.
How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
See also once more:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/stable-kernel-rules.rst?h=v7.2#n34
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.2#n145
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.2#n792
Regards,
Markus
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-20 9:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18 13:05 [PATCH] spi: rockchip-sfc: disable runtime PM in remove Jiawen Liu
2026-08-18 13:14 ` Mark Brown
2026-08-20 9:48 ` Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox