Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1474594

Applied "spi: qup: skip clk_disable_unprepare if the device is already runtime suspended" to the spi tree

From Mark Brown <broonie@kernel.org>
Newsgroups linux.kernel
Subject Applied "spi: qup: skip clk_disable_unprepare if the device is already runtime suspended" to the spi tree
Date 2016-09-01 23:10 +0200
Message-ID <scHpg-70l-55@gated-at.bofh.it> (permalink)
References <sa26R-Y5-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The patch

   spi: qup: skip clk_disable_unprepare if the device is already runtime suspended

has been applied to the spi tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 9d04d8bc4c18765f6a1f7b632fffe47b4578fb26 Mon Sep 17 00:00:00 2001
From: Sudeep Holla <sudeep.holla@arm.com>
Date: Thu, 25 Aug 2016 13:33:28 +0100
Subject: [PATCH] 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>
---
 drivers/spi/spi-qup.c | 6 ++++--
 1 file 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;
 }
 
-- 
2.8.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] spi: qup: skip clk_disable_unprepare if the device is already runtime suspended Sudeep Holla <sudeep.holla@arm.com> - 2016-08-25 14:40 +0200
  Re: [PATCH] spi: qup: skip clk_disable_unprepare if the device is  already runtime suspended Andy Gross <andy.gross@linaro.org> - 2016-08-25 15:30 +0200
    Re: [PATCH] spi: qup: skip clk_disable_unprepare if the device is  already runtime suspended Sudeep Holla <sudeep.holla@arm.com> - 2016-08-25 15:40 +0200
  Applied "spi: qup: skip clk_disable_unprepare if the device is already runtime suspended" to the spi tree Mark Brown <broonie@kernel.org> - 2016-09-01 23:10 +0200
  Re: [PATCH] spi: qup: skip clk_disable_unprepare if the device is  already runtime suspended Mark Brown <broonie@kernel.org> - 2016-09-01 23:20 +0200
    Re: [PATCH] spi: qup: skip clk_disable_unprepare if the device is  already runtime suspended Sudeep Holla <sudeep.holla@arm.com> - 2016-09-02 10:50 +0200
      Re: [PATCH] spi: qup: skip clk_disable_unprepare if the device is  already runtime suspended Mark Brown <broonie@kernel.org> - 2016-09-02 11:50 +0200
        Re: [PATCH] spi: qup: skip clk_disable_unprepare if the device is  already runtime suspended Sudeep Holla <sudeep.holla@arm.com> - 2016-09-02 12:50 +0200

csiph-web