From patchwork Fri Jul 22 05:55:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 998322 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6M5uhqU025821 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 22 Jul 2011 05:57:04 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qk8is-00019y-8k; Fri, 22 Jul 2011 05:56:30 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qk8ir-0000OC-Og; Fri, 22 Jul 2011 05:56:29 +0000 Received: from na3sys009aog110.obsmtp.com ([74.125.149.203]) by canuck.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qk8ib-0000Jo-Br for linux-arm-kernel@lists.infradead.org; Fri, 22 Jul 2011 05:56:14 +0000 Received: from mail-gy0-f172.google.com ([209.85.160.172]) (using TLSv1) by na3sys009aob110.postini.com ([74.125.148.12]) with SMTP ID DSNKTikQ+t3Hbz3qPYk1rL6JsSuuPbGdvGa6@postini.com; Thu, 21 Jul 2011 22:56:13 PDT Received: by gyd5 with SMTP id 5so1123309gyd.31 for ; Thu, 21 Jul 2011 22:56:10 -0700 (PDT) Received: by 10.91.163.38 with SMTP id q38mr1461909ago.167.1311314170096; Thu, 21 Jul 2011 22:56:10 -0700 (PDT) Received: from localhost (dragon.ti.com [192.94.94.33]) by mx.google.com with ESMTPS id e21sm450734ano.25.2011.07.21.22.56.07 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jul 2011 22:56:08 -0700 (PDT) From: Nishanth Menon To: Kevin Subject: [PATCH 1/2] OMAP3+: PM: SR: use put_sync_suspend for disabling Date: Fri, 22 Jul 2011 00:55:52 -0500 Message-Id: <1311314153-23531-2-git-send-email-nm@ti.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1311314153-23531-1-git-send-email-nm@ti.com> References: <1311314153-23531-1-git-send-email-nm@ti.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110722_015613_740009_E03E88B1 X-CRM114-Status: GOOD ( 12.98 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.203 listed in list.dnswl.org] Cc: Nishanth Menon , linux-omap , linux-arm , Colin X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 22 Jul 2011 05:57:04 +0000 (UTC) From: Colin Cross omap_sr_disable_reset_volt is called with irqs off in omapx_enter_sleep, as part of idle sequence, this eventually calls sr_disable and pm_runtime_put_sync. pm_runtime_put_sync calls rpm_idle, which will enable interrupts in order to call the callback. In this short interval when interrupts are enabled, scenarios such as the following can occur: while interrupts are enabled, the timer interrupt that is supposed to wake the device out of idle occurs and is acked, so when the CPU finally goes to off, the timer is already gone, missing a wakeup event. Further, as the documentation for runtime states:" However, subsystems can use the pm_runtime_irq_safe() helper function to tell the PM core that a device's ->runtime_suspend() and ->runtime_resume() callbacks should be invoked in atomic context with interrupts disabled (->runtime_idle() is still invoked the default way)." Hence, replace pm_runtime_put_sync with pm_runtime_put_sync_suspend to invoke the suspend handler and shut off the fclk for SmartReflex module instead of using the idle handler in interrupt disabled context. Signed-off-by: Nishanth Menon Signed-off-by: Colin Cross --- arch/arm/mach-omap2/smartreflex.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index fb7dc52..33a027f 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -622,7 +622,7 @@ void sr_disable(struct voltagedomain *voltdm) sr_v2_disable(sr); } - pm_runtime_put_sync(&sr->pdev->dev); + pm_runtime_put_sync_suspend(&sr->pdev->dev); } /**