Commit bc1e4d14 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

[PATCH] USB: Fix bug in TT initialization introduced by earlier

This patch repairs a bug introduced by an earlier patch: The TT
initialization code was moved to _after_ the TT's first use.  The patch
simply puts the code back the way it used to be.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent bd7ae0db
...@@ -1405,6 +1405,19 @@ hub_port_init (struct usb_device *hdev, struct usb_device *udev, int port) ...@@ -1405,6 +1405,19 @@ hub_port_init (struct usb_device *hdev, struct usb_device *udev, int port)
default: speed = "?"; break; default: speed = "?"; break;
}; speed;}), }; speed;}),
udev->devnum); udev->devnum);
/* Set up TT records, if needed */
if (hdev->tt) {
udev->tt = hdev->tt;
udev->ttport = hdev->ttport;
} else if (udev->speed != USB_SPEED_HIGH
&& hdev->speed == USB_SPEED_HIGH) {
struct usb_hub *hub;
hub = usb_get_intfdata(hdev->actconfig->interface[0]);
udev->tt = &hub->tt;
udev->ttport = port + 1;
}
/* Why interleave GET_DESCRIPTOR and SET_ADDRESS this way? /* Why interleave GET_DESCRIPTOR and SET_ADDRESS this way?
* Because device hardware and firmware is sometimes buggy in * Because device hardware and firmware is sometimes buggy in
...@@ -1615,16 +1628,6 @@ static void hub_port_connect_change(struct usb_hub *hub, int port, ...@@ -1615,16 +1628,6 @@ static void hub_port_connect_change(struct usb_hub *hub, int port,
if (status < 0) if (status < 0)
goto loop; goto loop;
/* Set up TT records, if needed */
if (hdev->tt) {
udev->tt = hdev->tt;
udev->ttport = hdev->ttport;
} else if (udev->speed != USB_SPEED_HIGH
&& hdev->speed == USB_SPEED_HIGH) {
udev->tt = &hub->tt;
udev->ttport = port + 1;
}
/* consecutive bus-powered hubs aren't reliable; they can /* consecutive bus-powered hubs aren't reliable; they can
* violate the voltage drop budget. if the new child has * violate the voltage drop budget. if the new child has
* a "powered" LED, users should notice we didn't enable it * a "powered" LED, users should notice we didn't enable it
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment