[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <27240C0AC20F114CBF8149A2696CBE4A2426B4@SHSMSX101.ccr.corp.intel.com>
Date: Fri, 1 Mar 2013 02:23:25 +0000
From: "Liu, Chuansheng" <chuansheng.liu@...el.com>
To: "Rafael J. Wysocki" <rjw@...k.pl>
CC: "Li, Fei" <fei.li@...el.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"Lan, Tianyu" <tianyu.lan@...el.com>,
"stern@...land.harvard.edu" <stern@...land.harvard.edu>,
"sarah.a.sharp@...ux.intel.com" <sarah.a.sharp@...ux.intel.com>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 4/5 V2] usb: call pm_runtime_put_sync in
pm_runtime_get_sync failed case
> -----Original Message-----
> From: Rafael J. Wysocki [mailto:rjw@...k.pl]
> Sent: Friday, March 01, 2013 10:22 AM
> To: Liu, Chuansheng
> Cc: Li, Fei; gregkh@...uxfoundation.org; Lan, Tianyu;
> stern@...land.harvard.edu; sarah.a.sharp@...ux.intel.com;
> linux-usb@...r.kernel.org; linux-kernel@...r.kernel.org
> Subject: Re: [PATCH 4/5 V2] usb: call pm_runtime_put_sync in
> pm_runtime_get_sync failed case
>
> On Friday, March 01, 2013 02:07:54 AM Liu, Chuansheng wrote:
> >
> > > -----Original Message-----
> > > From: Li, Fei
> > > Sent: Thursday, February 28, 2013 5:06 PM
> > > To: gregkh@...uxfoundation.org; Lan, Tianyu; stern@...land.harvard.edu;
> > > sarah.a.sharp@...ux.intel.com
> > > Cc: rjw@...k.pl; linux-usb@...r.kernel.org; linux-kernel@...r.kernel.org;
> Liu,
> > > Chuansheng; Li, Fei
> > > Subject: [PATCH 4/5 V2] usb: call pm_runtime_put_sync in
> > > pm_runtime_get_sync failed case
> > >
> > >
> > > Even in failed case of pm_runtime_get_sync, the usage_count
> > > is incremented. In order to keep the usage_count with correct
> > > value and runtime power management to behave correctly, call
> > > pm_runtime_put(_sync) in such case.
> > >
> > > Signed-off-by Liu Chuansheng <chuansheng.liu@...el.com>
> > > Signed-off-by: Li Fei <fei.li@...el.com>
> > > ---
> > > drivers/usb/core/hub.c | 3 ++-
> > > 1 files changed, 2 insertions(+), 1 deletions(-)
> > >
> > > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> > > index 5480352..f72dede 100644
> > > --- a/drivers/usb/core/hub.c
> > > +++ b/drivers/usb/core/hub.c
> > > @@ -3148,12 +3148,13 @@ int usb_port_resume(struct usb_device
> *udev,
> > > pm_message_t msg)
> > >
> > > if (port_dev->did_runtime_put) {
> > > status = pm_runtime_get_sync(&port_dev->dev);
> > > - port_dev->did_runtime_put = false;
> > > if (status < 0) {
> > > dev_dbg(&udev->dev, "can't resume usb port,
> status %d\n",
> > > status);
> > > + pm_runtime_put_sync(&port_dev->dev);
> > Rechecked the usb similar codes, in usb_autoresume_device() and
> usb_autopm_get_interface(),
> > when pm_runtime_get_sync() failed, the paired pm_runtime_put_sync() will
> be called.
> > Alan and Rafael, is it reasonable to consider this cleanup patch also? Thanks.
>
> You can very well use pm_runtime_put_noidle() here too. Then, it will
> be kind of clear what it's for.
Thanks. Your advice really express we want to do. Will update the patch soon.
>
> >
> > > return status;
> > > }
> > > + port_dev->did_runtime_put = false;
> > > }
> > >
> > > /* Skip the initial Clear-Suspend step for a remote wakeup */
> > > --
> > > 1.7.4.1
>
> Thanks,
> Rafael
>
>
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.
Powered by blists - more mailing lists