[PATCH] PM / Domains: Power on the PM domain right after attach completes

Dmitry Torokhov dmitry.torokhov at gmail.com
Mon Nov 17 14:17:00 PST 2014


On Mon, Nov 17, 2014 at 05:12:35PM -0500, Alan Stern wrote:
> On Mon, 17 Nov 2014, Dmitry Torokhov wrote:
> 
> > > >  Except buses
> > > > usually call pm_generic_runtime_resume() which ends up fetching driver's
> > > > callbacks. Maybe pm_generic_runtime_*() need be a bit smarter?
> > > 
> > > No, the bus subsystem needs to be smarter.  It shouldn't call 
> > > pm_generic_runtime_resume() if the driver hasn't been probed yet, or if 
> > > the driver has already been unbound from the device.
> > 
> > But that code wold be exactly the same for all buses, right? So why
> > can't pm_generic_runtime_resume() be smarter?
> 
> It would not be the same for all buses.  Each bus will have its own way 
> of recognizing whether or not a driver has been probed (i.e., by 
> checking some field in the bus-specific part of the device structure).
> 
> > However, is it allowed to call pm_runtime_get_sync() on devices that
> > didn't issue pm_runtime_enable()?
> 
> Yes.  But the bus has to issue pm_runtime_enable() before probing the 
> driver, because the driver will expect runtime PM to work properly 
> while its probe routine runs.  For example, the probe routine might 
> want to leave the device in a runtime-suspended state.  It can't do 
> that if the device isn't enabled for runtime PM.

That means that runtime PM will be enabled for all devices on given bus
while up till now drivers were deciding if their devices should be
runtime-pm-managed or not. I do not think we are quite ready for this.

Thanks.

-- 
Dmitry



More information about the linux-arm-kernel mailing list