From: Sudeep Holla Date: Thu, 25 Aug 2016 12:33:28 +0000 (+0100) Subject: spi: qup: skip clk_disable_unprepare if the device is already runtime suspended X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9d04d8bc4c18765f6a1f7b632fffe47b4578fb26;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Tested-by: Andy Gross Signed-off-by: Mark Brown --- 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; }