2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-11-19 16:14:13 +08:00

PM: device_suspend/resume may sleep

This adds warning when someone tries them from atomic context.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Pavel Machek 2006-08-31 22:02:11 -07:00 committed by Greg Kroah-Hartman
parent 84ed64ee8f
commit bb84c89f94
2 changed files with 2 additions and 0 deletions

View File

@ -96,6 +96,7 @@ void dpm_resume(void)
void device_resume(void)
{
might_sleep();
down(&dpm_sem);
dpm_resume();
up(&dpm_sem);

View File

@ -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) {