linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug fix: reschedule check for omap3 PM
@ 2009-03-20 13:21 Tero Kristo
  2009-03-20 13:21 ` [PATCH] OMAP3: PM: Added resched check into idle calls Tero Kristo
  0 siblings, 1 reply; 2+ messages in thread
From: Tero Kristo @ 2009-03-20 13:21 UTC (permalink / raw)
  To: linux-omap

From: Tero Kristo <tero.kristo@nokia.com>

Hi,

This patch fixes a problem where an interrupt may cause scheduling inside
idle loop, but which does not get served due to the decision that has already
been done for the system to enter idle. This can cause nasty latencies in
some cases.

This would not need to be done if interrupts would be disabled inside the
idle loop (arch/arm/kernel/process.c @ cpu_idle), but currently this is not
the case in ARM kernel.

-Tero



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] OMAP3: PM: Added resched check into idle calls
  2009-03-20 13:21 Bug fix: reschedule check for omap3 PM Tero Kristo
@ 2009-03-20 13:21 ` Tero Kristo
  0 siblings, 0 replies; 2+ messages in thread
From: Tero Kristo @ 2009-03-20 13:21 UTC (permalink / raw)
  To: linux-omap

From: Tero Kristo <tero.kristo@nokia.com>

Fixes a bug where scheduling is delayed until next wakeup due to race
condition (e.g. interrupt requests scheduling just before omap_sram_idle
is entered.)

Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
---
 arch/arm/mach-omap2/cpuidle34xx.c |    2 +-
 arch/arm/mach-omap2/pm34xx.c      |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index 62fbb2e..037c02e 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -96,7 +96,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
 	pwrdm_set_next_pwrst(mpu_pd, mpu_state);
 	pwrdm_set_next_pwrst(core_pd, core_state);
 
-	if (omap_irq_pending())
+	if (omap_irq_pending() || need_resched())
 		goto return_sleep_time;
 
 	/* Execute ARM wfi */
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index d39cfa4..6b13076 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -585,7 +585,7 @@ static void omap3_pm_idle(void)
 	if (!omap3_can_sleep())
 		goto out;
 
-	if (omap_irq_pending())
+	if (omap_irq_pending() || need_resched())
 		goto out;
 
 	omap_sram_idle();
-- 
1.5.4.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-20 13:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-20 13:21 Bug fix: reschedule check for omap3 PM Tero Kristo
2009-03-20 13:21 ` [PATCH] OMAP3: PM: Added resched check into idle calls Tero Kristo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).