Commit b86904dd authored by Andrew Morton's avatar Andrew Morton Committed by Christoph Hellwig

[PATCH] APM locking fix

From: Manfred Spraul <manfred@colorfullife.com>

apm.c:suspend() calls set_system_power_state() under (effectively)
spin_lock_irq(i8253_lock).

But set_system_power_state() unconditionally enables interrupts, in
apm_bios_call_simple().  This generates nasty warnings from the uniprocessor
spinlock debugging code, and would be deadlocky if APM worked on SMP.

So drop the locks around the set_system_power_state() call.
parent f01c92ba
......@@ -1205,7 +1205,17 @@ static int suspend(int vetoable)
spin_lock(&i8253_lock);
get_time_diff();
/*
* Irq spinlock must be dropped around set_system_power_state.
* We'll undo any timer changes due to interrupts below.
*/
spin_unlock(&i8253_lock);
write_sequnlock_irq(&xtime_lock);
err = set_system_power_state(APM_STATE_SUSPEND);
write_seqlock_irq(&xtime_lock);
spin_lock(&i8253_lock);
reinit_timer();
set_time();
ignore_normal_resume = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment