On Fri, 30 Nov 2012, Lan Tianyu wrote:
> On 2012年11月29日 03:42, Alan Stern wrote:
> > On Sat, 17 Nov 2012, Lan Tianyu wrote:
> >
> >> Some usb devices can't be resumed correctly after power off. This
> >> patch is to add pm qos flags request to change NO_POWER_OFF and
> >> provide usb_device_allow_power_off() for device drivers to allow or
> >> prohibit usb core to power off the device.
> >
> > What happens if there are two drivers bound to two different
> > interfaces, and they both call usb_device_allow_power_off(false), and
> > then one of the drivers is unbound and calls
> > usb_device_allow_power_off(on)?
> >
> > Also, instead of using PM QOS flags for this, why not simply have
> > usb_device_allow_power_off call pm_runtime_{get,put}_sync on the port
> > device?
>
> If we do this, I think we should add a flag to record whether the port
> has been prevent from power off to avoid pm_runtime_get() more than one
> time. Since this function may be invoked many time.
There's no need to avoid calling pm_runtime_get_sync more than once.
Just make sure that each call is balanced by a call of
pm_runtime_put_sync.
Alan Stern
--
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