diff options
author | Colin Cross <ccross@android.com> | 2012-07-19 04:38:06 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-19 04:38:06 -0400 |
commit | 064b021fbe470ecc9ca10f9f87af48c0fc0865fb (patch) | |
tree | 320c3753f42ebc97f86be30583508bfaa3e87e44 /drivers/base | |
parent | 11388c87d2abca1f01975ced28ce9eacea239104 (diff) |
PM / Sleep: call early resume handlers when suspend_noirq fails
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>
Cc: stable@vger.kernel.org
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
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 dbc3dbea5b25..c642f8dab1df 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
@@ -989,8 +989,16 @@ static int dpm_suspend_late(pm_message_t state) | |||
989 | int dpm_suspend_end(pm_message_t state) | 989 | int dpm_suspend_end(pm_message_t state) |
990 | { | 990 | { |
991 | int error = dpm_suspend_late(state); | 991 | int error = dpm_suspend_late(state); |
992 | if (error) | ||
993 | return error; | ||
992 | 994 | ||
993 | return error ? : dpm_suspend_noirq(state); | 995 | error = dpm_suspend_noirq(state); |
996 | if (error) { | ||
997 | dpm_resume_early(state); | ||
998 | return error; | ||
999 | } | ||
1000 | |||
1001 | return 0; | ||
994 | } | 1002 | } |
995 | EXPORT_SYMBOL_GPL(dpm_suspend_end); | 1003 | EXPORT_SYMBOL_GPL(dpm_suspend_end); |
996 | 1004 | ||