Re: [RFC PATCH] xhci: Prevent runtime pm from autosuspending during initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 24 Feb 2014, Dan Williams wrote:

> > Thanks Dan and Alan for the input, I did the following changes:
> >
> > - Take and release the reference in xhci_pci_probe to avoid releasing the
> > reference for a moment just before usb3 roothub registration.
> > - Make sure we release the reference in error cases
> > - Still use _put_noidle as driver_probe_device calls pm_request_idle
> 
> Sounds ok, and it is documented that the core calls pm_request_idle()
> on a driver's behalf.  But it still seems a small layering violation
> and more future-proof to call _put_sync().

Actually, _put() would be preferable to _put_sync(), because it gives 
you an async suspend -- the probe sequence isn't delayed.

I don't see this as a layering violation.  Bind and unbind are 
important aspects of a device's lifecycle, and they clearly are 
intimately related to power management.  Besides, one of the reasons 
for having a core is so that it can do things on behalf of drivers, 
even if the drivers could just as easily do these things on their own.  
This is related to the Don't-Repeat-Yourself principle.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux