]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
PM / Runtime: don't forget to wake up waitqueue on failure
authorAlan Stern <stern@rowland.harvard.edu>
Mon, 26 Mar 2012 20:46:52 +0000 (22:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Apr 2012 16:13:53 +0000 (09:13 -0700)
commit327acb4361452fc79e4f2f38f366f9baa55e3676
tree1b5e1cacf1deb2d3da7eb84db3e3bfbfcbbd02a2
parent91cb632cd8d0a1649d088a50e752459d1e8b3d79
PM / Runtime: don't forget to wake up waitqueue on failure

commit f2791d733a2f06997b573d1a3cfde21e6f529826 upstream.

This patch (as1535) fixes a bug in the runtime PM core.  When a
runtime suspend attempt completes, whether successfully or not, the
device's power.wait_queue is supposed to be signalled.  But this
doesn't happen in the failure pathway of rpm_suspend() when another
autosuspend attempt is rescheduled.  As a result, a task can get stuck
indefinitely on the wait queue (I have seen this happen in testing).

The patch fixes the problem by moving the wake_up_all() call up near
the start of the failure code.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/power/runtime.c