From: Pavel Machek Date: Fri, 1 Sep 2006 05:02:11 +0000 (-0700) Subject: PM: device_suspend/resume may sleep X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bb84c89f94851161f387285d0a449b4a3f29f4df;p=mv-sheeva.git PM: device_suspend/resume may sleep This adds warning when someone tries them from atomic context. Signed-off-by: Pavel Machek Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/power/resume.c b/drivers/base/power/resume.c index 48e3d49d7b6..7cb62d62c95 100644 --- a/drivers/base/power/resume.c +++ b/drivers/base/power/resume.c @@ -96,6 +96,7 @@ void dpm_resume(void) void device_resume(void) { + might_sleep(); down(&dpm_sem); dpm_resume(); up(&dpm_sem); diff --git a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c index 6453c25103d..ece136bf97e 100644 --- a/drivers/base/power/suspend.c +++ b/drivers/base/power/suspend.c @@ -140,6 +140,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) {