Skip to content

Commit

Permalink
spi: tegra20-slink: Put device into suspend on driver removal
Browse files Browse the repository at this point in the history
pm_runtime_disable() cancels all pending power requests, while they
should be completed for the Tegra SPI driver. Otherwise SPI clock won't
be disabled ever again because clk refcount will become unbalanced.
Enforce runtime PM suspension to put device into expected state before
driver is unbound and device's RPM state is reset by driver's core.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20211023225951.14253-1-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Dmitry Osipenko authored and Mark Brown committed Oct 26, 2021
1 parent ca9b8f5 commit 3cc1cb3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/spi/spi-tegra20-slink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ static int tegra_slink_probe(struct platform_device *pdev)
exit_pm_put:
pm_runtime_put(&pdev->dev);
exit_pm_disable:
pm_runtime_disable(&pdev->dev);
pm_runtime_force_suspend(&pdev->dev);

tegra_slink_deinit_dma_param(tspi, false);
exit_rx_dma_free:
Expand All @@ -1143,7 +1143,7 @@ static int tegra_slink_remove(struct platform_device *pdev)

free_irq(tspi->irq, tspi);

pm_runtime_disable(&pdev->dev);
pm_runtime_force_suspend(&pdev->dev);

if (tspi->tx_dma_chan)
tegra_slink_deinit_dma_param(tspi, false);
Expand Down

0 comments on commit 3cc1cb3

Please sign in to comment.