* [PATCH] PM: use pm_runtime_put_sync in system resume
@ 2009-12-15 22:10 Alan Stern
2009-12-18 23:20 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Alan Stern @ 2009-12-15 22:10 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Linux-pm mailing list
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>
---
Index: usb-2.6/drivers/base/power/main.c
===================================================================
--- usb-2.6.orig/drivers/base/power/main.c
+++ usb-2.6/drivers/base/power/main.c
@@ -521,7 +521,7 @@ static void dpm_complete(pm_message_t st
mutex_unlock(&dpm_list_mtx);
device_complete(dev, state);
- pm_runtime_put_noidle(dev);
+ pm_runtime_put_sync(dev);
mutex_lock(&dpm_list_mtx);
}
@@ -772,7 +772,7 @@ static int dpm_prepare(pm_message_t stat
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);
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] PM: use pm_runtime_put_sync in system resume
2009-12-15 22:10 [PATCH] PM: use pm_runtime_put_sync in system resume Alan Stern
@ 2009-12-18 23:20 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2009-12-18 23:20 UTC (permalink / raw)
To: Alan Stern; +Cc: Linux-pm mailing list
On Tuesday 15 December 2009, Alan Stern wrote:
> 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>
Applied to suspend-2.6/linux-next, will be pushed to Linus before -rc2.
Rafael
> ---
>
> Index: usb-2.6/drivers/base/power/main.c
> ===================================================================
> --- usb-2.6.orig/drivers/base/power/main.c
> +++ usb-2.6/drivers/base/power/main.c
> @@ -521,7 +521,7 @@ static void dpm_complete(pm_message_t st
> mutex_unlock(&dpm_list_mtx);
>
> device_complete(dev, state);
> - pm_runtime_put_noidle(dev);
> + pm_runtime_put_sync(dev);
>
> mutex_lock(&dpm_list_mtx);
> }
> @@ -772,7 +772,7 @@ static int dpm_prepare(pm_message_t stat
> 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);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-12-18 23:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-15 22:10 [PATCH] PM: use pm_runtime_put_sync in system resume Alan Stern
2009-12-18 23:20 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox