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

Pull USB driver fixes from Greg KH:
"Here are some small USB driver fixes for 5.17-rc2 that resolve a
number of reported problems. These include:

- typec driver fixes

- xhci platform driver fixes for suspending

- ulpi core fix

- role.h build fix

- new device ids

- syzbot-reported bugfixes

- gadget driver fixes

- dwc3 driver fixes

- other small fixes

All of these have been in linux-next this week with no reported
issues"

* tag 'usb-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
usb: cdnsp: Fix segmentation fault in cdns_lost_power function
usb: dwc2: gadget: don't try to disable ep0 in dwc2_hsotg_suspend
usb: gadget: at91_udc: fix incorrect print type
usb: dwc3: xilinx: Fix error handling when getting USB3 PHY
usb: dwc3: xilinx: Skip resets and USB3 register settings for USB2.0 mode
usb: xhci-plat: fix crash when suspend if remote wake enable
usb: common: ulpi: Fix crash in ulpi_match()
usb: gadget: f_sourcesink: Fix isoc transfer for USB_SPEED_SUPER_PLUS
ucsi_ccg: Check DEV_INT bit only when starting CCG4
USB: core: Fix hang in usb_kill_urb by adding memory barriers
usb-storage: Add unusual-devs entry for VL817 USB-SATA bridge
usb: typec: tcpm: Do not disconnect when receiving VSAFE0V
usb: typec: tcpm: Do not disconnect while receiving VBUS off
usb: typec: Don't try to register component master without components
usb: typec: Only attempt to link USB ports if there is fwnode
usb: typec: tcpci: don't touch CC line if it's Vconn source
usb: roles: fix include/linux/usb/role.h compile issue

+115 -15
+3 -3
drivers/usb/cdns3/drd.c
··· 483 483 /* Indicate the cdns3 core was power lost before */ 484 484 bool cdns_power_is_lost(struct cdns *cdns) 485 485 { 486 - if (cdns->version == CDNS3_CONTROLLER_V1) { 487 - if (!(readl(&cdns->otg_v1_regs->simulate) & BIT(0))) 486 + if (cdns->version == CDNS3_CONTROLLER_V0) { 487 + if (!(readl(&cdns->otg_v0_regs->simulate) & BIT(0))) 488 488 return true; 489 489 } else { 490 - if (!(readl(&cdns->otg_v0_regs->simulate) & BIT(0))) 490 + if (!(readl(&cdns->otg_v1_regs->simulate) & BIT(0))) 491 491 return true; 492 492 } 493 493 return false;
+5 -2
drivers/usb/common/ulpi.c
··· 39 39 struct ulpi *ulpi = to_ulpi_dev(dev); 40 40 const struct ulpi_device_id *id; 41 41 42 - /* Some ULPI devices don't have a vendor id so rely on OF match */ 43 - if (ulpi->id.vendor == 0) 42 + /* 43 + * Some ULPI devices don't have a vendor id 44 + * or provide an id_table so rely on OF match. 45 + */ 46 + if (ulpi->id.vendor == 0 || !drv->id_table) 44 47 return of_driver_match_device(dev, driver); 45 48 46 49 for (id = drv->id_table; id->vendor; id++)
+14
drivers/usb/core/hcd.c
··· 1563 1563 urb->hcpriv = NULL; 1564 1564 INIT_LIST_HEAD(&urb->urb_list); 1565 1565 atomic_dec(&urb->use_count); 1566 + /* 1567 + * Order the write of urb->use_count above before the read 1568 + * of urb->reject below. Pairs with the memory barriers in 1569 + * usb_kill_urb() and usb_poison_urb(). 1570 + */ 1571 + smp_mb__after_atomic(); 1572 + 1566 1573 atomic_dec(&urb->dev->urbnum); 1567 1574 if (atomic_read(&urb->reject)) 1568 1575 wake_up(&usb_kill_urb_queue); ··· 1672 1665 1673 1666 usb_anchor_resume_wakeups(anchor); 1674 1667 atomic_dec(&urb->use_count); 1668 + /* 1669 + * Order the write of urb->use_count above before the read 1670 + * of urb->reject below. Pairs with the memory barriers in 1671 + * usb_kill_urb() and usb_poison_urb(). 1672 + */ 1673 + smp_mb__after_atomic(); 1674 + 1675 1675 if (unlikely(atomic_read(&urb->reject))) 1676 1676 wake_up(&usb_kill_urb_queue); 1677 1677 usb_put_urb(urb);
+12
drivers/usb/core/urb.c
··· 715 715 if (!(urb && urb->dev && urb->ep)) 716 716 return; 717 717 atomic_inc(&urb->reject); 718 + /* 719 + * Order the write of urb->reject above before the read 720 + * of urb->use_count below. Pairs with the barriers in 721 + * __usb_hcd_giveback_urb() and usb_hcd_submit_urb(). 722 + */ 723 + smp_mb__after_atomic(); 718 724 719 725 usb_hcd_unlink_urb(urb, -ENOENT); 720 726 wait_event(usb_kill_urb_queue, atomic_read(&urb->use_count) == 0); ··· 762 756 if (!urb) 763 757 return; 764 758 atomic_inc(&urb->reject); 759 + /* 760 + * Order the write of urb->reject above before the read 761 + * of urb->use_count below. Pairs with the barriers in 762 + * __usb_hcd_giveback_urb() and usb_hcd_submit_urb(). 763 + */ 764 + smp_mb__after_atomic(); 765 765 766 766 if (!urb->dev || !urb->ep) 767 767 return;
+1 -1
drivers/usb/dwc2/gadget.c
··· 5097 5097 hsotg->gadget.speed = USB_SPEED_UNKNOWN; 5098 5098 spin_unlock_irqrestore(&hsotg->lock, flags); 5099 5099 5100 - for (ep = 0; ep < hsotg->num_of_eps; ep++) { 5100 + for (ep = 1; ep < hsotg->num_of_eps; ep++) { 5101 5101 if (hsotg->eps_in[ep]) 5102 5102 dwc2_hsotg_ep_disable_lock(&hsotg->eps_in[ep]->ep); 5103 5103 if (hsotg->eps_out[ep])
+18 -5
drivers/usb/dwc3/dwc3-xilinx.c
··· 102 102 int ret; 103 103 u32 reg; 104 104 105 - usb3_phy = devm_phy_get(dev, "usb3-phy"); 106 - if (PTR_ERR(usb3_phy) == -EPROBE_DEFER) { 107 - ret = -EPROBE_DEFER; 105 + usb3_phy = devm_phy_optional_get(dev, "usb3-phy"); 106 + if (IS_ERR(usb3_phy)) { 107 + ret = PTR_ERR(usb3_phy); 108 + dev_err_probe(dev, ret, 109 + "failed to get USB3 PHY\n"); 108 110 goto err; 109 - } else if (IS_ERR(usb3_phy)) { 110 - usb3_phy = NULL; 111 111 } 112 + 113 + /* 114 + * The following core resets are not required unless a USB3 PHY 115 + * is used, and the subsequent register settings are not required 116 + * unless a core reset is performed (they should be set properly 117 + * by the first-stage boot loader, but may be reverted by a core 118 + * reset). They may also break the configuration if USB3 is actually 119 + * in use but the usb3-phy entry is missing from the device tree. 120 + * Therefore, skip these operations in this case. 121 + */ 122 + if (!usb3_phy) 123 + goto skip_usb3_phy; 112 124 113 125 crst = devm_reset_control_get_exclusive(dev, "usb_crst"); 114 126 if (IS_ERR(crst)) { ··· 200 188 goto err; 201 189 } 202 190 191 + skip_usb3_phy: 203 192 /* 204 193 * This routes the USB DMA traffic to go through FPD path instead 205 194 * of reaching DDR directly. This traffic routing is needed to
+1
drivers/usb/gadget/function/f_sourcesink.c
··· 584 584 585 585 if (is_iso) { 586 586 switch (speed) { 587 + case USB_SPEED_SUPER_PLUS: 587 588 case USB_SPEED_SUPER: 588 589 size = ss->isoc_maxpacket * 589 590 (ss->isoc_mult + 1) *
+1 -1
drivers/usb/gadget/udc/at91_udc.c
··· 1895 1895 at91_vbus_irq, 0, driver_name, udc); 1896 1896 if (retval) { 1897 1897 DBG("request vbus irq %d failed\n", 1898 - udc->board.vbus_pin); 1898 + desc_to_gpio(udc->board.vbus_pin)); 1899 1899 goto err_unprepare_iclk; 1900 1900 } 1901 1901 }
+3
drivers/usb/host/xhci-plat.c
··· 437 437 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 438 438 int ret; 439 439 440 + if (pm_runtime_suspended(dev)) 441 + pm_runtime_resume(dev); 442 + 440 443 ret = xhci_priv_suspend_quirk(hcd); 441 444 if (ret) 442 445 return ret;
+10
drivers/usb/storage/unusual_devs.h
··· 2301 2301 USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init, 2302 2302 US_FL_SCM_MULT_TARG ), 2303 2303 2304 + /* 2305 + * Reported by DocMAX <mail@vacharakis.de> 2306 + * and Thomas Weißschuh <linux@weissschuh.net> 2307 + */ 2308 + UNUSUAL_DEV( 0x2109, 0x0715, 0x9999, 0x9999, 2309 + "VIA Labs, Inc.", 2310 + "VL817 SATA Bridge", 2311 + USB_SC_DEVICE, USB_PR_DEVICE, NULL, 2312 + US_FL_IGNORE_UAS), 2313 + 2304 2314 UNUSUAL_DEV( 0x2116, 0x0320, 0x0001, 0x0001, 2305 2315 "ST", 2306 2316 "2A",
+7 -1
drivers/usb/typec/port-mapper.c
··· 56 56 { 57 57 struct each_port_arg arg = { .port = con, .match = NULL }; 58 58 59 + if (!has_acpi_companion(&con->dev)) 60 + return 0; 61 + 59 62 bus_for_each_dev(&acpi_bus_type, NULL, &arg, typec_port_match); 63 + if (!arg.match) 64 + return 0; 60 65 61 66 /* 62 67 * REVISIT: Now each connector can have only a single component master. ··· 79 74 80 75 void typec_unlink_ports(struct typec_port *con) 81 76 { 82 - component_master_del(&con->dev, &typec_aggregate_ops); 77 + if (has_acpi_companion(&con->dev)) 78 + component_master_del(&con->dev, &typec_aggregate_ops); 83 79 }
+26
drivers/usb/typec/tcpm/tcpci.c
··· 75 75 static int tcpci_set_cc(struct tcpc_dev *tcpc, enum typec_cc_status cc) 76 76 { 77 77 struct tcpci *tcpci = tcpc_to_tcpci(tcpc); 78 + bool vconn_pres; 79 + enum typec_cc_polarity polarity = TYPEC_POLARITY_CC1; 78 80 unsigned int reg; 79 81 int ret; 82 + 83 + ret = regmap_read(tcpci->regmap, TCPC_POWER_STATUS, &reg); 84 + if (ret < 0) 85 + return ret; 86 + 87 + vconn_pres = !!(reg & TCPC_POWER_STATUS_VCONN_PRES); 88 + if (vconn_pres) { 89 + ret = regmap_read(tcpci->regmap, TCPC_TCPC_CTRL, &reg); 90 + if (ret < 0) 91 + return ret; 92 + 93 + if (reg & TCPC_TCPC_CTRL_ORIENTATION) 94 + polarity = TYPEC_POLARITY_CC2; 95 + } 80 96 81 97 switch (cc) { 82 98 case TYPEC_CC_RA: ··· 126 110 reg = (TCPC_ROLE_CTRL_CC_OPEN << TCPC_ROLE_CTRL_CC1_SHIFT) | 127 111 (TCPC_ROLE_CTRL_CC_OPEN << TCPC_ROLE_CTRL_CC2_SHIFT); 128 112 break; 113 + } 114 + 115 + if (vconn_pres) { 116 + if (polarity == TYPEC_POLARITY_CC2) { 117 + reg &= ~(TCPC_ROLE_CTRL_CC1_MASK << TCPC_ROLE_CTRL_CC1_SHIFT); 118 + reg |= (TCPC_ROLE_CTRL_CC_OPEN << TCPC_ROLE_CTRL_CC1_SHIFT); 119 + } else { 120 + reg &= ~(TCPC_ROLE_CTRL_CC2_MASK << TCPC_ROLE_CTRL_CC2_SHIFT); 121 + reg |= (TCPC_ROLE_CTRL_CC_OPEN << TCPC_ROLE_CTRL_CC2_SHIFT); 122 + } 129 123 } 130 124 131 125 ret = regmap_write(tcpci->regmap, TCPC_ROLE_CTRL, reg);
+1
drivers/usb/typec/tcpm/tcpci.h
··· 98 98 #define TCPC_POWER_STATUS_SOURCING_VBUS BIT(4) 99 99 #define TCPC_POWER_STATUS_VBUS_DET BIT(3) 100 100 #define TCPC_POWER_STATUS_VBUS_PRES BIT(2) 101 + #define TCPC_POWER_STATUS_VCONN_PRES BIT(1) 101 102 #define TCPC_POWER_STATUS_SINKING_VBUS BIT(0) 102 103 103 104 #define TCPC_FAULT_STATUS 0x1f
+6 -1
drivers/usb/typec/tcpm/tcpm.c
··· 5156 5156 case SNK_TRYWAIT_DEBOUNCE: 5157 5157 break; 5158 5158 case SNK_ATTACH_WAIT: 5159 - tcpm_set_state(port, SNK_UNATTACHED, 0); 5159 + case SNK_DEBOUNCED: 5160 + /* Do nothing, as TCPM is still waiting for vbus to reaach VSAFE5V to connect */ 5160 5161 break; 5161 5162 5162 5163 case SNK_NEGOTIATE_CAPABILITIES: ··· 5263 5262 case PR_SWAP_SNK_SRC_SINK_OFF: 5264 5263 case PR_SWAP_SNK_SRC_SOURCE_ON: 5265 5264 /* Do nothing, vsafe0v is expected during transition */ 5265 + break; 5266 + case SNK_ATTACH_WAIT: 5267 + case SNK_DEBOUNCED: 5268 + /*Do nothing, still waiting for VSAFE5V for connect */ 5266 5269 break; 5267 5270 default: 5268 5271 if (port->pwr_role == TYPEC_SINK && port->auto_vbus_discharge_enabled)
+1 -1
drivers/usb/typec/ucsi/ucsi_ccg.c
··· 325 325 if (status < 0) 326 326 return status; 327 327 328 - if (!data) 328 + if (!(data & DEV_INT)) 329 329 return 0; 330 330 331 331 status = ccg_write(uc, CCGX_RAB_INTR_REG, &data, sizeof(data));
+6
include/linux/usb/role.h
··· 92 92 static inline void usb_role_switch_put(struct usb_role_switch *sw) { } 93 93 94 94 static inline struct usb_role_switch * 95 + usb_role_switch_find_by_fwnode(const struct fwnode_handle *fwnode) 96 + { 97 + return NULL; 98 + } 99 + 100 + static inline struct usb_role_switch * 95 101 usb_role_switch_register(struct device *parent, 96 102 const struct usb_role_switch_desc *desc) 97 103 {