From patchwork Thu Aug 4 15:45:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 1036212 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p74FimTr017965 for ; Thu, 4 Aug 2011 15:44:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754626Ab1HDPor (ORCPT ); Thu, 4 Aug 2011 11:44:47 -0400 Received: from na3sys009aog102.obsmtp.com ([74.125.149.69]:38988 "EHLO na3sys009aog102.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754478Ab1HDPor (ORCPT ); Thu, 4 Aug 2011 11:44:47 -0400 Received: from mail-pz0-f47.google.com ([209.85.210.47]) (using TLSv1) by na3sys009aob102.postini.com ([74.125.148.12]) with SMTP ID DSNKTjq+bTKzsyITXrIlHQ0LWJ2TxUU/pjcH@postini.com; Thu, 04 Aug 2011 08:44:46 PDT Received: by mail-pz0-f47.google.com with SMTP id 2so1747959pzk.6 for ; Thu, 04 Aug 2011 08:44:45 -0700 (PDT) Received: by 10.142.142.1 with SMTP id p1mr899934wfd.71.1312472685260; Thu, 04 Aug 2011 08:44:45 -0700 (PDT) Received: from localhost (c-24-19-7-36.hsd1.wa.comcast.net [24.19.7.36]) by mx.google.com with ESMTPS id p7sm2352010pbn.17.2011.08.04.08.44.44 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 04 Aug 2011 08:44:44 -0700 (PDT) From: Kevin Hilman To: Tony Lindgren Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 5/6] OMAP2+: PM: SmartReflex: use put_sync_suspend for IRQ-safe disabling Date: Thu, 4 Aug 2011 08:45:09 -0700 Message-Id: <1312472710-31758-6-git-send-email-khilman@ti.com> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1312472710-31758-1-git-send-email-khilman@ti.com> References: <1312472710-31758-1-git-send-email-khilman@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 04 Aug 2011 15:44:48 +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 [khilman@ti.com: minor Subject edits] Signed-off-by: Kevin Hilman --- 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 dc8e86a..34c01a7 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -621,7 +621,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); } /**