From patchwork Thu Sep 1 20:35:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 9309709 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 952DE60760 for ; Thu, 1 Sep 2016 21:24:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58F2E29548 for ; Thu, 1 Sep 2016 21:24:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DB112954A; Thu, 1 Sep 2016 21:24:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F14D129548 for ; Thu, 1 Sep 2016 21:24:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752774AbcIAVHi (ORCPT ); Thu, 1 Sep 2016 17:07:38 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:47632 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756609AbcIAVHC (ORCPT ); Thu, 1 Sep 2016 17:07:02 -0400 Received: from debutante.sirena.org.uk ([2a01:348:6:8808:fab::3] helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bfYhu-0003b9-Ue; Thu, 01 Sep 2016 20:35:33 +0000 Received: from broonie by debutante with local (Exim 4.87) (envelope-from ) id 1bfYhs-0002xJ-12; Thu, 01 Sep 2016 21:35:28 +0100 From: Mark Brown To: Sudeep Holla Cc: Andy Gross , Mark Brown , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, Andy Gross , David Brown , Mark Brown In-Reply-To: <1472128408-7231-1-git-send-email-sudeep.holla@arm.com> Message-Id: Date: Thu, 01 Sep 2016 21:35:28 +0100 X-SA-Exim-Connect-IP: 2a01:348:6:8808:fab::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Applied "spi: qup: skip clk_disable_unprepare if the device is already runtime suspended" to the spi tree X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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 Tested-by: Andy Gross Signed-off-by: Mark Brown --- 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; }