diff options
author | Dan Williams <dan.j.williams@intel.com> | 2014-06-05 17:23:04 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-06-17 19:44:57 -0400 |
commit | e3d9558082061481af96b588583e0cf220c2943c (patch) | |
tree | 07a23191fcf8a7adc7134a64553149436190c600 /drivers/usb/core | |
parent | 7171511eaec5bf23fb06078f59784a3a0626b38f (diff) |
usb: fix ->update_hub_device() vs hdev->maxchild
Commit d8521afe3586 "usb: assign default peer ports for root hubs"
delayed marking a hub valid (set hdev->maxchild) until it had been fully
configured and to enable the publishing of valid hubs to be serialized
by usb_port_peer_mutex.
However, xhci_update_hub_device() in some cases depends on
hdev->maxchild already being set. Do the minimal fix and move it after
the setting of hdev->maxchild.
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>
Reported-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Tested-by: Valdis Kletnieks <Valdis.Kletnieks@vt.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')
-rw-r--r-- | drivers/usb/core/hub.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 879b66e13370..ec6f05cbbae3 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1526,18 +1526,6 @@ static int hub_configure(struct usb_hub *hub, | |||
1526 | dev_dbg(hub_dev, "%umA bus power budget for each child\n", | 1526 | dev_dbg(hub_dev, "%umA bus power budget for each child\n", |
1527 | hub->mA_per_port); | 1527 | hub->mA_per_port); |
1528 | 1528 | ||
1529 | /* Update the HCD's internal representation of this hub before khubd | ||
1530 | * starts getting port status changes for devices under the hub. | ||
1531 | */ | ||
1532 | if (hcd->driver->update_hub_device) { | ||
1533 | ret = hcd->driver->update_hub_device(hcd, hdev, | ||
1534 | &hub->tt, GFP_KERNEL); | ||
1535 | if (ret < 0) { | ||
1536 | message = "can't update HCD hub info"; | ||
1537 | goto fail; | ||
1538 | } | ||
1539 | } | ||
1540 | |||
1541 | ret = hub_hub_status(hub, &hubstatus, &hubchange); | 1529 | ret = hub_hub_status(hub, &hubstatus, &hubchange); |
1542 | if (ret < 0) { | 1530 | if (ret < 0) { |
1543 | message = "can't get hub status"; | 1531 | message = "can't get hub status"; |
@@ -1593,6 +1581,18 @@ static int hub_configure(struct usb_hub *hub, | |||
1593 | if (ret < 0) | 1581 | if (ret < 0) |
1594 | goto fail; | 1582 | goto fail; |
1595 | 1583 | ||
1584 | /* Update the HCD's internal representation of this hub before khubd | ||
1585 | * starts getting port status changes for devices under the hub. | ||
1586 | */ | ||
1587 | if (hcd->driver->update_hub_device) { | ||
1588 | ret = hcd->driver->update_hub_device(hcd, hdev, | ||
1589 | &hub->tt, GFP_KERNEL); | ||
1590 | if (ret < 0) { | ||
1591 | message = "can't update HCD hub info"; | ||
1592 | goto fail; | ||
1593 | } | ||
1594 | } | ||
1595 | |||
1596 | usb_hub_adjust_deviceremovable(hdev, hub->descriptor); | 1596 | usb_hub_adjust_deviceremovable(hdev, hub->descriptor); |
1597 | 1597 | ||
1598 | hub_activate(hub, HUB_INIT); | 1598 | hub_activate(hub, HUB_INIT); |