Skip to content

Commit 6a06e89

Browse files
JeffyCNbroonie
authored andcommitted
spi: rockchip: Fix clock handling in remove
We are assuming clocks enabled when calling rockchip_spi_remove, which is not always true. Those clocks might already been disabled by the runtime PM at that time. Call pm_runtime_get_sync before trying to disable clocks to avoid that. Signed-off-by: Jeffy Chen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 43de979 commit 6a06e89

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/spi/spi-rockchip.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,11 +816,15 @@ static int rockchip_spi_remove(struct platform_device *pdev)
816816
struct spi_master *master = spi_master_get(platform_get_drvdata(pdev));
817817
struct rockchip_spi *rs = spi_master_get_devdata(master);
818818

819-
pm_runtime_disable(&pdev->dev);
819+
pm_runtime_get_sync(&pdev->dev);
820820

821821
clk_disable_unprepare(rs->spiclk);
822822
clk_disable_unprepare(rs->apb_pclk);
823823

824+
pm_runtime_put_noidle(&pdev->dev);
825+
pm_runtime_disable(&pdev->dev);
826+
pm_runtime_set_suspended(&pdev->dev);
827+
824828
if (rs->dma_tx.ch)
825829
dma_release_channel(rs->dma_tx.ch);
826830
if (rs->dma_rx.ch)

0 commit comments

Comments
 (0)