x86: add C1E aware idle function, fix
On Tue, 17 Jun 2008, Rafael J. Wysocki wrote: > > BTW, with the C1E patches reverted I don't get the > WARNING: at /home/rafael/src/linux-next/kernel/smp.c:215 smp_call_function_single+0x3d/0xa2 > in the log. Thomas? The BROADCAST_FORCE notification uses smp_function_call and therefor must be run with interrupts enabled. While at it, add a comment for the BROADCAST_EXIT notifier as well. Reported-and-bisected-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
aa276e1caf
commit
0beefa208b
|
@ -267,14 +267,26 @@ static void c1e_idle(void)
|
||||||
|
|
||||||
if (!cpu_isset(cpu, c1e_mask)) {
|
if (!cpu_isset(cpu, c1e_mask)) {
|
||||||
cpu_set(cpu, c1e_mask);
|
cpu_set(cpu, c1e_mask);
|
||||||
/* Force broadcast so ACPI can not interfere */
|
/*
|
||||||
|
* Force broadcast so ACPI can not interfere. Needs
|
||||||
|
* to run with interrupts enabled as it uses
|
||||||
|
* smp_function_call.
|
||||||
|
*/
|
||||||
|
local_irq_enable();
|
||||||
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_FORCE,
|
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_FORCE,
|
||||||
&cpu);
|
&cpu);
|
||||||
printk(KERN_INFO "Switch to broadcast mode on CPU%d\n",
|
printk(KERN_INFO "Switch to broadcast mode on CPU%d\n",
|
||||||
cpu);
|
cpu);
|
||||||
|
local_irq_disable();
|
||||||
}
|
}
|
||||||
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu);
|
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu);
|
||||||
|
|
||||||
default_idle();
|
default_idle();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The switch back from broadcast mode needs to be
|
||||||
|
* called with interrupts disabled.
|
||||||
|
*/
|
||||||
local_irq_disable();
|
local_irq_disable();
|
||||||
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu);
|
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu);
|
||||||
local_irq_enable();
|
local_irq_enable();
|
||||||
|
|
Loading…
Reference in a new issue