From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Subject: Re: [PATCH] PM: use pm_runtime_put_sync in system resume Date: Sat, 19 Dec 2009 00:20:27 +0100 Message-ID: <200912190020.27974.rjw@sisk.pl> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org To: Alan Stern Cc: Linux-pm mailing list List-Id: linux-pm@vger.kernel.org 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 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);