Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb84c89f authored by Pavel Machek's avatar Pavel Machek Committed by Greg Kroah-Hartman
Browse files

PM: device_suspend/resume may sleep



This adds warning when someone tries them from atomic context.

Signed-off-by: default avatarPavel Machek <pavel@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 84ed64ee
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ void dpm_resume(void)

void device_resume(void)
{
	might_sleep();
	down(&dpm_sem);
	dpm_resume();
	up(&dpm_sem);
+1 −0
Original line number Diff line number Diff line
@@ -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) {