Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit 97aa329

Browse files
Jinjie Ruangregkh
Jinjie Ruan
authored andcommitted
spi: spi-cadence: Fix pm_runtime_set_suspended() with runtime pm enabled
[ Upstream commit 67d4a70 ] It is not valid to call pm_runtime_set_suspended() for devices with runtime PM enabled because it returns -EAGAIN if it is enabled already and working. So, call pm_runtime_disable() before to fix it. Fixes: d36ccd9 ("spi: cadence: Runtime pm adaptation") Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Link: https://patch.msgid.link/20240923040015.3009329-3-ruanjinjie@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 97f7671 commit 97aa329

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/spi/spi-cadence.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -665,8 +665,8 @@ static int cdns_spi_probe(struct platform_device *pdev)
665665

666666
clk_dis_all:
667667
if (!spi_controller_is_target(ctlr)) {
668-
pm_runtime_set_suspended(&pdev->dev);
669668
pm_runtime_disable(&pdev->dev);
669+
pm_runtime_set_suspended(&pdev->dev);
670670
}
671671
remove_ctlr:
672672
spi_controller_put(ctlr);
@@ -688,8 +688,8 @@ static void cdns_spi_remove(struct platform_device *pdev)
688688

689689
cdns_spi_write(xspi, CDNS_SPI_ER, CDNS_SPI_ER_DISABLE);
690690

691-
pm_runtime_set_suspended(&pdev->dev);
692691
pm_runtime_disable(&pdev->dev);
692+
pm_runtime_set_suspended(&pdev->dev);
693693

694694
spi_unregister_controller(ctlr);
695695
}

0 commit comments

Comments
 (0)