diff options
author | Colin Cross <ccross@android.com> | 2012-07-19 10:38:06 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-08-09 08:31:30 -0700 |
commit | 46dbb0f5903b71e3c7b37e4ad707a9aa70fe3eed (patch) | |
tree | b89b5a76cc3f18c49311552816a837c79a12a595 /drivers/base | |
parent | d3dd392851e014c90ce9e26d03a93188840a5a0b (diff) |
PM / Sleep: call early resume handlers when suspend_noirq fails
commit 064b021fbe470ecc9ca10f9f87af48c0fc0865fb upstream.
Commit cf579dfb82550e34de7ccf3ef090d8b834ccd3a9 (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>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/power/main.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 3085f9bcdd8..f7eff25ffe4 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -979,8 +979,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); |