Skip to content

Commit

Permalink
PM: Use pm_runtime_put_sync in system resume
Browse files Browse the repository at this point in the history
This patch (as1317) fixes a bug in the PM core.  When a device is
resumed following a system sleep, the core decrements the device's
runtime PM usage counter but doesn't issue an idle notification if the
counter reaches 0.  This could prevent an otherwise unused device from
being runtime-suspended again after the system sleep.

The fix is to call pm_runtime_put_sync() instead of
pm_runtime_put_noidle().

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
  • Loading branch information
Alan Stern authored and Rafael J. Wysocki committed Dec 21, 2009
1 parent ecf762b commit aa0baae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/base/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ static void dpm_complete(pm_message_t state)
mutex_unlock(&dpm_list_mtx);

device_complete(dev, state);
pm_runtime_put_noidle(dev);
pm_runtime_put_sync(dev);

mutex_lock(&dpm_list_mtx);
}
Expand Down Expand Up @@ -880,7 +880,7 @@ static int dpm_prepare(pm_message_t state)
pm_runtime_get_noresume(dev);
if (pm_runtime_barrier(dev) && device_may_wakeup(dev)) {
/* Wake-up requested during system sleep transition. */
pm_runtime_put_noidle(dev);
pm_runtime_put_sync(dev);
error = -EBUSY;
} else {
error = device_prepare(dev, state);
Expand Down

0 comments on commit aa0baae

Please sign in to comment.