On Friday, July 27, 2012, Alan Stern wrote:
> On Fri, 27 Jul 2012, Rafael J. Wysocki wrote:
>
> > On Friday, July 27, 2012, Alan Stern wrote:
> > > On Fri, 27 Jul 2012, Huang Ying wrote:
> > >
> > > > --- a/drivers/pci/pci-driver.c
> > > > +++ b/drivers/pci/pci-driver.c
> > > > @@ -280,8 +280,12 @@ static long local_pci_probe(void *_ddi)
> > > > {
> > > > struct drv_dev_and_id *ddi = _ddi;
> > > > struct device *dev = &ddi->dev->dev;
> > > > + struct device *parent = dev->parent;
> > > > int rc;
> > > >
> > > > + /* The parent bridge must be in active state when probing */
> > > > + if (parent)
> > > > + pm_runtime_get_sync(parent);
> > >
> > > Ooh, this is a very good point. I completely missed it.
> > >
> > > > /* Unbound PCI devices are always set to disabled and suspended.
> > > > * During probe, the device is set to enabled and active and the
> > > > * usage count is incremented. If the driver supports runtime
> > > > PM,
> > > > @@ -298,6 +302,8 @@ static long local_pci_probe(void *_ddi)
> > > > pm_runtime_set_suspended(dev);
> > > > pm_runtime_put_noidle(dev);
> > > > }
> > > > + if (parent)
> > > > + pm_runtime_put(parent);
> > >
> > > You should use pm_runtime_put_sync(), not pm_runtime_put().
> >
> > Hmm, why exactly?
>
> Because it's more efficient to do something directly than to run it in
> a workqueue.
Well, depends. If that results in a power off (the parent goes into
D3 for example), we may wait as long as 10 ms for that to complete.
Thanks,
Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html