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-6.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
"Here are some USB driver fixes for 6.16-rc5. I originally wanted this
to get into -rc4, but there were some regressions that had to be
handled first. Now all looks good. Included in here are the following
fixes:

- cdns3 driver fixes

- xhci driver fixes

- typec driver fixes

- USB hub fixes (this is what took the longest to get right)

- new USB driver quirks added

- chipidea driver fixes

All of these have been in linux-next for a while and now we have no
more reported problems with them"

* tag 'usb-6.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (21 commits)
usb: hub: Fix flushing of delayed work used for post resume purposes
xhci: dbc: Flush queued requests before stopping dbc
xhci: dbctty: disable ECHO flag by default
xhci: Disable stream for xHC controller with XHCI_BROKEN_STREAMS
usb: xhci: quirk for data loss in ISOC transfers
usb: dwc3: gadget: Fix TRB reclaim logic for short transfers and ZLPs
usb: hub: Fix flushing and scheduling of delayed work that tunes runtime pm
usb: typec: displayport: Fix potential deadlock
usb: typec: altmodes/displayport: do not index invalid pin_assignments
usb: cdnsp: Fix issue with CV Bad Descriptor test
usb: typec: tcpm: apply vbus before data bringup in tcpm_src_attach
Revert "usb: xhci: Implement xhci_handshake_check_state() helper"
usb: xhci: Skip xhci_reset in xhci_resume if xhci is being removed
usb: gadget: u_serial: Fix race condition in TTY wakeup
Revert "usb: gadget: u_serial: Add null pointer check in gs_start_io"
usb: chipidea: udc: disconnect/reconnect from host when do suspend/resume
usb: acpi: fix device link removal
usb: hub: fix detection of high tier USB3 devices behind suspended hubs
Logitech C-270 even more broken
usb: dwc3: Abort suspend on soft disconnect failure
...

+160 -85
+3 -2
drivers/usb/cdns3/cdnsp-debug.h
··· 327 327 case TRB_RESET_EP: 328 328 case TRB_HALT_ENDPOINT: 329 329 ret = scnprintf(str, size, 330 - "%s: ep%d%s(%d) ctx %08x%08x slot %ld flags %c", 330 + "%s: ep%d%s(%d) ctx %08x%08x slot %ld flags %c %c", 331 331 cdnsp_trb_type_string(type), 332 332 ep_num, ep_id % 2 ? "out" : "in", 333 333 TRB_TO_EP_INDEX(field3), field1, field0, 334 334 TRB_TO_SLOT_ID(field3), 335 - field3 & TRB_CYCLE ? 'C' : 'c'); 335 + field3 & TRB_CYCLE ? 'C' : 'c', 336 + field3 & TRB_ESP ? 'P' : 'p'); 336 337 break; 337 338 case TRB_STOP_RING: 338 339 ret = scnprintf(str, size,
+15 -3
drivers/usb/cdns3/cdnsp-ep0.c
··· 414 414 void cdnsp_setup_analyze(struct cdnsp_device *pdev) 415 415 { 416 416 struct usb_ctrlrequest *ctrl = &pdev->setup; 417 + struct cdnsp_ep *pep; 417 418 int ret = -EINVAL; 418 419 u16 len; 419 420 ··· 428 427 goto out; 429 428 } 430 429 430 + pep = &pdev->eps[0]; 431 + 431 432 /* Restore the ep0 to Stopped/Running state. */ 432 - if (pdev->eps[0].ep_state & EP_HALTED) { 433 - trace_cdnsp_ep0_halted("Restore to normal state"); 434 - cdnsp_halt_endpoint(pdev, &pdev->eps[0], 0); 433 + if (pep->ep_state & EP_HALTED) { 434 + if (GET_EP_CTX_STATE(pep->out_ctx) == EP_STATE_HALTED) 435 + cdnsp_halt_endpoint(pdev, pep, 0); 436 + 437 + /* 438 + * Halt Endpoint Command for SSP2 for ep0 preserve current 439 + * endpoint state and driver has to synchronize the 440 + * software endpoint state with endpoint output context 441 + * state. 442 + */ 443 + pep->ep_state &= ~EP_HALTED; 444 + pep->ep_state |= EP_STOPPED; 435 445 } 436 446 437 447 /*
+6
drivers/usb/cdns3/cdnsp-gadget.h
··· 987 987 #define STREAM_ID_FOR_TRB(p) ((((p)) << 16) & GENMASK(31, 16)) 988 988 #define SCT_FOR_TRB(p) (((p) << 1) & 0x7) 989 989 990 + /* 991 + * Halt Endpoint Command TRB field. 992 + * The ESP bit only exists in the SSP2 controller. 993 + */ 994 + #define TRB_ESP BIT(9) 995 + 990 996 /* Link TRB specific fields. */ 991 997 #define TRB_TC BIT(1) 992 998
+5 -2
drivers/usb/cdns3/cdnsp-ring.c
··· 772 772 } 773 773 774 774 if (port_id != old_port) { 775 - cdnsp_disable_slot(pdev); 775 + if (pdev->slot_id) 776 + cdnsp_disable_slot(pdev); 777 + 776 778 pdev->active_port = port; 777 779 cdnsp_enable_slot(pdev); 778 780 } ··· 2485 2483 { 2486 2484 cdnsp_queue_command(pdev, 0, 0, 0, TRB_TYPE(TRB_HALT_ENDPOINT) | 2487 2485 SLOT_ID_FOR_TRB(pdev->slot_id) | 2488 - EP_ID_FOR_TRB(ep_index)); 2486 + EP_ID_FOR_TRB(ep_index) | 2487 + (!ep_index ? TRB_ESP : 0)); 2489 2488 } 2490 2489 2491 2490 void cdnsp_force_header_wakeup(struct cdnsp_device *pdev, int intf_num)
+7
drivers/usb/chipidea/udc.c
··· 2374 2374 */ 2375 2375 if (hw_read(ci, OP_ENDPTLISTADDR, ~0) == 0) 2376 2376 hw_write(ci, OP_ENDPTLISTADDR, ~0, ~0); 2377 + 2378 + if (ci->gadget.connected && 2379 + (!ci->suspended || !device_may_wakeup(ci->dev))) 2380 + usb_gadget_disconnect(&ci->gadget); 2377 2381 } 2378 2382 2379 2383 static void udc_resume(struct ci_hdrc *ci, bool power_lost) ··· 2388 2384 OTGSC_BSVIS | OTGSC_BSVIE); 2389 2385 if (ci->vbus_active) 2390 2386 usb_gadget_vbus_disconnect(&ci->gadget); 2387 + } else if (ci->vbus_active && ci->driver && 2388 + !ci->gadget.connected) { 2389 + usb_gadget_connect(&ci->gadget); 2391 2390 } 2392 2391 2393 2392 /* Restore value 0 if it was set for power lost check */
+31
drivers/usb/core/hub.c
··· 68 68 */ 69 69 #define USB_SHORT_SET_ADDRESS_REQ_TIMEOUT 500 /* ms */ 70 70 71 + /* 72 + * Give SS hubs 200ms time after wake to train downstream links before 73 + * assuming no port activity and allowing hub to runtime suspend back. 74 + */ 75 + #define USB_SS_PORT_U0_WAKE_TIME 200 /* ms */ 76 + 71 77 /* Protect struct usb_device->state and ->children members 72 78 * Note: Both are also protected by ->dev.sem, except that ->state can 73 79 * change to USB_STATE_NOTATTACHED even when the semaphore isn't held. */ ··· 1101 1095 goto init2; 1102 1096 goto init3; 1103 1097 } 1098 + 1104 1099 hub_get(hub); 1105 1100 1106 1101 /* The superspeed hub except for root hub has to use Hub Depth ··· 1350 1343 device_unlock(&hdev->dev); 1351 1344 } 1352 1345 1346 + if (type == HUB_RESUME && hub_is_superspeed(hub->hdev)) { 1347 + /* give usb3 downstream links training time after hub resume */ 1348 + usb_autopm_get_interface_no_resume( 1349 + to_usb_interface(hub->intfdev)); 1350 + 1351 + queue_delayed_work(system_power_efficient_wq, 1352 + &hub->post_resume_work, 1353 + msecs_to_jiffies(USB_SS_PORT_U0_WAKE_TIME)); 1354 + return; 1355 + } 1356 + 1353 1357 hub_put(hub); 1354 1358 } 1355 1359 ··· 1377 1359 struct usb_hub *hub = container_of(ws, struct usb_hub, init_work.work); 1378 1360 1379 1361 hub_activate(hub, HUB_INIT3); 1362 + } 1363 + 1364 + static void hub_post_resume(struct work_struct *ws) 1365 + { 1366 + struct usb_hub *hub = container_of(ws, struct usb_hub, post_resume_work.work); 1367 + 1368 + usb_autopm_put_interface_async(to_usb_interface(hub->intfdev)); 1369 + hub_put(hub); 1380 1370 } 1381 1371 1382 1372 enum hub_quiescing_type { ··· 1412 1386 1413 1387 /* Stop hub_wq and related activity */ 1414 1388 timer_delete_sync(&hub->irq_urb_retry); 1389 + flush_delayed_work(&hub->post_resume_work); 1415 1390 usb_kill_urb(hub->urb); 1416 1391 if (hub->has_indicators) 1417 1392 cancel_delayed_work_sync(&hub->leds); ··· 1971 1944 hub->hdev = hdev; 1972 1945 INIT_DELAYED_WORK(&hub->leds, led_work); 1973 1946 INIT_DELAYED_WORK(&hub->init_work, NULL); 1947 + INIT_DELAYED_WORK(&hub->post_resume_work, hub_post_resume); 1974 1948 INIT_WORK(&hub->events, hub_event); 1975 1949 INIT_LIST_HEAD(&hub->onboard_devs); 1976 1950 spin_lock_init(&hub->irq_urb_lock); ··· 2364 2336 2365 2337 usb_remove_ep_devs(&udev->ep0); 2366 2338 usb_unlock_device(udev); 2339 + 2340 + if (udev->usb4_link) 2341 + device_link_del(udev->usb4_link); 2367 2342 2368 2343 /* Unregister the device. The device driver is responsible 2369 2344 * for de-configuring the device and invoking the remove-device
+1
drivers/usb/core/hub.h
··· 70 70 u8 indicator[USB_MAXCHILDREN]; 71 71 struct delayed_work leds; 72 72 struct delayed_work init_work; 73 + struct delayed_work post_resume_work; 73 74 struct work_struct events; 74 75 spinlock_t irq_urb_lock; 75 76 struct timer_list irq_urb_retry;
+2 -1
drivers/usb/core/quirks.c
··· 227 227 { USB_DEVICE(0x046a, 0x0023), .driver_info = USB_QUIRK_RESET_RESUME }, 228 228 229 229 /* Logitech HD Webcam C270 */ 230 - { USB_DEVICE(0x046d, 0x0825), .driver_info = USB_QUIRK_RESET_RESUME }, 230 + { USB_DEVICE(0x046d, 0x0825), .driver_info = USB_QUIRK_RESET_RESUME | 231 + USB_QUIRK_NO_LPM}, 231 232 232 233 /* Logitech HD Pro Webcams C920, C920-C, C922, C925e and C930e */ 233 234 { USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT },
+3 -1
drivers/usb/core/usb-acpi.c
··· 157 157 */ 158 158 static int usb_acpi_add_usb4_devlink(struct usb_device *udev) 159 159 { 160 - const struct device_link *link; 160 + struct device_link *link; 161 161 struct usb_port *port_dev; 162 162 struct usb_hub *hub; 163 163 ··· 187 187 188 188 dev_dbg(&port_dev->dev, "Created device link from %s to %s\n", 189 189 dev_name(&port_dev->child->dev), dev_name(nhi_fwnode->dev)); 190 + 191 + udev->usb4_link = link; 190 192 191 193 return 0; 192 194 }
+7 -2
drivers/usb/dwc3/core.c
··· 2422 2422 { 2423 2423 u32 reg; 2424 2424 int i; 2425 + int ret; 2425 2426 2426 2427 if (!pm_runtime_suspended(dwc->dev) && !PMSG_IS_AUTO(msg)) { 2427 2428 dwc->susphy_state = (dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)) & ··· 2441 2440 case DWC3_GCTL_PRTCAP_DEVICE: 2442 2441 if (pm_runtime_suspended(dwc->dev)) 2443 2442 break; 2444 - dwc3_gadget_suspend(dwc); 2443 + ret = dwc3_gadget_suspend(dwc); 2444 + if (ret) 2445 + return ret; 2445 2446 synchronize_irq(dwc->irq_gadget); 2446 2447 dwc3_core_exit(dwc); 2447 2448 break; ··· 2478 2475 break; 2479 2476 2480 2477 if (dwc->current_otg_role == DWC3_OTG_ROLE_DEVICE) { 2481 - dwc3_gadget_suspend(dwc); 2478 + ret = dwc3_gadget_suspend(dwc); 2479 + if (ret) 2480 + return ret; 2482 2481 synchronize_irq(dwc->irq_gadget); 2483 2482 } 2484 2483
+10 -14
drivers/usb/dwc3/gadget.c
··· 3516 3516 * We're going to do that here to avoid problems of HW trying 3517 3517 * to use bogus TRBs for transfers. 3518 3518 */ 3519 - if (chain && (trb->ctrl & DWC3_TRB_CTRL_HWO)) 3519 + if (trb->ctrl & DWC3_TRB_CTRL_HWO) 3520 3520 trb->ctrl &= ~DWC3_TRB_CTRL_HWO; 3521 3521 3522 3522 /* ··· 4821 4821 int ret; 4822 4822 4823 4823 ret = dwc3_gadget_soft_disconnect(dwc); 4824 - if (ret) 4825 - goto err; 4824 + /* 4825 + * Attempt to reset the controller's state. Likely no 4826 + * communication can be established until the host 4827 + * performs a port reset. 4828 + */ 4829 + if (ret && dwc->softconnect) { 4830 + dwc3_gadget_soft_connect(dwc); 4831 + return -EAGAIN; 4832 + } 4826 4833 4827 4834 spin_lock_irqsave(&dwc->lock, flags); 4828 4835 if (dwc->gadget_driver) ··· 4837 4830 spin_unlock_irqrestore(&dwc->lock, flags); 4838 4831 4839 4832 return 0; 4840 - 4841 - err: 4842 - /* 4843 - * Attempt to reset the controller's state. Likely no 4844 - * communication can be established until the host 4845 - * performs a port reset. 4846 - */ 4847 - if (dwc->softconnect) 4848 - dwc3_gadget_soft_connect(dwc); 4849 - 4850 - return ret; 4851 4833 } 4852 4834 4853 4835 int dwc3_gadget_resume(struct dwc3 *dwc)
+4 -8
drivers/usb/gadget/function/u_serial.c
··· 295 295 break; 296 296 } 297 297 298 - if (do_tty_wake && port->port.tty) 299 - tty_wakeup(port->port.tty); 298 + if (do_tty_wake) 299 + tty_port_tty_wakeup(&port->port); 300 300 return status; 301 301 } 302 302 ··· 544 544 static int gs_start_io(struct gs_port *port) 545 545 { 546 546 struct list_head *head = &port->read_pool; 547 - struct usb_ep *ep; 547 + struct usb_ep *ep = port->port_usb->out; 548 548 int status; 549 549 unsigned started; 550 - 551 - if (!port->port_usb || !port->port.tty) 552 - return -EIO; 553 550 554 551 /* Allocate RX and TX I/O buffers. We can't easily do this much 555 552 * earlier (with GFP_KERNEL) because the requests are coupled to ··· 554 557 * configurations may use different endpoints with a given port; 555 558 * and high speed vs full speed changes packet sizes too. 556 559 */ 557 - ep = port->port_usb->out; 558 560 status = gs_alloc_requests(ep, head, gs_read_complete, 559 561 &port->read_allocated); 560 562 if (status) ··· 574 578 gs_start_tx(port); 575 579 /* Unblock any pending writes into our circular buffer, in case 576 580 * we didn't in gs_start_tx() */ 577 - tty_wakeup(port->port.tty); 581 + tty_port_tty_wakeup(&port->port); 578 582 } else { 579 583 /* Free reqs only if we are still connected */ 580 584 if (port->port_usb) {
+4
drivers/usb/host/xhci-dbgcap.c
··· 652 652 case DS_DISABLED: 653 653 return; 654 654 case DS_CONFIGURED: 655 + spin_lock(&dbc->lock); 656 + xhci_dbc_flush_requests(dbc); 657 + spin_unlock(&dbc->lock); 658 + 655 659 if (dbc->driver->disconnect) 656 660 dbc->driver->disconnect(dbc); 657 661 break;
+1
drivers/usb/host/xhci-dbgtty.c
··· 617 617 dbc_tty_driver->type = TTY_DRIVER_TYPE_SERIAL; 618 618 dbc_tty_driver->subtype = SERIAL_TYPE_NORMAL; 619 619 dbc_tty_driver->init_termios = tty_std_termios; 620 + dbc_tty_driver->init_termios.c_lflag &= ~ECHO; 620 621 dbc_tty_driver->init_termios.c_cflag = 621 622 B9600 | CS8 | CREAD | HUPCL | CLOCAL; 622 623 dbc_tty_driver->init_termios.c_ispeed = 9600;
+4
drivers/usb/host/xhci-mem.c
··· 1449 1449 /* Periodic endpoint bInterval limit quirk */ 1450 1450 if (usb_endpoint_xfer_int(&ep->desc) || 1451 1451 usb_endpoint_xfer_isoc(&ep->desc)) { 1452 + if ((xhci->quirks & XHCI_LIMIT_ENDPOINT_INTERVAL_9) && 1453 + interval >= 9) { 1454 + interval = 8; 1455 + } 1452 1456 if ((xhci->quirks & XHCI_LIMIT_ENDPOINT_INTERVAL_7) && 1453 1457 udev->speed >= USB_SPEED_HIGH && 1454 1458 interval >= 7) {
+25
drivers/usb/host/xhci-pci.c
··· 71 71 #define PCI_DEVICE_ID_INTEL_TITAN_RIDGE_4C_XHCI 0x15ec 72 72 #define PCI_DEVICE_ID_INTEL_TITAN_RIDGE_DD_XHCI 0x15f0 73 73 74 + #define PCI_DEVICE_ID_AMD_ARIEL_TYPEC_XHCI 0x13ed 75 + #define PCI_DEVICE_ID_AMD_ARIEL_TYPEA_XHCI 0x13ee 76 + #define PCI_DEVICE_ID_AMD_STARSHIP_XHCI 0x148c 77 + #define PCI_DEVICE_ID_AMD_FIREFLIGHT_15D4_XHCI 0x15d4 78 + #define PCI_DEVICE_ID_AMD_FIREFLIGHT_15D5_XHCI 0x15d5 79 + #define PCI_DEVICE_ID_AMD_RAVEN_15E0_XHCI 0x15e0 80 + #define PCI_DEVICE_ID_AMD_RAVEN_15E1_XHCI 0x15e1 81 + #define PCI_DEVICE_ID_AMD_RAVEN2_XHCI 0x15e5 74 82 #define PCI_DEVICE_ID_AMD_RENOIR_XHCI 0x1639 75 83 #define PCI_DEVICE_ID_AMD_PROMONTORYA_4 0x43b9 76 84 #define PCI_DEVICE_ID_AMD_PROMONTORYA_3 0x43ba 77 85 #define PCI_DEVICE_ID_AMD_PROMONTORYA_2 0x43bb 78 86 #define PCI_DEVICE_ID_AMD_PROMONTORYA_1 0x43bc 87 + 88 + #define PCI_DEVICE_ID_ATI_NAVI10_7316_XHCI 0x7316 79 89 80 90 #define PCI_DEVICE_ID_ASMEDIA_1042_XHCI 0x1042 81 91 #define PCI_DEVICE_ID_ASMEDIA_1042A_XHCI 0x1142 ··· 289 279 290 280 if (pdev->vendor == PCI_VENDOR_ID_NEC) 291 281 xhci->quirks |= XHCI_NEC_HOST; 282 + 283 + if (pdev->vendor == PCI_VENDOR_ID_AMD && 284 + (pdev->device == PCI_DEVICE_ID_AMD_ARIEL_TYPEC_XHCI || 285 + pdev->device == PCI_DEVICE_ID_AMD_ARIEL_TYPEA_XHCI || 286 + pdev->device == PCI_DEVICE_ID_AMD_STARSHIP_XHCI || 287 + pdev->device == PCI_DEVICE_ID_AMD_FIREFLIGHT_15D4_XHCI || 288 + pdev->device == PCI_DEVICE_ID_AMD_FIREFLIGHT_15D5_XHCI || 289 + pdev->device == PCI_DEVICE_ID_AMD_RAVEN_15E0_XHCI || 290 + pdev->device == PCI_DEVICE_ID_AMD_RAVEN_15E1_XHCI || 291 + pdev->device == PCI_DEVICE_ID_AMD_RAVEN2_XHCI)) 292 + xhci->quirks |= XHCI_LIMIT_ENDPOINT_INTERVAL_9; 293 + 294 + if (pdev->vendor == PCI_VENDOR_ID_ATI && 295 + pdev->device == PCI_DEVICE_ID_ATI_NAVI10_7316_XHCI) 296 + xhci->quirks |= XHCI_LIMIT_ENDPOINT_INTERVAL_9; 292 297 293 298 if (pdev->vendor == PCI_VENDOR_ID_AMD && xhci->hci_version == 0x96) 294 299 xhci->quirks |= XHCI_AMD_0x96_HOST;
+2 -1
drivers/usb/host/xhci-plat.c
··· 328 328 } 329 329 330 330 usb3_hcd = xhci_get_usb3_hcd(xhci); 331 - if (usb3_hcd && HCC_MAX_PSA(xhci->hcc_params) >= 4) 331 + if (usb3_hcd && HCC_MAX_PSA(xhci->hcc_params) >= 4 && 332 + !(xhci->quirks & XHCI_BROKEN_STREAMS)) 332 333 usb3_hcd->can_do_streams = 1; 333 334 334 335 if (xhci->shared_hcd) {
+2 -3
drivers/usb/host/xhci-ring.c
··· 518 518 * In the future we should distinguish between -ENODEV and -ETIMEDOUT 519 519 * and try to recover a -ETIMEDOUT with a host controller reset. 520 520 */ 521 - ret = xhci_handshake_check_state(xhci, &xhci->op_regs->cmd_ring, 522 - CMD_RING_RUNNING, 0, 5 * 1000 * 1000, 523 - XHCI_STATE_REMOVING); 521 + ret = xhci_handshake(&xhci->op_regs->cmd_ring, 522 + CMD_RING_RUNNING, 0, 5 * 1000 * 1000); 524 523 if (ret < 0) { 525 524 xhci_err(xhci, "Abort failed to stop command ring: %d\n", ret); 526 525 xhci_halt(xhci);
+5 -26
drivers/usb/host/xhci.c
··· 85 85 } 86 86 87 87 /* 88 - * xhci_handshake_check_state - same as xhci_handshake but takes an additional 89 - * exit_state parameter, and bails out with an error immediately when xhc_state 90 - * has exit_state flag set. 91 - */ 92 - int xhci_handshake_check_state(struct xhci_hcd *xhci, void __iomem *ptr, 93 - u32 mask, u32 done, int usec, unsigned int exit_state) 94 - { 95 - u32 result; 96 - int ret; 97 - 98 - ret = readl_poll_timeout_atomic(ptr, result, 99 - (result & mask) == done || 100 - result == U32_MAX || 101 - xhci->xhc_state & exit_state, 102 - 1, usec); 103 - 104 - if (result == U32_MAX || xhci->xhc_state & exit_state) 105 - return -ENODEV; 106 - 107 - return ret; 108 - } 109 - 110 - /* 111 88 * Disable interrupts and begin the xHCI halting process. 112 89 */ 113 90 void xhci_quiesce(struct xhci_hcd *xhci) ··· 204 227 if (xhci->quirks & XHCI_INTEL_HOST) 205 228 udelay(1000); 206 229 207 - ret = xhci_handshake_check_state(xhci, &xhci->op_regs->command, 208 - CMD_RESET, 0, timeout_us, XHCI_STATE_REMOVING); 230 + ret = xhci_handshake(&xhci->op_regs->command, CMD_RESET, 0, timeout_us); 209 231 if (ret) 210 232 return ret; 211 233 ··· 1158 1182 xhci_dbg(xhci, "Stop HCD\n"); 1159 1183 xhci_halt(xhci); 1160 1184 xhci_zero_64b_regs(xhci); 1161 - retval = xhci_reset(xhci, XHCI_RESET_LONG_USEC); 1185 + if (xhci->xhc_state & XHCI_STATE_REMOVING) 1186 + retval = -ENODEV; 1187 + else 1188 + retval = xhci_reset(xhci, XHCI_RESET_LONG_USEC); 1162 1189 spin_unlock_irq(&xhci->lock); 1163 1190 if (retval) 1164 1191 return retval;
+1 -2
drivers/usb/host/xhci.h
··· 1643 1643 #define XHCI_WRITE_64_HI_LO BIT_ULL(47) 1644 1644 #define XHCI_CDNS_SCTX_QUIRK BIT_ULL(48) 1645 1645 #define XHCI_ETRON_HOST BIT_ULL(49) 1646 + #define XHCI_LIMIT_ENDPOINT_INTERVAL_9 BIT_ULL(50) 1646 1647 1647 1648 unsigned int num_active_eps; 1648 1649 unsigned int limit_active_eps; ··· 1869 1868 /* xHCI host controller glue */ 1870 1869 typedef void (*xhci_get_quirks_t)(struct device *, struct xhci_hcd *); 1871 1870 int xhci_handshake(void __iomem *ptr, u32 mask, u32 done, u64 timeout_us); 1872 - int xhci_handshake_check_state(struct xhci_hcd *xhci, void __iomem *ptr, 1873 - u32 mask, u32 done, int usec, unsigned int exit_state); 1874 1871 void xhci_quiesce(struct xhci_hcd *xhci); 1875 1872 int xhci_halt(struct xhci_hcd *xhci); 1876 1873 int xhci_start(struct xhci_hcd *xhci);
+2 -3
drivers/usb/typec/altmodes/displayport.c
··· 394 394 case CMDT_RSP_NAK: 395 395 switch (cmd) { 396 396 case DP_CMD_STATUS_UPDATE: 397 - if (typec_altmode_exit(alt)) 398 - dev_err(&dp->alt->dev, "Exit Mode Failed!\n"); 397 + dp->state = DP_STATE_EXIT; 399 398 break; 400 399 case DP_CMD_CONFIGURE: 401 400 dp->data.conf = 0; ··· 676 677 677 678 assignments = get_current_pin_assignments(dp); 678 679 679 - for (i = 0; assignments; assignments >>= 1, i++) { 680 + for (i = 0; assignments && i < DP_PIN_ASSIGN_MAX; assignments >>= 1, i++) { 680 681 if (assignments & 1) { 681 682 if (i == cur) 682 683 len += sprintf(buf + len, "[%s] ",
+17 -17
drivers/usb/typec/tcpm/tcpm.c
··· 4410 4410 4411 4411 tcpm_enable_auto_vbus_discharge(port, true); 4412 4412 4413 - ret = tcpm_set_roles(port, true, TYPEC_STATE_USB, 4414 - TYPEC_SOURCE, tcpm_data_role_for_source(port)); 4415 - if (ret < 0) 4416 - return ret; 4417 - 4418 - if (port->pd_supported) { 4419 - ret = port->tcpc->set_pd_rx(port->tcpc, true); 4420 - if (ret < 0) 4421 - goto out_disable_mux; 4422 - } 4423 - 4424 4413 /* 4425 4414 * USB Type-C specification, version 1.2, 4426 4415 * chapter 4.5.2.2.8.1 (Attached.SRC Requirements) ··· 4419 4430 (polarity == TYPEC_POLARITY_CC2 && port->cc1 == TYPEC_CC_RA)) { 4420 4431 ret = tcpm_set_vconn(port, true); 4421 4432 if (ret < 0) 4422 - goto out_disable_pd; 4433 + return ret; 4423 4434 } 4424 4435 4425 4436 ret = tcpm_set_vbus(port, true); 4426 4437 if (ret < 0) 4427 4438 goto out_disable_vconn; 4439 + 4440 + ret = tcpm_set_roles(port, true, TYPEC_STATE_USB, TYPEC_SOURCE, 4441 + tcpm_data_role_for_source(port)); 4442 + if (ret < 0) 4443 + goto out_disable_vbus; 4444 + 4445 + if (port->pd_supported) { 4446 + ret = port->tcpc->set_pd_rx(port->tcpc, true); 4447 + if (ret < 0) 4448 + goto out_disable_mux; 4449 + } 4428 4450 4429 4451 port->pd_capable = false; 4430 4452 ··· 4447 4447 4448 4448 return 0; 4449 4449 4450 - out_disable_vconn: 4451 - tcpm_set_vconn(port, false); 4452 - out_disable_pd: 4453 - if (port->pd_supported) 4454 - port->tcpc->set_pd_rx(port->tcpc, false); 4455 4450 out_disable_mux: 4456 4451 tcpm_mux_set(port, TYPEC_STATE_SAFE, USB_ROLE_NONE, 4457 4452 TYPEC_ORIENTATION_NONE); 4453 + out_disable_vbus: 4454 + tcpm_set_vbus(port, false); 4455 + out_disable_vconn: 4456 + tcpm_set_vconn(port, false); 4457 + 4458 4458 return ret; 4459 4459 } 4460 4460
+2
include/linux/usb.h
··· 614 614 * FIXME -- complete doc 615 615 * @authenticated: Crypto authentication passed 616 616 * @tunnel_mode: Connection native or tunneled over USB4 617 + * @usb4_link: device link to the USB4 host interface 617 618 * @lpm_capable: device supports LPM 618 619 * @lpm_devinit_allow: Allow USB3 device initiated LPM, exit latency is in range 619 620 * @usb2_hw_lpm_capable: device can perform USB2 hardware LPM ··· 725 724 unsigned reset_resume:1; 726 725 unsigned port_is_suspended:1; 727 726 enum usb_link_tunnel_mode tunnel_mode; 727 + struct device_link *usb4_link; 728 728 729 729 int slot_id; 730 730 struct usb2_lpm_parameters l1_params;
+1
include/linux/usb/typec_dp.h
··· 57 57 DP_PIN_ASSIGN_D, 58 58 DP_PIN_ASSIGN_E, 59 59 DP_PIN_ASSIGN_F, /* Not supported after v1.0b */ 60 + DP_PIN_ASSIGN_MAX, 60 61 }; 61 62 62 63 /* DisplayPort alt mode specific commands */