Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'usb-4.20-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
"Here are a number of small USB fixes for 4.20-rc4.

There's the usual xhci and dwc2/3 fixes as well as a few minor other
issues resolved for problems that have been reported. Full details are
in the shortlog.

All have been in linux-next for a while with no reported issues"

* tag 'usb-4.20-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
usb: cdc-acm: add entry for Hiro (Conexant) modem
usb: xhci: Prevent bus suspend if a port connect change or polling state is detected
usb: core: Fix hub port connection events lost
usb: dwc3: gadget: fix ISOC TRB type on unaligned transfers
Revert "usb: gadget: ffs: Fix BUG when userland exits with submitted AIO transfers"
usb: dwc2: pci: Fix an error code in probe
usb: dwc3: Fix NULL pointer exception in dwc3_pci_remove()
xhci: Add quirk to workaround the errata seen on Cavium Thunder-X2 Soc
usb: xhci: fix timeout for transition from RExit to U0
usb: xhci: fix uninitialized completion when USB3 port got wrong status
xhci: Add check for invalid byte size error when UAS devices are connected.
xhci: handle port status events for removed USB3 hcd
xhci: Fix leaking USB3 shared_hcd at xhci removal
USB: misc: appledisplay: add 20" Apple Cinema Display
USB: quirks: Add no-lpm quirk for Raydium touchscreens
usb: quirks: Add delay-init quirk for Corsair K70 LUX RGB
USB: Wait for extra delay time after USB_PORT_FEAT_RESET for quirky hub
usb: dwc3: gadget: Properly check last unaligned/zero chain TRB
usb: dwc3: core: Clean up ULPI device

+167 -55
+2
Documentation/admin-guide/kernel-parameters.txt
··· 4713 4713 prevent spurious wakeup); 4714 4714 n = USB_QUIRK_DELAY_CTRL_MSG (Device needs a 4715 4715 pause after every control message); 4716 + o = USB_QUIRK_HUB_SLOW_RESET (Hub needs extra 4717 + delay after resetting its port); 4716 4718 Example: quirks=0781:5580:bk,0a5c:5834:gij 4717 4719 4718 4720 usbhid.mousepoll=
+3
drivers/usb/class/cdc-acm.c
··· 1696 1696 { USB_DEVICE(0x0572, 0x1328), /* Shiro / Aztech USB MODEM UM-3100 */ 1697 1697 .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ 1698 1698 }, 1699 + { USB_DEVICE(0x0572, 0x1349), /* Hiro (Conexant) USB MODEM H50228 */ 1700 + .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ 1701 + }, 1699 1702 { USB_DEVICE(0x20df, 0x0001), /* Simtec Electronics Entropy Key */ 1700 1703 .driver_info = QUIRK_CONTROL_LINE_STATE, }, 1701 1704 { USB_DEVICE(0x2184, 0x001c) }, /* GW Instek AFG-2225 */
+14 -4
drivers/usb/core/hub.c
··· 2794 2794 int i, status; 2795 2795 u16 portchange, portstatus; 2796 2796 struct usb_port *port_dev = hub->ports[port1 - 1]; 2797 + int reset_recovery_time; 2797 2798 2798 2799 if (!hub_is_superspeed(hub->hdev)) { 2799 2800 if (warm) { ··· 2850 2849 USB_PORT_FEAT_C_BH_PORT_RESET); 2851 2850 usb_clear_port_feature(hub->hdev, port1, 2852 2851 USB_PORT_FEAT_C_PORT_LINK_STATE); 2853 - usb_clear_port_feature(hub->hdev, port1, 2852 + 2853 + if (udev) 2854 + usb_clear_port_feature(hub->hdev, port1, 2854 2855 USB_PORT_FEAT_C_CONNECTION); 2855 2856 2856 2857 /* ··· 2888 2885 2889 2886 done: 2890 2887 if (status == 0) { 2891 - /* TRSTRCY = 10 ms; plus some extra */ 2892 2888 if (port_dev->quirks & USB_PORT_QUIRK_FAST_ENUM) 2893 2889 usleep_range(10000, 12000); 2894 - else 2895 - msleep(10 + 40); 2890 + else { 2891 + /* TRSTRCY = 10 ms; plus some extra */ 2892 + reset_recovery_time = 10 + 40; 2893 + 2894 + /* Hub needs extra delay after resetting its port. */ 2895 + if (hub->hdev->quirks & USB_QUIRK_HUB_SLOW_RESET) 2896 + reset_recovery_time += 100; 2897 + 2898 + msleep(reset_recovery_time); 2899 + } 2896 2900 2897 2901 if (udev) { 2898 2902 struct usb_hcd *hcd = bus_to_hcd(udev->bus);
+14
drivers/usb/core/quirks.c
··· 128 128 case 'n': 129 129 flags |= USB_QUIRK_DELAY_CTRL_MSG; 130 130 break; 131 + case 'o': 132 + flags |= USB_QUIRK_HUB_SLOW_RESET; 133 + break; 131 134 /* Ignore unrecognized flag characters */ 132 135 } 133 136 } ··· 383 380 { USB_DEVICE(0x1a0a, 0x0200), .driver_info = 384 381 USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL }, 385 382 383 + /* Terminus Technology Inc. Hub */ 384 + { USB_DEVICE(0x1a40, 0x0101), .driver_info = USB_QUIRK_HUB_SLOW_RESET }, 385 + 386 386 /* Corsair K70 RGB */ 387 387 { USB_DEVICE(0x1b1c, 0x1b13), .driver_info = USB_QUIRK_DELAY_INIT }, 388 388 ··· 396 390 /* Corsair Strafe RGB */ 397 391 { USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT | 398 392 USB_QUIRK_DELAY_CTRL_MSG }, 393 + 394 + /* Corsair K70 LUX RGB */ 395 + { USB_DEVICE(0x1b1c, 0x1b33), .driver_info = USB_QUIRK_DELAY_INIT }, 399 396 400 397 /* Corsair K70 LUX */ 401 398 { USB_DEVICE(0x1b1c, 0x1b36), .driver_info = USB_QUIRK_DELAY_INIT }, ··· 419 410 /* Hauppauge HVR-950q */ 420 411 { USB_DEVICE(0x2040, 0x7200), .driver_info = 421 412 USB_QUIRK_CONFIG_INTF_STRINGS }, 413 + 414 + /* Raydium Touchscreen */ 415 + { USB_DEVICE(0x2386, 0x3114), .driver_info = USB_QUIRK_NO_LPM }, 416 + 417 + { USB_DEVICE(0x2386, 0x3119), .driver_info = USB_QUIRK_NO_LPM }, 422 418 423 419 /* DJI CineSSD */ 424 420 { USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM },
+1
drivers/usb/dwc2/pci.c
··· 120 120 dwc2 = platform_device_alloc("dwc2", PLATFORM_DEVID_AUTO); 121 121 if (!dwc2) { 122 122 dev_err(dev, "couldn't allocate dwc2 device\n"); 123 + ret = -ENOMEM; 123 124 goto err; 124 125 } 125 126
+1
drivers/usb/dwc3/core.c
··· 1499 1499 1500 1500 err5: 1501 1501 dwc3_event_buffers_cleanup(dwc); 1502 + dwc3_ulpi_exit(dwc); 1502 1503 1503 1504 err4: 1504 1505 dwc3_free_scratch_buffers(dwc);
+3 -1
drivers/usb/dwc3/dwc3-pci.c
··· 283 283 static void dwc3_pci_remove(struct pci_dev *pci) 284 284 { 285 285 struct dwc3_pci *dwc = pci_get_drvdata(pci); 286 + struct pci_dev *pdev = dwc->pci; 286 287 287 - gpiod_remove_lookup_table(&platform_bytcr_gpios); 288 + if (pdev->device == PCI_DEVICE_ID_INTEL_BYT) 289 + gpiod_remove_lookup_table(&platform_bytcr_gpios); 288 290 #ifdef CONFIG_PM 289 291 cancel_work_sync(&dwc->wakeup_work); 290 292 #endif
+4 -4
drivers/usb/dwc3/gadget.c
··· 1081 1081 /* Now prepare one extra TRB to align transfer size */ 1082 1082 trb = &dep->trb_pool[dep->trb_enqueue]; 1083 1083 __dwc3_prepare_one_trb(dep, trb, dwc->bounce_addr, 1084 - maxp - rem, false, 0, 1084 + maxp - rem, false, 1, 1085 1085 req->request.stream_id, 1086 1086 req->request.short_not_ok, 1087 1087 req->request.no_interrupt); ··· 1125 1125 /* Now prepare one extra TRB to align transfer size */ 1126 1126 trb = &dep->trb_pool[dep->trb_enqueue]; 1127 1127 __dwc3_prepare_one_trb(dep, trb, dwc->bounce_addr, maxp - rem, 1128 - false, 0, req->request.stream_id, 1128 + false, 1, req->request.stream_id, 1129 1129 req->request.short_not_ok, 1130 1130 req->request.no_interrupt); 1131 1131 } else if (req->request.zero && req->request.length && ··· 1141 1141 /* Now prepare one extra TRB to handle ZLP */ 1142 1142 trb = &dep->trb_pool[dep->trb_enqueue]; 1143 1143 __dwc3_prepare_one_trb(dep, trb, dwc->bounce_addr, 0, 1144 - false, 0, req->request.stream_id, 1144 + false, 1, req->request.stream_id, 1145 1145 req->request.short_not_ok, 1146 1146 req->request.no_interrupt); 1147 1147 } else { ··· 2259 2259 * with one TRB pending in the ring. We need to manually clear HWO bit 2260 2260 * from that TRB. 2261 2261 */ 2262 - if ((req->zero || req->unaligned) && (trb->ctrl & DWC3_TRB_CTRL_HWO)) { 2262 + if ((req->zero || req->unaligned) && !(trb->ctrl & DWC3_TRB_CTRL_CHN)) { 2263 2263 trb->ctrl &= ~DWC3_TRB_CTRL_HWO; 2264 2264 return 1; 2265 2265 }
+8 -18
drivers/usb/gadget/function/f_fs.c
··· 215 215 216 216 struct mm_struct *mm; 217 217 struct work_struct work; 218 - struct work_struct cancellation_work; 219 218 220 219 struct usb_ep *ep; 221 220 struct usb_request *req; ··· 1072 1073 return 0; 1073 1074 } 1074 1075 1075 - static void ffs_aio_cancel_worker(struct work_struct *work) 1076 - { 1077 - struct ffs_io_data *io_data = container_of(work, struct ffs_io_data, 1078 - cancellation_work); 1079 - 1080 - ENTER(); 1081 - 1082 - usb_ep_dequeue(io_data->ep, io_data->req); 1083 - } 1084 - 1085 1076 static int ffs_aio_cancel(struct kiocb *kiocb) 1086 1077 { 1087 1078 struct ffs_io_data *io_data = kiocb->private; 1088 - struct ffs_data *ffs = io_data->ffs; 1079 + struct ffs_epfile *epfile = kiocb->ki_filp->private_data; 1089 1080 int value; 1090 1081 1091 1082 ENTER(); 1092 1083 1093 - if (likely(io_data && io_data->ep && io_data->req)) { 1094 - INIT_WORK(&io_data->cancellation_work, ffs_aio_cancel_worker); 1095 - queue_work(ffs->io_completion_wq, &io_data->cancellation_work); 1096 - value = -EINPROGRESS; 1097 - } else { 1084 + spin_lock_irq(&epfile->ffs->eps_lock); 1085 + 1086 + if (likely(io_data && io_data->ep && io_data->req)) 1087 + value = usb_ep_dequeue(io_data->ep, io_data->req); 1088 + else 1098 1089 value = -EINVAL; 1099 - } 1090 + 1091 + spin_unlock_irq(&epfile->ffs->eps_lock); 1100 1092 1101 1093 return value; 1102 1094 }
+4 -2
drivers/usb/host/xhci-histb.c
··· 325 325 struct xhci_hcd_histb *histb = platform_get_drvdata(dev); 326 326 struct usb_hcd *hcd = histb->hcd; 327 327 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 328 + struct usb_hcd *shared_hcd = xhci->shared_hcd; 328 329 329 330 xhci->xhc_state |= XHCI_STATE_REMOVING; 330 331 331 - usb_remove_hcd(xhci->shared_hcd); 332 + usb_remove_hcd(shared_hcd); 333 + xhci->shared_hcd = NULL; 332 334 device_wakeup_disable(&dev->dev); 333 335 334 336 usb_remove_hcd(hcd); 335 - usb_put_hcd(xhci->shared_hcd); 337 + usb_put_hcd(shared_hcd); 336 338 337 339 xhci_histb_host_disable(histb); 338 340 usb_put_hcd(hcd);
+49 -17
drivers/usb/host/xhci-hub.c
··· 876 876 status |= USB_PORT_STAT_SUSPEND; 877 877 } 878 878 if ((raw_port_status & PORT_PLS_MASK) == XDEV_RESUME && 879 - !DEV_SUPERSPEED_ANY(raw_port_status)) { 879 + !DEV_SUPERSPEED_ANY(raw_port_status) && hcd->speed < HCD_USB3) { 880 880 if ((raw_port_status & PORT_RESET) || 881 881 !(raw_port_status & PORT_PE)) 882 882 return 0xffffffff; ··· 921 921 time_left = wait_for_completion_timeout( 922 922 &bus_state->rexit_done[wIndex], 923 923 msecs_to_jiffies( 924 - XHCI_MAX_REXIT_TIMEOUT)); 924 + XHCI_MAX_REXIT_TIMEOUT_MS)); 925 925 spin_lock_irqsave(&xhci->lock, flags); 926 926 927 927 if (time_left) { ··· 935 935 } else { 936 936 int port_status = readl(port->addr); 937 937 xhci_warn(xhci, "Port resume took longer than %i msec, port status = 0x%x\n", 938 - XHCI_MAX_REXIT_TIMEOUT, 938 + XHCI_MAX_REXIT_TIMEOUT_MS, 939 939 port_status); 940 940 status |= USB_PORT_STAT_SUSPEND; 941 941 clear_bit(wIndex, &bus_state->rexit_ports); ··· 1474 1474 unsigned long flags; 1475 1475 struct xhci_hub *rhub; 1476 1476 struct xhci_port **ports; 1477 + u32 portsc_buf[USB_MAXCHILDREN]; 1478 + bool wake_enabled; 1477 1479 1478 1480 rhub = xhci_get_rhub(hcd); 1479 1481 ports = rhub->ports; 1480 1482 max_ports = rhub->num_ports; 1481 1483 bus_state = &xhci->bus_state[hcd_index(hcd)]; 1484 + wake_enabled = hcd->self.root_hub->do_remote_wakeup; 1482 1485 1483 1486 spin_lock_irqsave(&xhci->lock, flags); 1484 1487 1485 - if (hcd->self.root_hub->do_remote_wakeup) { 1488 + if (wake_enabled) { 1486 1489 if (bus_state->resuming_ports || /* USB2 */ 1487 1490 bus_state->port_remote_wakeup) { /* USB3 */ 1488 1491 spin_unlock_irqrestore(&xhci->lock, flags); ··· 1493 1490 return -EBUSY; 1494 1491 } 1495 1492 } 1496 - 1497 - port_index = max_ports; 1493 + /* 1494 + * Prepare ports for suspend, but don't write anything before all ports 1495 + * are checked and we know bus suspend can proceed 1496 + */ 1498 1497 bus_state->bus_suspended = 0; 1498 + port_index = max_ports; 1499 1499 while (port_index--) { 1500 - /* suspend the port if the port is not suspended */ 1501 1500 u32 t1, t2; 1502 - int slot_id; 1503 1501 1504 1502 t1 = readl(ports[port_index]->addr); 1505 1503 t2 = xhci_port_state_to_neutral(t1); 1504 + portsc_buf[port_index] = 0; 1506 1505 1507 - if ((t1 & PORT_PE) && !(t1 & PORT_PLS_MASK)) { 1508 - xhci_dbg(xhci, "port %d not suspended\n", port_index); 1509 - slot_id = xhci_find_slot_id_by_port(hcd, xhci, 1510 - port_index + 1); 1511 - if (slot_id) { 1506 + /* Bail out if a USB3 port has a new device in link training */ 1507 + if ((t1 & PORT_PLS_MASK) == XDEV_POLLING) { 1508 + bus_state->bus_suspended = 0; 1509 + spin_unlock_irqrestore(&xhci->lock, flags); 1510 + xhci_dbg(xhci, "Bus suspend bailout, port in polling\n"); 1511 + return -EBUSY; 1512 + } 1513 + 1514 + /* suspend ports in U0, or bail out for new connect changes */ 1515 + if ((t1 & PORT_PE) && (t1 & PORT_PLS_MASK) == XDEV_U0) { 1516 + if ((t1 & PORT_CSC) && wake_enabled) { 1517 + bus_state->bus_suspended = 0; 1512 1518 spin_unlock_irqrestore(&xhci->lock, flags); 1513 - xhci_stop_device(xhci, slot_id, 1); 1514 - spin_lock_irqsave(&xhci->lock, flags); 1519 + xhci_dbg(xhci, "Bus suspend bailout, port connect change\n"); 1520 + return -EBUSY; 1515 1521 } 1522 + xhci_dbg(xhci, "port %d not suspended\n", port_index); 1516 1523 t2 &= ~PORT_PLS_MASK; 1517 1524 t2 |= PORT_LINK_STROBE | XDEV_U3; 1518 1525 set_bit(port_index, &bus_state->bus_suspended); ··· 1531 1518 * including the USB 3.0 roothub, but only if CONFIG_PM 1532 1519 * is enabled, so also enable remote wake here. 1533 1520 */ 1534 - if (hcd->self.root_hub->do_remote_wakeup) { 1521 + if (wake_enabled) { 1535 1522 if (t1 & PORT_CONNECT) { 1536 1523 t2 |= PORT_WKOC_E | PORT_WKDISC_E; 1537 1524 t2 &= ~PORT_WKCONN_E; ··· 1551 1538 1552 1539 t1 = xhci_port_state_to_neutral(t1); 1553 1540 if (t1 != t2) 1554 - writel(t2, ports[port_index]->addr); 1541 + portsc_buf[port_index] = t2; 1542 + } 1543 + 1544 + /* write port settings, stopping and suspending ports if needed */ 1545 + port_index = max_ports; 1546 + while (port_index--) { 1547 + if (!portsc_buf[port_index]) 1548 + continue; 1549 + if (test_bit(port_index, &bus_state->bus_suspended)) { 1550 + int slot_id; 1551 + 1552 + slot_id = xhci_find_slot_id_by_port(hcd, xhci, 1553 + port_index + 1); 1554 + if (slot_id) { 1555 + spin_unlock_irqrestore(&xhci->lock, flags); 1556 + xhci_stop_device(xhci, slot_id, 1); 1557 + spin_lock_irqsave(&xhci->lock, flags); 1558 + } 1559 + } 1560 + writel(portsc_buf[port_index], ports[port_index]->addr); 1555 1561 } 1556 1562 hcd->state = HC_STATE_SUSPENDED; 1557 1563 bus_state->next_statechange = jiffies + msecs_to_jiffies(10);
+4 -2
drivers/usb/host/xhci-mtk.c
··· 590 590 struct xhci_hcd_mtk *mtk = platform_get_drvdata(dev); 591 591 struct usb_hcd *hcd = mtk->hcd; 592 592 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 593 + struct usb_hcd *shared_hcd = xhci->shared_hcd; 593 594 594 - usb_remove_hcd(xhci->shared_hcd); 595 + usb_remove_hcd(shared_hcd); 596 + xhci->shared_hcd = NULL; 595 597 device_init_wakeup(&dev->dev, false); 596 598 597 599 usb_remove_hcd(hcd); 598 - usb_put_hcd(xhci->shared_hcd); 600 + usb_put_hcd(shared_hcd); 599 601 usb_put_hcd(hcd); 600 602 xhci_mtk_sch_exit(mtk); 601 603 xhci_mtk_clks_disable(mtk);
+6
drivers/usb/host/xhci-pci.c
··· 248 248 if (pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241) 249 249 xhci->quirks |= XHCI_LIMIT_ENDPOINT_INTERVAL_7; 250 250 251 + if ((pdev->vendor == PCI_VENDOR_ID_BROADCOM || 252 + pdev->vendor == PCI_VENDOR_ID_CAVIUM) && 253 + pdev->device == 0x9026) 254 + xhci->quirks |= XHCI_RESET_PLL_ON_DISCONNECT; 255 + 251 256 if (xhci->quirks & XHCI_RESET_ON_RESUME) 252 257 xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, 253 258 "QUIRK: Resetting on resume"); ··· 385 380 if (xhci->shared_hcd) { 386 381 usb_remove_hcd(xhci->shared_hcd); 387 382 usb_put_hcd(xhci->shared_hcd); 383 + xhci->shared_hcd = NULL; 388 384 } 389 385 390 386 /* Workaround for spurious wakeups at shutdown with HSW */
+4 -2
drivers/usb/host/xhci-plat.c
··· 362 362 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 363 363 struct clk *clk = xhci->clk; 364 364 struct clk *reg_clk = xhci->reg_clk; 365 + struct usb_hcd *shared_hcd = xhci->shared_hcd; 365 366 366 367 xhci->xhc_state |= XHCI_STATE_REMOVING; 367 368 368 - usb_remove_hcd(xhci->shared_hcd); 369 + usb_remove_hcd(shared_hcd); 370 + xhci->shared_hcd = NULL; 369 371 usb_phy_shutdown(hcd->usb_phy); 370 372 371 373 usb_remove_hcd(hcd); 372 - usb_put_hcd(xhci->shared_hcd); 374 + usb_put_hcd(shared_hcd); 373 375 374 376 clk_disable_unprepare(clk); 375 377 clk_disable_unprepare(reg_clk);
+43 -2
drivers/usb/host/xhci-ring.c
··· 1521 1521 usb_wakeup_notification(udev->parent, udev->portnum); 1522 1522 } 1523 1523 1524 + /* 1525 + * Quirk hanlder for errata seen on Cavium ThunderX2 processor XHCI 1526 + * Controller. 1527 + * As per ThunderX2errata-129 USB 2 device may come up as USB 1 1528 + * If a connection to a USB 1 device is followed by another connection 1529 + * to a USB 2 device. 1530 + * 1531 + * Reset the PHY after the USB device is disconnected if device speed 1532 + * is less than HCD_USB3. 1533 + * Retry the reset sequence max of 4 times checking the PLL lock status. 1534 + * 1535 + */ 1536 + static void xhci_cavium_reset_phy_quirk(struct xhci_hcd *xhci) 1537 + { 1538 + struct usb_hcd *hcd = xhci_to_hcd(xhci); 1539 + u32 pll_lock_check; 1540 + u32 retry_count = 4; 1541 + 1542 + do { 1543 + /* Assert PHY reset */ 1544 + writel(0x6F, hcd->regs + 0x1048); 1545 + udelay(10); 1546 + /* De-assert the PHY reset */ 1547 + writel(0x7F, hcd->regs + 0x1048); 1548 + udelay(200); 1549 + pll_lock_check = readl(hcd->regs + 0x1070); 1550 + } while (!(pll_lock_check & 0x1) && --retry_count); 1551 + } 1552 + 1524 1553 static void handle_port_status(struct xhci_hcd *xhci, 1525 1554 union xhci_trb *event) 1526 1555 { ··· 1581 1552 port = &xhci->hw_ports[port_id - 1]; 1582 1553 if (!port || !port->rhub || port->hcd_portnum == DUPLICATE_ENTRY) { 1583 1554 xhci_warn(xhci, "Event for invalid port %u\n", port_id); 1555 + bogus_port_status = true; 1556 + goto cleanup; 1557 + } 1558 + 1559 + /* We might get interrupts after shared_hcd is removed */ 1560 + if (port->rhub == &xhci->usb3_rhub && xhci->shared_hcd == NULL) { 1561 + xhci_dbg(xhci, "ignore port event for removed USB3 hcd\n"); 1584 1562 bogus_port_status = true; 1585 1563 goto cleanup; 1586 1564 } ··· 1675 1639 * RExit to a disconnect state). If so, let the the driver know it's 1676 1640 * out of the RExit state. 1677 1641 */ 1678 - if (!DEV_SUPERSPEED_ANY(portsc) && 1642 + if (!DEV_SUPERSPEED_ANY(portsc) && hcd->speed < HCD_USB3 && 1679 1643 test_and_clear_bit(hcd_portnum, 1680 1644 &bus_state->rexit_ports)) { 1681 1645 complete(&bus_state->rexit_done[hcd_portnum]); ··· 1683 1647 goto cleanup; 1684 1648 } 1685 1649 1686 - if (hcd->speed < HCD_USB3) 1650 + if (hcd->speed < HCD_USB3) { 1687 1651 xhci_test_and_clear_bit(xhci, port, PORT_PLC); 1652 + if ((xhci->quirks & XHCI_RESET_PLL_ON_DISCONNECT) && 1653 + (portsc & PORT_CSC) && !(portsc & PORT_CONNECT)) 1654 + xhci_cavium_reset_phy_quirk(xhci); 1655 + } 1688 1656 1689 1657 cleanup: 1690 1658 /* Update event ring dequeue pointer before dropping the lock */ ··· 2306 2266 goto cleanup; 2307 2267 case COMP_RING_UNDERRUN: 2308 2268 case COMP_RING_OVERRUN: 2269 + case COMP_STOPPED_LENGTH_INVALID: 2309 2270 goto cleanup; 2310 2271 default: 2311 2272 xhci_err(xhci, "ERROR Transfer event for unknown stream ring slot %u ep %u\n",
+1
drivers/usb/host/xhci-tegra.c
··· 1303 1303 1304 1304 usb_remove_hcd(xhci->shared_hcd); 1305 1305 usb_put_hcd(xhci->shared_hcd); 1306 + xhci->shared_hcd = NULL; 1306 1307 usb_remove_hcd(tegra->hcd); 1307 1308 usb_put_hcd(tegra->hcd); 1308 1309
-2
drivers/usb/host/xhci.c
··· 719 719 720 720 /* Only halt host and free memory after both hcds are removed */ 721 721 if (!usb_hcd_is_primary_hcd(hcd)) { 722 - /* usb core will free this hcd shortly, unset pointer */ 723 - xhci->shared_hcd = NULL; 724 722 mutex_unlock(&xhci->mutex); 725 723 return; 726 724 }
+2 -1
drivers/usb/host/xhci.h
··· 1680 1680 * It can take up to 20 ms to transition from RExit to U0 on the 1681 1681 * Intel Lynx Point LP xHCI host. 1682 1682 */ 1683 - #define XHCI_MAX_REXIT_TIMEOUT (20 * 1000) 1683 + #define XHCI_MAX_REXIT_TIMEOUT_MS 20 1684 1684 1685 1685 static inline unsigned int hcd_index(struct usb_hcd *hcd) 1686 1686 { ··· 1849 1849 #define XHCI_INTEL_USB_ROLE_SW BIT_ULL(31) 1850 1850 #define XHCI_ZERO_64B_REGS BIT_ULL(32) 1851 1851 #define XHCI_DEFAULT_PM_RUNTIME_ALLOW BIT_ULL(33) 1852 + #define XHCI_RESET_PLL_ON_DISCONNECT BIT_ULL(34) 1852 1853 1853 1854 unsigned int num_active_eps; 1854 1855 unsigned int limit_active_eps;
+1
drivers/usb/misc/appledisplay.c
··· 50 50 { APPLEDISPLAY_DEVICE(0x9219) }, 51 51 { APPLEDISPLAY_DEVICE(0x921c) }, 52 52 { APPLEDISPLAY_DEVICE(0x921d) }, 53 + { APPLEDISPLAY_DEVICE(0x9222) }, 53 54 { APPLEDISPLAY_DEVICE(0x9236) }, 54 55 55 56 /* Terminating entry */
+3
include/linux/usb/quirks.h
··· 66 66 /* Device needs a pause after every control message. */ 67 67 #define USB_QUIRK_DELAY_CTRL_MSG BIT(13) 68 68 69 + /* Hub needs extra delay after resetting its port. */ 70 + #define USB_QUIRK_HUB_SLOW_RESET BIT(14) 71 + 69 72 #endif /* __LINUX_USB_QUIRKS_H */