Skip to content

Commit

Permalink
PM / Sleep: call early resume handlers when suspend_noirq fails
Browse files Browse the repository at this point in the history
Commit cf579df (PM / Sleep: Introduce
"late suspend" and "early resume" of devices) introduced a bug where
suspend_late handlers would be called, but if dpm_suspend_noirq returned
an error the early_resume handlers would never be called.  All devices
would end up on the dpm_late_early_list, and would never be resumed
again.

Fix it by calling dpm_resume_early when dpm_suspend_noirq returns
an error.

Signed-off-by: Colin Cross <ccross@android.com>
Cc: stable@vger.kernel.org
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
  • Loading branch information
Colin Cross authored and Rafael J. Wysocki committed Jul 19, 2012
1 parent 11388c8 commit 064b021
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/base/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,8 +989,16 @@ static int dpm_suspend_late(pm_message_t state)
int dpm_suspend_end(pm_message_t state)
{
int error = dpm_suspend_late(state);
if (error)
return error;

return error ? : dpm_suspend_noirq(state);
error = dpm_suspend_noirq(state);
if (error) {
dpm_resume_early(state);
return error;
}

return 0;
}
EXPORT_SYMBOL_GPL(dpm_suspend_end);

Expand Down

0 comments on commit 064b021

Please sign in to comment.