Skip to content

Commit

Permalink
spi: qup: skip clk_disable_unprepare if the device is already runtime…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Sudeep Holla authored and Mark Brown committed Sep 1, 2016
1 parent 29b4817 commit 9d04d8b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/spi/spi-qup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 9d04d8b

Please sign in to comment.