Skip to contentSkip to conversation

idle fix

GIT PULL Ingo Molnar 1 participant 1 message Apr 26, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Linus, please pull the following fix:

git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-idle-fix.git for-linus

i'd normally wait for Len/Venki to ack the ACPI bits but this seems more urgent as people are seeing lockups via the ACPI-idle route, as per:

http://lkml.org/lkml/2008/4/26/235

Thanks,

Ingo

------------------>
Peter Zijlstra (1):
fix idle (arch, acpi and apm) and lockdep

 arch/x86/kernel/apm_32.c      |    3 +
 arch/x86/kernel/process.c     |  117 +++++++++++++++++++++++++++++++++++++++
 arch/x86/kernel/process_32.c  |  118 +--------------------------------------
 arch/x86/kernel/process_64.c  |  123 +----------------------------------------
 drivers/acpi/processor_idle.c |   19 +++---
 include/asm-x86/processor.h   |    1 +
 6 files changed, 137 insertions(+), 244 deletions(-)
arch/x86/kernel/apm_32.c +3 -0
index f0030a0..e4ea362 100644
@@ -904,6 +904,7 @@ recalc:
 			original_pm_idle();
 		else
 			default_idle();
+		local_irq_disable();
 		jiffies_since_last_check = jiffies - last_jiffies;
 		if (jiffies_since_last_check > idle_period)
 			goto recalc;
@@ -911,6 +912,8 @@ recalc:
 
 	if (apm_idle_done)
 		apm_do_busy();
+
+	local_irq_enable();
 }
 
 /**
arch/x86/kernel/process.c +117 -0

126 lines not on this page · raw message

arch/x86/kernel/process_32.c +4 -114

143 lines not on this page · raw message

arch/x86/kernel/process_64.c +3 -120

139 lines not on this page · raw message

drivers/acpi/processor_idle.c +9 -10
index 788da97..0d90ff5 100644
@@ -418,13 +418,12 @@ static void acpi_processor_idle(void)
 
 	cx = pr->power.state;
 	if (!cx || acpi_idle_suspend) {
-		if (pm_idle_save)
-			pm_idle_save();
-		else
+		if (pm_idle_save) {
+			pm_idle_save(); /* enables IRQs */
+		} else {
 			acpi_safe_halt();
-
-		if (irqs_disabled())
 			local_irq_enable();
+		}
 
 		return;
 	}
@@ -520,10 +519,12 @@ static void acpi_processor_idle(void)
 		 * Use the appropriate idle routine, the one that would
 		 * be used without acpi C-states.
 		 */
-		if (pm_idle_save)
-			pm_idle_save();
-		else
+		if (pm_idle_save) {
+			pm_idle_save(); /* enables IRQs */
+		} else {
 			acpi_safe_halt();
+			local_irq_enable();
+		}
 
 		/*
 		 * TBD: Can't get time duration while in C1, as resumes
@@ -534,8 +535,6 @@ static void acpi_processor_idle(void)
 		 *       skew otherwise.
 		 */
 		sleep_ticks = 0xFFFFFFFF;
-		if (irqs_disabled())
-			local_irq_enable();
 
 		break;
 
include/asm-x86/processor.h +1 -0
index 117343b..2e7974e 100644
@@ -722,6 +722,7 @@ static inline void __mwait(unsigned long eax, unsigned long ecx)
 
 static inline void __sti_mwait(unsigned long eax, unsigned long ecx)
 {
+	trace_hardirqs_on();
 	/* "mwait %eax, %ecx;" */
 	asm volatile("sti; .byte 0x0f, 0x01, 0xc9;"
 		     :: "a" (eax), "c" (ecx));