Commit 87f2dfbf authored by Colin Cross's avatar Colin Cross Committed by Greg Kroah-Hartman

PM / Sleep: call early resume handlers when suspend_noirq fails

commit 064b021f upstream.

Commit cf579dfb (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: default avatarColin Cross <ccross@android.com>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4a8a3f40
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment