Re: [PATCH 3/3] usb: fix hub-port pm_runtime_enable() vs runtime pm transitions

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

 



On Wed, 18 Jun 2014, Dan Williams wrote:

> On Wed, Jun 18, 2014 at 7:54 AM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> > On Tue, 17 Jun 2014, Dan Williams wrote:
> >
> >> Commit 9262c19d14c4 "usb: disable port power control if not supported in
> >> wHubCharacteristics" gated enabling runtime pm for usb_port devices on
> >> whether the parent hub supports power control, which causes a
> >> regression.  The port must still be allowed to carry out runtime pm
> >> callbacks and receive a -EAGAIN or -EBUSY result.  Otherwise the
> >> usb_port device will transition to the pm error state and trigger the
> >> same for the child usb_device.
> >>
> >> Prior to the offending commit usb_hub_create_port_device() arranged for
> >> runtime pm to be disabled is dev_pm_qos_expose_flags() failed.  Instead,
> >> force the default state of PM_QOS_FLAG_NO_POWER_OFF flag to be set prior
> >> to enabling runtime pm.  If that policy can not be set then fail
> >> registration.
> >
> > This whole thing seems much more complicated than necessary.
> >
> > Instead of messing around with PM-QOS settings, why not just do an
> > extra pm_runtime_get_noresume() if the hub doesn't support power
> > control?
> 
> In that scenario userspace has to fishing for why the port is not
> powering off vs no "pm_qos_no_power_off" == no capability.

Can't the user change that flag back again?

> > Or, what about leaving this code the way it was and changing the PM
> > core (see http://marc.info/?l=linux-pm&m=140303690820354&w=2)?
> 
> I like this approach too, but was not sure a core change like that
> would be accepted now that -rc1 is out.

That's up to Rafael.  He'd probably agree if we explained that it would
fix a bug.  Alternatively, the code following the relevant
pm_runtime_get_sync() could explicitly check for -EACCES -- but I don't
think that's such a good solution.

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