PM / Sleep: Prevent waiting forever on asynchronous suspend after abort
authorMandeep Singh Baines <msb@chromium.org>
Sun, 24 Jun 2012 21:31:09 +0000 (23:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Jul 2012 16:04:08 +0000 (09:04 -0700)
commit3d90eeae377192032aa58c1934582cc155a2498f
tree41f6213b81139630027659229f015c5e7715fdac
parent21017faf87a93117ca7a14aa8f0dd2f315fdeb08
PM / Sleep: Prevent waiting forever on asynchronous suspend after abort

commit 1f758b23177d588a71b96ad02990e715949bb82f upstream.

__device_suspend() must always send a completion. Otherwise, parent
devices will wait forever.

Commit 1e2ef05b, "PM: Limit race conditions between runtime PM and
system sleep (v2)", introduced a regression by short-circuiting the
complete_all() for certain error cases.

This patch fixes the bug by always signalling a completion.

Addresses http://crosbug.com/31972

Tested by injecting an abort.

Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/power/main.c