From patchwork Wed Aug 12 12:54:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemanth V X-Patchwork-Id: 40871 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7CCtDdx016699 for ; Wed, 12 Aug 2009 12:55:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751285AbZHLMzJ (ORCPT ); Wed, 12 Aug 2009 08:55:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751361AbZHLMzJ (ORCPT ); Wed, 12 Aug 2009 08:55:09 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:39293 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751285AbZHLMzI (ORCPT ); Wed, 12 Aug 2009 08:55:08 -0400 Received: from dlep34.itg.ti.com ([157.170.170.115]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id n7CCt37f018096; Wed, 12 Aug 2009 07:55:09 -0500 Received: from dbdmail.itg.ti.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id n7CCsukm028148; Wed, 12 Aug 2009 07:54:57 -0500 (CDT) Received: from 10.24.255.18 (SquirrelMail authenticated user x0099946); by dbdmail.itg.ti.com with HTTP; Wed, 12 Aug 2009 18:24:58 +0530 (IST) Message-ID: <7803.10.24.255.18.1250081698.squirrel@dbdmail.itg.ti.com> In-Reply-To: <03d301ca1b32$14f97d10$LocalHost@wipultra793> References: <873a7y74mj.fsf@deeprootsystems.com> <03d301ca1b32$14f97d10$LocalHost@wipultra793> Date: Wed, 12 Aug 2009 18:24:58 +0530 (IST) Subject: Re: Warnings: pm branch From: "Hemanth V" To: "Hemanth V" Cc: "Pandita, Vikram" , "Kevin Hilman" , linux-omap@vger.kernel.org User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 X-Priority: 3 (Normal) Importance: Normal Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org > ----- Original Message ----- > From: "Kevin Hilman" > To: "Pandita, Vikram" > Cc: > Sent: Tuesday, August 11, 2009 8:57 PM > Subject: Re: Warnings: pm branch > > >> "Pandita, Vikram" writes: >> >>> Has anyone send these warning logs on the pm branch on kevin's tree [1] >>> This seems to be some issue in CpuIdle path with interrupts? >>> >>> <4>WARNING: at arch/arm/kernel/process.c:171 cpu_idle+0x60/0x88() >>> WARNING: at arch/arm/kernel/process.c:171 cpu_idle+0x60/0x88() >>> Modules linked in:Modules linked in: >>> [] [] (unwind_backtrace+0x0/0xdc) >>> (unwind_backtrace+0x0/0xdc >>> ) from [] from [] (warn_slowpath_common+0x48/0x60) >>> (warn_slowpath_common+0x48/0x60) >>> [] [] (warn_slowpath_common+0x48/0x60) >>> (warn_slowpath_common >>> +0x48/0x60) from [] from [] (cpu_idle+0x60/0x88) >>> (cpu_idle+0x60/0x88) >>> [] [] (cpu_idle+0x60/0x88) (cpu_idle+0x60/0x88) from >>> [>> a70>] from [] (start_kernel+0x234/0x28c) >>> (start_kernel+0x234/0x28c) >>> [] [] (start_kernel+0x234/0x28c) >>> (start_kernel+0x234/0x28c) >>> from [<80008034>] from [<80008034>] (0x80008034) >>> (0x80008034) >>> >> >> Yes, I've seen it, but have yet to debug it. >> >> This warning is from the generic ARM idle loop reporting that the OMAP >> idle path is returning with IRQs disabled. >> >> Kevin > > I did some more debugging on this. I added the below instrumentation to > local_irq_disable to capture > the PC of the last call to local_irq_disable. > > extern unsigned long hem_pc; > register unsigned long current_pc asm ("pc"); > > #define local_irq_disable() \ > do { hem_pc = current_pc;raw_local_irq_disable(); > trace_hardirqs_off(); } while (0) > > > When I set a breakpoint at the instruction pointing to > WARN_ON(irqs_disabled()) using > lauterbach and dump hem_pc, I see that the last call to irq_disable is > actuall from cpu_idle itself. > Looks like some recursion is happening. Does anyone have any inputs on this. > > void cpu_idle(void) > { > > local_fiq_enable(); > > /* endless idle loop with no priority at all */ > while (1) { > tick_nohz_stop_sched_tick(1); > leds_event(led_idle_start); > while (!need_resched()) { > #ifdef CONFIG_HOTPLUG_CPU > if (cpu_is_offline(smp_processor_id())) > cpu_die(); > #endif > >>> local_irq_disable(); > > > Thanks > Hemanth > Below patch seems to fix the issue. Signed-off-by: Kevin Hilman --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 8504a21..3014104 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -75,8 +75,10 @@ static void cpuidle_idle_call(void) #endif /* ask the governor for the next state */ next_state = cpuidle_curr_governor->select(dev); + if (need_resched()) - return; + goto out; + target_state = &dev->states[next_state]; /* enter the state and update stats */ @@ -91,6 +93,12 @@ static void cpuidle_idle_call(void) /* give the governor an opportunity to reflect on the outcome */ if (cpuidle_curr_governor->reflect) cpuidle_curr_governor->reflect(dev); + + return; + +out: + local_irq_enable(); + return; } /**