• Alan Stern's avatar
    PM / Runtime: don't forget to wake up waitqueue on failure · f2791d73
    Alan Stern authored
    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: default avatarAlan Stern <stern@rowland.harvard.edu>
    CC: <stable@vger.kernel.org>
    Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
    f2791d73
runtime.c 38.3 KB