[PATCH 2/3] spi: rockchip-sfc: Clean up runtime PM on remove

Shawn Lin shawn.lin at rock-chips.com
Mon Sep 28 19:21:31 PDT 2026


Hi Guangshuo

在 2026/09/24 星期四 19:23, Guangshuo Li 写道:
> rockchip_sfc_probe() enables runtime PM and autosuspend before registering
> the controller. After a successful probe, rockchip_sfc_remove() tears down
> the controller and clocks without undoing that runtime PM setup.
> 
> The probe error path resumes the device, drops the temporary usage count,
> disables runtime PM, marks the device suspended, and stops using
> autosuspend before disabling the clocks. The remove path lacks this
> matching cleanup.
> 
> Mirror the existing error-path sequence in rockchip_sfc_remove() before
> disabling the clocks.
> 

Thanks for this patch. However, it was fixed, see:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=34e32e9ade58e32daf933974c9b697d066fc5aaa

> Fixes: 8011709906d0 ("spi: rockchip-sfc: Support pm ops")
> Signed-off-by: Guangshuo Li <lgs201920130244 at gmail.com>
> ---
>   drivers/spi/spi-rockchip-sfc.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c
> index 662a994da60b..6e1c7d6318bb 100644
> --- a/drivers/spi/spi-rockchip-sfc.c
> +++ b/drivers/spi/spi-rockchip-sfc.c
> @@ -747,6 +747,12 @@ static void rockchip_sfc_remove(struct platform_device *pdev)
>   			 DMA_BIDIRECTIONAL);
>   	free_pages((unsigned long)sfc->buffer, get_order(sfc->max_iosize));
>   
> +	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);
> +
>   	clk_disable_unprepare(sfc->clk);
>   	clk_disable_unprepare(sfc->hclk);
>   }




More information about the linux-arm-kernel mailing list