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
......@@ -1406,6 +1406,19 @@ hub_port_init (struct usb_device *hdev, struct usb_device *udev, int port)
}; speed;}),
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?
* Because device hardware and firmware is sometimes buggy in
* this area, and this is how Linux has done it for ages.
......@@ -1615,16 +1628,6 @@ static void hub_port_connect_change(struct usb_hub *hub, int port,
if (status < 0)
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
* violate the voltage drop budget. if the new child has
* 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