Skip to contentSkip to conversation

device_suspend/resume may sleep

PATCH Pavel Machek 1 participant 1 message Aug 31, 2006

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

This adds warning when someone tries them from atomic context.

drivers/base/power/resume.c +1 -0
index 826093e..849a069 100644
@@ -74,6 +74,7 @@ void dpm_resume(void)
 
 void device_resume(void)
 {
+	might_sleep();
 	down(&dpm_sem);
 	dpm_resume();
 	up(&dpm_sem);
drivers/base/power/suspend.c +1 -0
index 69509e0..c51531f 100644
@@ -100,6 +100,7 @@ int device_suspend(pm_message_t state)
 {
 	int error = 0;
 
+	might_sleep();
 	down(&dpm_sem);
 	down(&dpm_list_sem);
 	while (!list_empty(&dpm_active) && error == 0) {
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html