aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-qup.c
diff options
context:
space:
mode:
authorSudeep Holla <sudeep.holla@arm.com>2016-08-25 13:33:28 +0100
committerMark Brown <broonie@kernel.org>2016-09-01 21:29:11 +0100
commit9d04d8bc4c18765f6a1f7b632fffe47b4578fb26 (patch)
tree5bb2734ab752524128532123c8c267da95221f67 /drivers/spi/spi-qup.c
parentLinux 4.8-rc1 (diff)
downloadlinux-dev-9d04d8bc4c18765f6a1f7b632fffe47b4578fb26.tar.xz
linux-dev-9d04d8bc4c18765f6a1f7b632fffe47b4578fb26.zip
spi: qup: skip clk_disable_unprepare if the device is already runtime suspended
If the spi device is already runtime suspended, if spi_qup_suspend is executed during suspend-to-idle or suspend-to-ram it will result in the a splat from unpreparing a non-prepared clock. This patch fixes the issue by executing clk_disable_unprepare conditionally in spi_qup_suspend. [Reworded commit message to remove irrelevant backtrace -- broonie] Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Tested-by: Andy Gross <andy.gross@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-qup.c')
-rw-r--r--drivers/spi/spi-qup.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c
index c338ef1136f6..a047e9882da8 100644
--- a/drivers/spi/spi-qup.c
+++ b/drivers/spi/spi-qup.c
@@ -982,8 +982,10 @@ static int spi_qup_suspend(struct device *device)
if (ret)
return ret;
- clk_disable_unprepare(controller->cclk);
- clk_disable_unprepare(controller->iclk);
+ if (!pm_runtime_suspended(device)) {
+ clk_disable_unprepare(controller->cclk);
+ clk_disable_unprepare(controller->iclk);
+ }
return 0;
}