hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/usb/core/hub.c
....@@ -42,6 +42,9 @@
4242 #define USB_PRODUCT_USB5534B 0x5534
4343 #define USB_VENDOR_CYPRESS 0x04b4
4444 #define USB_PRODUCT_CY7C65632 0x6570
45
+#define USB_VENDOR_TEXAS_INSTRUMENTS 0x0451
46
+#define USB_PRODUCT_TUSB8041_USB3 0x8140
47
+#define USB_PRODUCT_TUSB8041_USB2 0x8142
4548 #define HUB_QUIRK_CHECK_PORT_AUTOSUSPEND 0x01
4649 #define HUB_QUIRK_DISABLE_AUTOSUSPEND 0x02
4750
....@@ -2378,9 +2381,8 @@
23782381 * usb_enumerate_device - Read device configs/intfs/otg (usbcore-internal)
23792382 * @udev: newly addressed device (in ADDRESS state)
23802383 *
2381
- * This is only called by usb_new_device() and usb_authorize_device()
2382
- * and FIXME -- all comments that apply to them apply here wrt to
2383
- * environment.
2384
+ * This is only called by usb_new_device() -- all comments that apply there
2385
+ * apply here wrt to environment.
23842386 *
23852387 * If the device is WUSB and not authorized, we don't attempt to read
23862388 * the string descriptors, as they will be errored out by the device
....@@ -2645,12 +2647,17 @@
26452647 }
26462648
26472649 if (usb_dev->wusb) {
2648
- result = usb_get_device_descriptor(usb_dev, sizeof(usb_dev->descriptor));
2649
- if (result < 0) {
2650
+ struct usb_device_descriptor *descr;
2651
+
2652
+ descr = usb_get_device_descriptor(usb_dev);
2653
+ if (IS_ERR(descr)) {
2654
+ result = PTR_ERR(descr);
26502655 dev_err(&usb_dev->dev, "can't re-read device descriptor for "
26512656 "authorization: %d\n", result);
26522657 goto error_device_descriptor;
26532658 }
2659
+ usb_dev->descriptor = *descr;
2660
+ kfree(descr);
26542661 }
26552662
26562663 usb_dev->authorized = 1;
....@@ -4593,6 +4600,67 @@
45934600 return hcd->driver->enable_device(hcd, udev);
45944601 }
45954602
4603
+/*
4604
+ * Get the bMaxPacketSize0 value during initialization by reading the
4605
+ * device's device descriptor. Since we don't already know this value,
4606
+ * the transfer is unsafe and it ignores I/O errors, only testing for
4607
+ * reasonable received values.
4608
+ *
4609
+ * For "old scheme" initialization, size will be 8 so we read just the
4610
+ * start of the device descriptor, which should work okay regardless of
4611
+ * the actual bMaxPacketSize0 value. For "new scheme" initialization,
4612
+ * size will be 64 (and buf will point to a sufficiently large buffer),
4613
+ * which might not be kosher according to the USB spec but it's what
4614
+ * Windows does and what many devices expect.
4615
+ *
4616
+ * Returns: bMaxPacketSize0 or a negative error code.
4617
+ */
4618
+static int get_bMaxPacketSize0(struct usb_device *udev,
4619
+ struct usb_device_descriptor *buf, int size, bool first_time)
4620
+{
4621
+ int i, rc;
4622
+
4623
+ /*
4624
+ * Retry on all errors; some devices are flakey.
4625
+ * 255 is for WUSB devices, we actually need to use
4626
+ * 512 (WUSB1.0[4.8.1]).
4627
+ */
4628
+ for (i = 0; i < GET_MAXPACKET0_TRIES; ++i) {
4629
+ /* Start with invalid values in case the transfer fails */
4630
+ buf->bDescriptorType = buf->bMaxPacketSize0 = 0;
4631
+ rc = usb_control_msg(udev, usb_rcvaddr0pipe(),
4632
+ USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
4633
+ USB_DT_DEVICE << 8, 0,
4634
+ buf, size,
4635
+ initial_descriptor_timeout);
4636
+ switch (buf->bMaxPacketSize0) {
4637
+ case 8: case 16: case 32: case 64: case 9:
4638
+ if (buf->bDescriptorType == USB_DT_DEVICE) {
4639
+ rc = buf->bMaxPacketSize0;
4640
+ break;
4641
+ }
4642
+ fallthrough;
4643
+ default:
4644
+ if (rc >= 0)
4645
+ rc = -EPROTO;
4646
+ break;
4647
+ }
4648
+
4649
+ /*
4650
+ * Some devices time out if they are powered on
4651
+ * when already connected. They need a second
4652
+ * reset, so return early. But only on the first
4653
+ * attempt, lest we get into a time-out/reset loop.
4654
+ */
4655
+ if (rc > 0 || (rc == -ETIMEDOUT && first_time &&
4656
+ udev->speed > USB_SPEED_FULL))
4657
+ break;
4658
+ }
4659
+ return rc;
4660
+}
4661
+
4662
+#define GET_DESCRIPTOR_BUFSIZE 64
4663
+
45964664 /* Reset device, (re)assign address, get device descriptor.
45974665 * Device connection must be stable, no more debouncing needed.
45984666 * Returns device in USB_STATE_ADDRESS, except on error.
....@@ -4602,10 +4670,17 @@
46024670 * the port lock. For a newly detected device that is not accessible
46034671 * through any global pointers, it's not necessary to lock the device,
46044672 * but it is still necessary to lock the port.
4673
+ *
4674
+ * For a newly detected device, @dev_descr must be NULL. The device
4675
+ * descriptor retrieved from the device will then be stored in
4676
+ * @udev->descriptor. For an already existing device, @dev_descr
4677
+ * must be non-NULL. The device descriptor will be stored there,
4678
+ * not in @udev->descriptor, because descriptors for registered
4679
+ * devices are meant to be immutable.
46054680 */
46064681 static int
46074682 hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
4608
- int retry_counter)
4683
+ int retry_counter, struct usb_device_descriptor *dev_descr)
46094684 {
46104685 struct usb_device *hdev = hub->hdev;
46114686 struct usb_hcd *hcd = bus_to_hcd(hdev->bus);
....@@ -4617,6 +4692,13 @@
46174692 int devnum = udev->devnum;
46184693 const char *driver_name;
46194694 bool do_new_scheme;
4695
+ const bool initial = !dev_descr;
4696
+ int maxp0;
4697
+ struct usb_device_descriptor *buf, *descr;
4698
+
4699
+ buf = kmalloc(GET_DESCRIPTOR_BUFSIZE, GFP_NOIO);
4700
+ if (!buf)
4701
+ return -ENOMEM;
46204702
46214703 /* root hub ports have a slightly longer reset period
46224704 * (from USB 2.0 spec, section 7.1.7.5)
....@@ -4649,32 +4731,34 @@
46494731 }
46504732 oldspeed = udev->speed;
46514733
4652
- /* USB 2.0 section 5.5.3 talks about ep0 maxpacket ...
4653
- * it's fixed size except for full speed devices.
4654
- * For Wireless USB devices, ep0 max packet is always 512 (tho
4655
- * reported as 0xff in the device descriptor). WUSB1.0[4.8.1].
4656
- */
4657
- switch (udev->speed) {
4658
- case USB_SPEED_SUPER_PLUS:
4659
- case USB_SPEED_SUPER:
4660
- case USB_SPEED_WIRELESS: /* fixed at 512 */
4661
- udev->ep0.desc.wMaxPacketSize = cpu_to_le16(512);
4662
- break;
4663
- case USB_SPEED_HIGH: /* fixed at 64 */
4664
- udev->ep0.desc.wMaxPacketSize = cpu_to_le16(64);
4665
- break;
4666
- case USB_SPEED_FULL: /* 8, 16, 32, or 64 */
4667
- /* to determine the ep0 maxpacket size, try to read
4668
- * the device descriptor to get bMaxPacketSize0 and
4669
- * then correct our initial guess.
4734
+ if (initial) {
4735
+ /* USB 2.0 section 5.5.3 talks about ep0 maxpacket ...
4736
+ * it's fixed size except for full speed devices.
4737
+ * For Wireless USB devices, ep0 max packet is always 512 (tho
4738
+ * reported as 0xff in the device descriptor). WUSB1.0[4.8.1].
46704739 */
4671
- udev->ep0.desc.wMaxPacketSize = cpu_to_le16(64);
4672
- break;
4673
- case USB_SPEED_LOW: /* fixed at 8 */
4674
- udev->ep0.desc.wMaxPacketSize = cpu_to_le16(8);
4675
- break;
4676
- default:
4677
- goto fail;
4740
+ switch (udev->speed) {
4741
+ case USB_SPEED_SUPER_PLUS:
4742
+ case USB_SPEED_SUPER:
4743
+ case USB_SPEED_WIRELESS: /* fixed at 512 */
4744
+ udev->ep0.desc.wMaxPacketSize = cpu_to_le16(512);
4745
+ break;
4746
+ case USB_SPEED_HIGH: /* fixed at 64 */
4747
+ udev->ep0.desc.wMaxPacketSize = cpu_to_le16(64);
4748
+ break;
4749
+ case USB_SPEED_FULL: /* 8, 16, 32, or 64 */
4750
+ /* to determine the ep0 maxpacket size, try to read
4751
+ * the device descriptor to get bMaxPacketSize0 and
4752
+ * then correct our initial guess.
4753
+ */
4754
+ udev->ep0.desc.wMaxPacketSize = cpu_to_le16(64);
4755
+ break;
4756
+ case USB_SPEED_LOW: /* fixed at 8 */
4757
+ udev->ep0.desc.wMaxPacketSize = cpu_to_le16(8);
4758
+ break;
4759
+ default:
4760
+ goto fail;
4761
+ }
46784762 }
46794763
46804764 if (udev->speed == USB_SPEED_WIRELESS)
....@@ -4697,22 +4781,24 @@
46974781 if (udev->speed < USB_SPEED_SUPER)
46984782 dev_info(&udev->dev,
46994783 "%s %s USB device number %d using %s\n",
4700
- (udev->config) ? "reset" : "new", speed,
4784
+ (initial ? "new" : "reset"), speed,
47014785 devnum, driver_name);
47024786
4703
- /* Set up TT records, if needed */
4704
- if (hdev->tt) {
4705
- udev->tt = hdev->tt;
4706
- udev->ttport = hdev->ttport;
4707
- } else if (udev->speed != USB_SPEED_HIGH
4708
- && hdev->speed == USB_SPEED_HIGH) {
4709
- if (!hub->tt.hub) {
4710
- dev_err(&udev->dev, "parent hub has no TT\n");
4711
- retval = -EINVAL;
4712
- goto fail;
4787
+ if (initial) {
4788
+ /* Set up TT records, if needed */
4789
+ if (hdev->tt) {
4790
+ udev->tt = hdev->tt;
4791
+ udev->ttport = hdev->ttport;
4792
+ } else if (udev->speed != USB_SPEED_HIGH
4793
+ && hdev->speed == USB_SPEED_HIGH) {
4794
+ if (!hub->tt.hub) {
4795
+ dev_err(&udev->dev, "parent hub has no TT\n");
4796
+ retval = -EINVAL;
4797
+ goto fail;
4798
+ }
4799
+ udev->tt = &hub->tt;
4800
+ udev->ttport = port1;
47134801 }
4714
- udev->tt = &hub->tt;
4715
- udev->ttport = port1;
47164802 }
47174803
47184804 /* Why interleave GET_DESCRIPTOR and SET_ADDRESS this way?
....@@ -4731,9 +4817,6 @@
47314817
47324818 for (retries = 0; retries < GET_DESCRIPTOR_TRIES; (++retries, msleep(100))) {
47334819 if (do_new_scheme) {
4734
- struct usb_device_descriptor *buf;
4735
- int r = 0;
4736
-
47374820 retval = hub_enable_device(udev);
47384821 if (retval < 0) {
47394822 dev_err(&udev->dev,
....@@ -4742,52 +4825,14 @@
47424825 goto fail;
47434826 }
47444827
4745
-#define GET_DESCRIPTOR_BUFSIZE 64
4746
- buf = kmalloc(GET_DESCRIPTOR_BUFSIZE, GFP_NOIO);
4747
- if (!buf) {
4748
- retval = -ENOMEM;
4749
- continue;
4828
+ maxp0 = get_bMaxPacketSize0(udev, buf,
4829
+ GET_DESCRIPTOR_BUFSIZE, retries == 0);
4830
+ if (maxp0 > 0 && !initial &&
4831
+ maxp0 != udev->descriptor.bMaxPacketSize0) {
4832
+ dev_err(&udev->dev, "device reset changed ep0 maxpacket size!\n");
4833
+ retval = -ENODEV;
4834
+ goto fail;
47504835 }
4751
-
4752
- /* Retry on all errors; some devices are flakey.
4753
- * 255 is for WUSB devices, we actually need to use
4754
- * 512 (WUSB1.0[4.8.1]).
4755
- */
4756
- for (operations = 0; operations < GET_MAXPACKET0_TRIES;
4757
- ++operations) {
4758
- buf->bMaxPacketSize0 = 0;
4759
- r = usb_control_msg(udev, usb_rcvaddr0pipe(),
4760
- USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
4761
- USB_DT_DEVICE << 8, 0,
4762
- buf, GET_DESCRIPTOR_BUFSIZE,
4763
- initial_descriptor_timeout);
4764
- switch (buf->bMaxPacketSize0) {
4765
- case 8: case 16: case 32: case 64: case 255:
4766
- if (buf->bDescriptorType ==
4767
- USB_DT_DEVICE) {
4768
- r = 0;
4769
- break;
4770
- }
4771
- fallthrough;
4772
- default:
4773
- if (r == 0)
4774
- r = -EPROTO;
4775
- break;
4776
- }
4777
- /*
4778
- * Some devices time out if they are powered on
4779
- * when already connected. They need a second
4780
- * reset. But only on the first attempt,
4781
- * lest we get into a time out/reset loop
4782
- */
4783
- if (r == 0 || (r == -ETIMEDOUT &&
4784
- retries == 0 &&
4785
- udev->speed > USB_SPEED_FULL))
4786
- break;
4787
- }
4788
- udev->descriptor.bMaxPacketSize0 =
4789
- buf->bMaxPacketSize0;
4790
- kfree(buf);
47914836
47924837 retval = hub_port_reset(hub, port1, udev, delay, false);
47934838 if (retval < 0) /* error or disconnect */
....@@ -4798,14 +4843,13 @@
47984843 retval = -ENODEV;
47994844 goto fail;
48004845 }
4801
- if (r) {
4802
- if (r != -ENODEV)
4846
+ if (maxp0 < 0) {
4847
+ if (maxp0 != -ENODEV)
48034848 dev_err(&udev->dev, "device descriptor read/64, error %d\n",
4804
- r);
4805
- retval = -EMSGSIZE;
4849
+ maxp0);
4850
+ retval = maxp0;
48064851 continue;
48074852 }
4808
-#undef GET_DESCRIPTOR_BUFSIZE
48094853 }
48104854
48114855 /*
....@@ -4847,18 +4891,22 @@
48474891 break;
48484892 }
48494893
4850
- retval = usb_get_device_descriptor(udev, 8);
4851
- if (retval < 8) {
4894
+ /* !do_new_scheme || wusb */
4895
+ maxp0 = get_bMaxPacketSize0(udev, buf, 8, retries == 0);
4896
+ if (maxp0 < 0) {
4897
+ retval = maxp0;
48524898 if (retval != -ENODEV)
48534899 dev_err(&udev->dev,
48544900 "device descriptor read/8, error %d\n",
48554901 retval);
4856
- if (retval >= 0)
4857
- retval = -EMSGSIZE;
48584902 } else {
48594903 u32 delay;
48604904
4861
- retval = 0;
4905
+ if (!initial && maxp0 != udev->descriptor.bMaxPacketSize0) {
4906
+ dev_err(&udev->dev, "device reset changed ep0 maxpacket size!\n");
4907
+ retval = -ENODEV;
4908
+ goto fail;
4909
+ }
48624910
48634911 delay = udev->parent->hub_delay;
48644912 udev->hub_delay = min_t(u32, delay,
....@@ -4877,6 +4925,51 @@
48774925 goto fail;
48784926
48794927 /*
4928
+ * Check the ep0 maxpacket guess and correct it if necessary.
4929
+ * maxp0 is the value stored in the device descriptor;
4930
+ * i is the value it encodes (logarithmic for SuperSpeed or greater).
4931
+ */
4932
+ i = maxp0;
4933
+ if (udev->speed >= USB_SPEED_SUPER) {
4934
+ if (maxp0 <= 16)
4935
+ i = 1 << maxp0;
4936
+ else
4937
+ i = 0; /* Invalid */
4938
+ }
4939
+ if (usb_endpoint_maxp(&udev->ep0.desc) == i) {
4940
+ ; /* Initial ep0 maxpacket guess is right */
4941
+ } else if ((udev->speed == USB_SPEED_FULL ||
4942
+ udev->speed == USB_SPEED_HIGH) &&
4943
+ (i == 8 || i == 16 || i == 32 || i == 64)) {
4944
+ /* Initial guess is wrong; use the descriptor's value */
4945
+ if (udev->speed == USB_SPEED_FULL)
4946
+ dev_dbg(&udev->dev, "ep0 maxpacket = %d\n", i);
4947
+ else
4948
+ dev_warn(&udev->dev, "Using ep0 maxpacket: %d\n", i);
4949
+ udev->ep0.desc.wMaxPacketSize = cpu_to_le16(i);
4950
+ usb_ep0_reinit(udev);
4951
+ } else {
4952
+ /* Initial guess is wrong and descriptor's value is invalid */
4953
+ dev_err(&udev->dev, "Invalid ep0 maxpacket: %d\n", maxp0);
4954
+ retval = -EMSGSIZE;
4955
+ goto fail;
4956
+ }
4957
+
4958
+ descr = usb_get_device_descriptor(udev);
4959
+ if (IS_ERR(descr)) {
4960
+ retval = PTR_ERR(descr);
4961
+ if (retval != -ENODEV)
4962
+ dev_err(&udev->dev, "device descriptor read/all, error %d\n",
4963
+ retval);
4964
+ goto fail;
4965
+ }
4966
+ if (initial)
4967
+ udev->descriptor = *descr;
4968
+ else
4969
+ *dev_descr = *descr;
4970
+ kfree(descr);
4971
+
4972
+ /*
48804973 * Some superspeed devices have finished the link training process
48814974 * and attached to a superspeed hub port, but the device descriptor
48824975 * got from those devices show they aren't superspeed devices. Warm
....@@ -4884,41 +4977,9 @@
48844977 */
48854978 if ((udev->speed >= USB_SPEED_SUPER) &&
48864979 (le16_to_cpu(udev->descriptor.bcdUSB) < 0x0300)) {
4887
- dev_err(&udev->dev, "got a wrong device descriptor, "
4888
- "warm reset device\n");
4889
- hub_port_reset(hub, port1, udev,
4890
- HUB_BH_RESET_TIME, true);
4980
+ dev_err(&udev->dev, "got a wrong device descriptor, warm reset device\n");
4981
+ hub_port_reset(hub, port1, udev, HUB_BH_RESET_TIME, true);
48914982 retval = -EINVAL;
4892
- goto fail;
4893
- }
4894
-
4895
- if (udev->descriptor.bMaxPacketSize0 == 0xff ||
4896
- udev->speed >= USB_SPEED_SUPER)
4897
- i = 512;
4898
- else
4899
- i = udev->descriptor.bMaxPacketSize0;
4900
- if (usb_endpoint_maxp(&udev->ep0.desc) != i) {
4901
- if (udev->speed == USB_SPEED_LOW ||
4902
- !(i == 8 || i == 16 || i == 32 || i == 64)) {
4903
- dev_err(&udev->dev, "Invalid ep0 maxpacket: %d\n", i);
4904
- retval = -EMSGSIZE;
4905
- goto fail;
4906
- }
4907
- if (udev->speed == USB_SPEED_FULL)
4908
- dev_dbg(&udev->dev, "ep0 maxpacket = %d\n", i);
4909
- else
4910
- dev_warn(&udev->dev, "Using ep0 maxpacket: %d\n", i);
4911
- udev->ep0.desc.wMaxPacketSize = cpu_to_le16(i);
4912
- usb_ep0_reinit(udev);
4913
- }
4914
-
4915
- retval = usb_get_device_descriptor(udev, USB_DT_DEVICE_SIZE);
4916
- if (retval < (signed)sizeof(udev->descriptor)) {
4917
- if (retval != -ENODEV)
4918
- dev_err(&udev->dev, "device descriptor read/all, error %d\n",
4919
- retval);
4920
- if (retval >= 0)
4921
- retval = -ENOMSG;
49224983 goto fail;
49234984 }
49244985
....@@ -4942,6 +5003,7 @@
49425003 hub_port_disable(hub, port1, 0);
49435004 update_devnum(udev, devnum); /* for disconnect processing */
49445005 }
5006
+ kfree(buf);
49455007 return retval;
49465008 }
49475009
....@@ -5022,7 +5084,7 @@
50225084
50235085
50245086 static int descriptors_changed(struct usb_device *udev,
5025
- struct usb_device_descriptor *old_device_descriptor,
5087
+ struct usb_device_descriptor *new_device_descriptor,
50265088 struct usb_host_bos *old_bos)
50275089 {
50285090 int changed = 0;
....@@ -5033,8 +5095,8 @@
50335095 int length;
50345096 char *buf;
50355097
5036
- if (memcmp(&udev->descriptor, old_device_descriptor,
5037
- sizeof(*old_device_descriptor)) != 0)
5098
+ if (memcmp(&udev->descriptor, new_device_descriptor,
5099
+ sizeof(*new_device_descriptor)) != 0)
50385100 return 1;
50395101
50405102 if ((old_bos && !udev->bos) || (!old_bos && udev->bos))
....@@ -5207,7 +5269,7 @@
52075269 }
52085270
52095271 /* reset (non-USB 3.0 devices) and get descriptor */
5210
- status = hub_port_init(hub, udev, port1, i);
5272
+ status = hub_port_init(hub, udev, port1, i, NULL);
52115273 if (status < 0)
52125274 goto loop;
52135275
....@@ -5355,9 +5417,8 @@
53555417 {
53565418 struct usb_port *port_dev = hub->ports[port1 - 1];
53575419 struct usb_device *udev = port_dev->child;
5358
- struct usb_device_descriptor descriptor;
5420
+ struct usb_device_descriptor *descr;
53595421 int status = -ENODEV;
5360
- int retval;
53615422
53625423 dev_dbg(&port_dev->dev, "status %04x, change %04x, %s\n", portstatus,
53635424 portchange, portspeed(hub, portstatus));
....@@ -5384,23 +5445,20 @@
53845445 * changed device descriptors before resuscitating the
53855446 * device.
53865447 */
5387
- descriptor = udev->descriptor;
5388
- retval = usb_get_device_descriptor(udev,
5389
- sizeof(udev->descriptor));
5390
- if (retval < 0) {
5448
+ descr = usb_get_device_descriptor(udev);
5449
+ if (IS_ERR(descr)) {
53915450 dev_dbg(&udev->dev,
5392
- "can't read device descriptor %d\n",
5393
- retval);
5451
+ "can't read device descriptor %ld\n",
5452
+ PTR_ERR(descr));
53945453 } else {
5395
- if (descriptors_changed(udev, &descriptor,
5454
+ if (descriptors_changed(udev, descr,
53965455 udev->bos)) {
53975456 dev_dbg(&udev->dev,
53985457 "device descriptor has changed\n");
5399
- /* for disconnect() calls */
5400
- udev->descriptor = descriptor;
54015458 } else {
54025459 status = 0; /* Nothing to do */
54035460 }
5461
+ kfree(descr);
54045462 }
54055463 #ifdef CONFIG_PM
54065464 } else if (udev->state == USB_STATE_SUSPENDED &&
....@@ -5717,6 +5775,16 @@
57175775 .idVendor = USB_VENDOR_GENESYS_LOGIC,
57185776 .bInterfaceClass = USB_CLASS_HUB,
57195777 .driver_info = HUB_QUIRK_CHECK_PORT_AUTOSUSPEND},
5778
+ { .match_flags = USB_DEVICE_ID_MATCH_VENDOR
5779
+ | USB_DEVICE_ID_MATCH_PRODUCT,
5780
+ .idVendor = USB_VENDOR_TEXAS_INSTRUMENTS,
5781
+ .idProduct = USB_PRODUCT_TUSB8041_USB2,
5782
+ .driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND},
5783
+ { .match_flags = USB_DEVICE_ID_MATCH_VENDOR
5784
+ | USB_DEVICE_ID_MATCH_PRODUCT,
5785
+ .idVendor = USB_VENDOR_TEXAS_INSTRUMENTS,
5786
+ .idProduct = USB_PRODUCT_TUSB8041_USB3,
5787
+ .driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND},
57205788 { .match_flags = USB_DEVICE_ID_MATCH_DEV_CLASS,
57215789 .bDeviceClass = USB_CLASS_HUB},
57225790 { .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS,
....@@ -5818,7 +5886,7 @@
58185886 struct usb_device *parent_hdev = udev->parent;
58195887 struct usb_hub *parent_hub;
58205888 struct usb_hcd *hcd = bus_to_hcd(udev->bus);
5821
- struct usb_device_descriptor descriptor = udev->descriptor;
5889
+ struct usb_device_descriptor descriptor;
58225890 struct usb_host_bos *bos;
58235891 int i, j, ret = 0;
58245892 int port1 = udev->portnum;
....@@ -5860,7 +5928,7 @@
58605928 /* ep0 maxpacket size may change; let the HCD know about it.
58615929 * Other endpoints will be handled by re-enumeration. */
58625930 usb_ep0_reinit(udev);
5863
- ret = hub_port_init(parent_hub, udev, port1, i);
5931
+ ret = hub_port_init(parent_hub, udev, port1, i, &descriptor);
58645932 if (ret >= 0 || ret == -ENOTCONN || ret == -ENODEV)
58655933 break;
58665934 }
....@@ -5872,7 +5940,6 @@
58725940 /* Device might have changed firmware (DFU or similar) */
58735941 if (descriptors_changed(udev, &descriptor, bos)) {
58745942 dev_info(&udev->dev, "device firmware changed\n");
5875
- udev->descriptor = descriptor; /* for disconnect() calls */
58765943 goto re_enumerate;
58775944 }
58785945