Skip to contentSkip to conversation

2.5.64 ACPI suspend/resume locking fix

PATCH New Andreas Mohr 1 participant 1 message Mar 10, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.5.64 ACPI suspend/resume locking fix

Hi,

doing an
echo 1 >/proc/acpi/sleep
caused quite some trouble on resume, such as
bad: scheduling while atomic!

Call Trace:
 [<c011d4c0>] schedule+0x220/0x230
 [<c0140608>] __pdflush+0x98/0x1e0
 [<c0140750>] pdflush+0x0/0x20
 [<c0140761>] pdflush+0x11/0x20
 [<c010826d>] kernel_thread_helper+0x5/0x18

(see BugZilla #455).

Turned out that the suspend handling in __pdflush() was abusing pdflush_lock, by not relocking before going back up the loop (which then unlocked again --> refcount -1 --> haywire!).

With the locking fix below,
doing
echo 1 >/proc/acpi/sleep
now suspends/resumes beautifully without giving further errors.

Note that my machine still gets killed completely if I do echo 3 >/proc/acpi/sleep
, however. Any ideas? How to debug this?

Thanks,

Andreas Mohr

pdflush.c renamed from pdflush.c.org +1 -0
@@ -106,6 +106,7 @@
 		schedule();
 		if (current->flags & PF_FREEZE) {
 			refrigerator(PF_IOTHREAD);
+			spin_lock_irq(&pdflush_lock);
 			continue;
 		}
 
Signature · 1 line
Andreas Mohr                        Stauferstr. 6, D-71272 Renningen, Germany