device_suspend/resume may sleep




This adds warning when someone tries them from atomic context.

Signed-off-by: Pavel Machek <pavel@xxxxxxx>

diff --git a/drivers/base/power/resume.c b/drivers/base/power/resume.c
index 826093e..849a069 100644
--- a/drivers/base/power/resume.c
+++ b/drivers/base/power/resume.c
@@ -74,6 +74,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 69509e0..c51531f 100644
--- a/drivers/base/power/suspend.c
+++ b/drivers/base/power/suspend.c
@@ -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) {

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • [PATCH 24/47] PM: device_suspend/resume may sleep
    ... This adds warning when someone tries them from atomic context. ... void device_resume ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: fgets() - supposed to be simple :)
    ... shouldn't) use the macro with a semicolon. ... And you need an array of 100 floats for the amount of the purchase? ... >void menu; ... This is an error, not a warning. ...
    (comp.lang.c)
  • Re: Inconsistent Program Results
    ... including one of them might trivially slow down compilation, ... I wrote the above (starting with "The standard headers"). ... return void, but there's no advantage in using that. ... You're cheating yourself by ignoring warning messages. ...
    (comp.lang.c)
  • Re: openssh-3.1p1 will not compile on VA Linux 6.2.4 system
    ... cipher.c:200: void value not ignored as it ought to be ... cipher.c:280: warning: assignment from incompatible pointer type ...
    (comp.security.ssh)
  • Re: High CPU Load when running simple socket app.
    ... > void ThrottleUpload; ... > bool IsOpen(); ... > DWORD readBytes = 0; ... > int error = WSAGetLastError; ...
    (microsoft.public.win32.programmer.networks)