From patchwork Sat Jul 9 21:37:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 960362 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p69Lbsba007532 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 9 Jul 2011 21:38:15 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QffDb-0007FZ-KI; Sat, 09 Jul 2011 21:37:43 +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 1QffDb-0006cp-8F; Sat, 09 Jul 2011 21:37:43 +0000 Received: from na3sys009aog116.obsmtp.com ([74.125.149.240]) by canuck.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1QffDV-0006cW-K9 for linux-arm-kernel@lists.infradead.org; Sat, 09 Jul 2011 21:37:38 +0000 Received: from mail-yx0-f170.google.com ([209.85.213.170]) (using TLSv1) by na3sys009aob116.postini.com ([74.125.148.12]) with SMTP ID DSNKThjKHUsqPG+NCIjXCXYwHLyC1yNB9qZo@postini.com; Sat, 09 Jul 2011 14:37:37 PDT Received: by yxk8 with SMTP id 8so1310847yxk.29 for ; Sat, 09 Jul 2011 14:37:32 -0700 (PDT) Received: by 10.236.157.97 with SMTP id n61mr3895665yhk.516.1310247452567; Sat, 09 Jul 2011 14:37:32 -0700 (PDT) Received: from localhost (dragon.ti.com [192.94.94.33]) by mx.google.com with ESMTPS id v25sm593063yhk.64.2011.07.09.14.37.30 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 09 Jul 2011 14:37:31 -0700 (PDT) From: Nishanth Menon To: linux-omap Subject: [PATCH] OMAP3+: SR: ensure pm-runtime callbacks can be invoked with IRQ disabled Date: Sat, 9 Jul 2011 14:37:21 -0700 Message-Id: <1310247441-2709-1-git-send-email-nm@ti.com> X-Mailer: git-send-email 1.7.1 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110709_173737_934242_5DCCF8E3 X-CRM114-Status: GOOD ( 11.55 ) 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.240 listed in list.dnswl.org] Cc: Kevin Hilman , Nishanth Menon , linux-arm 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 (demeter2.kernel.org [140.211.167.43]); Sat, 09 Jul 2011 21:38:15 +0000 (UTC) SmartReflex should be disabled while entering low power mode due to a) SmartReflex values are not defined for retention voltageFurther b) with SmartReflex enabled, if CPU enters lower c-states, FSM will try to bump the voltage to current OPP's voltage for which it has entered c-state; hence SmartReflex needs to be disabled for MPU, CORE and IVA voltage domains in idle path before enabling auto retention voltage achievement on the device. However, since the current pm_runtime setup for SmartReflex devices are setup to allow callbacks to be invoked with interrupts enabled, calling SmartReflex enable/disable from other contexts such as idle paths where preemption is disabled causes warnings such as the following indicating of a potential race. [ 82.023895] [] (__irq_svc+0x3c/0x120) from [] (_raw_spin_unlock_irq+0x28/0x2c) [ 82.023895] [] (_raw_spin_unlock_irq+0x28/0x2c) from [] (rpm_callback+0x4c/0x68) [ 82.023956] [] (rpm_callback+0x4c/0x68) from [] (rpm_resume+0x338/0x53c) [ 82.023956] [] (rpm_resume+0x338/0x53c) from [] (__pm_runtime_resume+0x48/0x60) [ 82.023986] [] (__pm_runtime_resume+0x48/0x60) from [] (sr_enable+0xa8/0x19c) [ 82.023986] [] (sr_enable+0xa8/0x19c) from [] (omap_sr_enable+0x50/0x90) [ 82.024017] [] (omap_sr_enable+0x50/0x90) from [] (omap4_enter_sleep+0x138/0x168) Instead, we use pm_runtime_irq_safe to tell the PM core that callbacks can be invoked in interrupt disabled contexts. Acked-by: Rajendra Nayak Signed-off-by: Nishanth Menon --- arch/arm/mach-omap2/smartreflex.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index f8c6305..444c5b2 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -862,6 +862,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); pm_runtime_enable(&pdev->dev); + pm_runtime_irq_safe(&pdev->dev); sr_info->pdev = pdev; sr_info->srid = pdev->id;