Skip to contentSkip to conversation

Fix sleep_on functions

PATCH New Daniel Walker 1 participant 1 message Feb 24, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix sleep_on functions

There is a problem with *_sleep_on() functions when they call schedule() . Interrupts should be enabled , but they aren't. So a warning message is printed letting everyone know that your calling schedule() from an invalid context.

kernel/sched.c +1 -1
Index: linux-2.6.10/kernel/sched.c
===================================================================
@@ -3417,7 +3417,7 @@
 #define SLEEP_ON_HEAD					\
 	spin_lock_irqsave(&q->lock,flags);		\
 	__add_wait_queue(q, &wait);			\
-	spin_unlock(&q->lock);
+	spin_unlock_irq(&q->lock);
 
 #define	SLEEP_ON_TAIL					\
 	spin_lock_irq(&q->lock);			\