diff options
author | Dan Williams <dan.j.williams@intel.com> | 2014-06-17 19:16:32 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-06-17 20:04:39 -0400 |
commit | e3d105055525d9ea9f8e9cb0db8237df3df1bb9f (patch) | |
tree | 37448f1ac032726d1e290124734a6a7a067d095d /drivers/usb/core/hub.c | |
parent | 6c79fe4afcb0450bd638f6e959e512aad270ff2f (diff) |
usb: fix hub-port pm_runtime_enable() vs runtime pm transitions
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.
Report: http://marc.info/?l=linux-usb&m=140290586301336&w=2
Fixes: 9262c19d14c4 ("usb: disable port power control if not supported in wHubCharacteristics")
Reported-by: Bjørn Mork <bjorn@mork.no>
Reported-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r-- | drivers/usb/core/hub.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 78c3cd20d7ae..21b99b4b4082 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1577,6 +1577,12 @@ static int hub_configure(struct usb_hub *hub, | |||
1577 | } | 1577 | } |
1578 | } | 1578 | } |
1579 | hdev->maxchild = i; | 1579 | hdev->maxchild = i; |
1580 | for (i = 0; i < hdev->maxchild; i++) { | ||
1581 | struct usb_port *port_dev = hub->ports[i]; | ||
1582 | |||
1583 | pm_runtime_put(&port_dev->dev); | ||
1584 | } | ||
1585 | |||
1580 | mutex_unlock(&usb_port_peer_mutex); | 1586 | mutex_unlock(&usb_port_peer_mutex); |
1581 | if (ret < 0) | 1587 | if (ret < 0) |
1582 | goto fail; | 1588 | goto fail; |