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

Pull USB/Thunderbolt fixes from Greg KH:
"Here are some small USB and Thunderbolt driver fixes for 5.9-rc5.

Nothing huge, just a number of bugfixes and new device ids for
problems reported:

- new USB serial driver ids

- bug fixes for syzbot reported problems

- typec driver fixes

- thunderbolt driver fixes

- revert of reported broken commit

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

* tag 'usb-5.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
usb: typec: intel_pmc_mux: Do not configure SBU and HSL Orientation in Alternate modes
usb: typec: intel_pmc_mux: Do not configure Altmode HPD High
usb: core: fix slab-out-of-bounds Read in read_descriptors
Revert "usb: dwc3: meson-g12a: fix shared reset control use"
usb: typec: ucsi: acpi: Check the _DEP dependencies
usb: typec: intel_pmc_mux: Un-register the USB role switch
usb: Fix out of sync data toggle if a configured device is reconfigured
USB: serial: option: support dynamic Quectel USB compositions
USB: serial: option: add support for SIM7070/SIM7080/SIM7090 modules
thunderbolt: Use maximum USB3 link rate when reclaiming if link is not up
thunderbolt: Disable ports that are not implemented
USB: serial: ftdi_sio: add IDs for Xsens Mti USB converter

+87 -81
+1
drivers/thunderbolt/switch.c
··· 684 if (res == -ENODEV) { 685 tb_dbg(port->sw->tb, " Port %d: not implemented\n", 686 port->port); 687 return 0; 688 } 689 return res;
··· 684 if (res == -ENODEV) { 685 tb_dbg(port->sw->tb, " Port %d: not implemented\n", 686 port->port); 687 + port->disabled = true; 688 return 0; 689 } 690 return res;
+1 -1
drivers/thunderbolt/tb.h
··· 186 * @cap_adap: Offset of the adapter specific capability (%0 if not present) 187 * @cap_usb4: Offset to the USB4 port capability (%0 if not present) 188 * @port: Port number on switch 189 - * @disabled: Disabled by eeprom 190 * @bonded: true if the port is bonded (two lanes combined as one) 191 * @dual_link_port: If the switch is connected using two ports, points 192 * to the other port.
··· 186 * @cap_adap: Offset of the adapter specific capability (%0 if not present) 187 * @cap_usb4: Offset to the USB4 port capability (%0 if not present) 188 * @port: Port number on switch 189 + * @disabled: Disabled by eeprom or enabled but not implemented 190 * @bonded: true if the port is bonded (two lanes combined as one) 191 * @dual_link_port: If the switch is connected using two ports, points 192 * to the other port.
+10 -2
drivers/thunderbolt/tunnel.c
··· 951 int ret, max_rate, allocate_up, allocate_down; 952 953 ret = usb4_usb3_port_actual_link_rate(tunnel->src_port); 954 - if (ret <= 0) { 955 - tb_tunnel_warn(tunnel, "tunnel is not up\n"); 956 return; 957 } 958 /* 959 * 90% of the max rate can be allocated for isochronous 960 * transfers.
··· 951 int ret, max_rate, allocate_up, allocate_down; 952 953 ret = usb4_usb3_port_actual_link_rate(tunnel->src_port); 954 + if (ret < 0) { 955 + tb_tunnel_warn(tunnel, "failed to read actual link rate\n"); 956 return; 957 + } else if (!ret) { 958 + /* Use maximum link rate if the link valid is not set */ 959 + ret = usb4_usb3_port_max_link_rate(tunnel->src_port); 960 + if (ret < 0) { 961 + tb_tunnel_warn(tunnel, "failed to read maximum link rate\n"); 962 + return; 963 + } 964 } 965 + 966 /* 967 * 90% of the max rate can be allocated for isochronous 968 * transfers.
+42 -49
drivers/usb/core/message.c
··· 1205 } 1206 } 1207 1208 /** 1209 * usb_disable_device - Disable all the endpoints for a USB device 1210 * @dev: the device whose endpoints are being disabled ··· 1246 void usb_disable_device(struct usb_device *dev, int skip_ep0) 1247 { 1248 int i; 1249 - struct usb_hcd *hcd = bus_to_hcd(dev->bus); 1250 1251 /* getting rid of interfaces will disconnect 1252 * any drivers bound to them (a key side effect) ··· 1291 1292 dev_dbg(&dev->dev, "%s nuking %s URBs\n", __func__, 1293 skip_ep0 ? "non-ep0" : "all"); 1294 - if (hcd->driver->check_bandwidth) { 1295 - /* First pass: Cancel URBs, leave endpoint pointers intact. */ 1296 - for (i = skip_ep0; i < 16; ++i) { 1297 - usb_disable_endpoint(dev, i, false); 1298 - usb_disable_endpoint(dev, i + USB_DIR_IN, false); 1299 - } 1300 - /* Remove endpoints from the host controller internal state */ 1301 - mutex_lock(hcd->bandwidth_mutex); 1302 - usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL); 1303 - mutex_unlock(hcd->bandwidth_mutex); 1304 - /* Second pass: remove endpoint pointers */ 1305 - } 1306 - for (i = skip_ep0; i < 16; ++i) { 1307 - usb_disable_endpoint(dev, i, true); 1308 - usb_disable_endpoint(dev, i + USB_DIR_IN, true); 1309 - } 1310 } 1311 1312 /** ··· 1535 * The caller must own the device lock. 1536 * 1537 * Return: Zero on success, else a negative error code. 1538 */ 1539 int usb_reset_configuration(struct usb_device *dev) 1540 { ··· 1553 * calls during probe() are fine 1554 */ 1555 1556 - for (i = 1; i < 16; ++i) { 1557 - usb_disable_endpoint(dev, i, true); 1558 - usb_disable_endpoint(dev, i + USB_DIR_IN, true); 1559 - } 1560 1561 config = dev->actconfig; 1562 retval = 0; ··· 1566 mutex_unlock(hcd->bandwidth_mutex); 1567 return -ENOMEM; 1568 } 1569 - /* Make sure we have enough bandwidth for each alternate setting 0 */ 1570 - for (i = 0; i < config->desc.bNumInterfaces; i++) { 1571 - struct usb_interface *intf = config->interface[i]; 1572 - struct usb_host_interface *alt; 1573 1574 - alt = usb_altnum_to_altsetting(intf, 0); 1575 - if (!alt) 1576 - alt = &intf->altsetting[0]; 1577 - if (alt != intf->cur_altsetting) 1578 - retval = usb_hcd_alloc_bandwidth(dev, NULL, 1579 - intf->cur_altsetting, alt); 1580 - if (retval < 0) 1581 - break; 1582 - } 1583 - /* If not, reinstate the old alternate settings */ 1584 if (retval < 0) { 1585 - reset_old_alts: 1586 - for (i--; i >= 0; i--) { 1587 - struct usb_interface *intf = config->interface[i]; 1588 - struct usb_host_interface *alt; 1589 - 1590 - alt = usb_altnum_to_altsetting(intf, 0); 1591 - if (!alt) 1592 - alt = &intf->altsetting[0]; 1593 - if (alt != intf->cur_altsetting) 1594 - usb_hcd_alloc_bandwidth(dev, NULL, 1595 - alt, intf->cur_altsetting); 1596 - } 1597 usb_enable_lpm(dev); 1598 mutex_unlock(hcd->bandwidth_mutex); 1599 return retval; ··· 1578 USB_REQ_SET_CONFIGURATION, 0, 1579 config->desc.bConfigurationValue, 0, 1580 NULL, 0, USB_CTRL_SET_TIMEOUT); 1581 - if (retval < 0) 1582 - goto reset_old_alts; 1583 mutex_unlock(hcd->bandwidth_mutex); 1584 1585 /* re-init hc/hcd interface/endpoint state */
··· 1205 } 1206 } 1207 1208 + /* 1209 + * usb_disable_device_endpoints -- Disable all endpoints for a device 1210 + * @dev: the device whose endpoints are being disabled 1211 + * @skip_ep0: 0 to disable endpoint 0, 1 to skip it. 1212 + */ 1213 + static void usb_disable_device_endpoints(struct usb_device *dev, int skip_ep0) 1214 + { 1215 + struct usb_hcd *hcd = bus_to_hcd(dev->bus); 1216 + int i; 1217 + 1218 + if (hcd->driver->check_bandwidth) { 1219 + /* First pass: Cancel URBs, leave endpoint pointers intact. */ 1220 + for (i = skip_ep0; i < 16; ++i) { 1221 + usb_disable_endpoint(dev, i, false); 1222 + usb_disable_endpoint(dev, i + USB_DIR_IN, false); 1223 + } 1224 + /* Remove endpoints from the host controller internal state */ 1225 + mutex_lock(hcd->bandwidth_mutex); 1226 + usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL); 1227 + mutex_unlock(hcd->bandwidth_mutex); 1228 + } 1229 + /* Second pass: remove endpoint pointers */ 1230 + for (i = skip_ep0; i < 16; ++i) { 1231 + usb_disable_endpoint(dev, i, true); 1232 + usb_disable_endpoint(dev, i + USB_DIR_IN, true); 1233 + } 1234 + } 1235 + 1236 /** 1237 * usb_disable_device - Disable all the endpoints for a USB device 1238 * @dev: the device whose endpoints are being disabled ··· 1218 void usb_disable_device(struct usb_device *dev, int skip_ep0) 1219 { 1220 int i; 1221 1222 /* getting rid of interfaces will disconnect 1223 * any drivers bound to them (a key side effect) ··· 1264 1265 dev_dbg(&dev->dev, "%s nuking %s URBs\n", __func__, 1266 skip_ep0 ? "non-ep0" : "all"); 1267 + 1268 + usb_disable_device_endpoints(dev, skip_ep0); 1269 } 1270 1271 /** ··· 1522 * The caller must own the device lock. 1523 * 1524 * Return: Zero on success, else a negative error code. 1525 + * 1526 + * If this routine fails the device will probably be in an unusable state 1527 + * with endpoints disabled, and interfaces only partially enabled. 1528 */ 1529 int usb_reset_configuration(struct usb_device *dev) 1530 { ··· 1537 * calls during probe() are fine 1538 */ 1539 1540 + usb_disable_device_endpoints(dev, 1); /* skip ep0*/ 1541 1542 config = dev->actconfig; 1543 retval = 0; ··· 1553 mutex_unlock(hcd->bandwidth_mutex); 1554 return -ENOMEM; 1555 } 1556 1557 + /* xHCI adds all endpoints in usb_hcd_alloc_bandwidth */ 1558 + retval = usb_hcd_alloc_bandwidth(dev, config, NULL, NULL); 1559 if (retval < 0) { 1560 usb_enable_lpm(dev); 1561 mutex_unlock(hcd->bandwidth_mutex); 1562 return retval; ··· 1589 USB_REQ_SET_CONFIGURATION, 0, 1590 config->desc.bConfigurationValue, 0, 1591 NULL, 0, USB_CTRL_SET_TIMEOUT); 1592 + if (retval < 0) { 1593 + usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL); 1594 + usb_enable_lpm(dev); 1595 + mutex_unlock(hcd->bandwidth_mutex); 1596 + return retval; 1597 + } 1598 mutex_unlock(hcd->bandwidth_mutex); 1599 1600 /* re-init hc/hcd interface/endpoint state */
+5
drivers/usb/core/sysfs.c
··· 889 size_t srclen, n; 890 int cfgno; 891 void *src; 892 893 /* The binary attribute begins with the device descriptor. 894 * Following that are the raw descriptor entries for all the 895 * configurations (config plus subsidiary descriptors). ··· 918 off -= srclen; 919 } 920 } 921 return count - nleft; 922 } 923
··· 889 size_t srclen, n; 890 int cfgno; 891 void *src; 892 + int retval; 893 894 + retval = usb_lock_device_interruptible(udev); 895 + if (retval < 0) 896 + return -EINTR; 897 /* The binary attribute begins with the device descriptor. 898 * Following that are the raw descriptor entries for all the 899 * configurations (config plus subsidiary descriptors). ··· 914 off -= srclen; 915 } 916 } 917 + usb_unlock_device(udev); 918 return count - nleft; 919 } 920
+6 -9
drivers/usb/dwc3/dwc3-meson-g12a.c
··· 737 goto err_disable_clks; 738 } 739 740 - ret = reset_control_deassert(priv->reset); 741 if (ret) 742 - goto err_assert_reset; 743 744 ret = dwc3_meson_g12a_get_phys(priv); 745 if (ret) 746 - goto err_assert_reset; 747 748 ret = priv->drvdata->setup_regmaps(priv, base); 749 if (ret) ··· 752 if (priv->vbus) { 753 ret = regulator_enable(priv->vbus); 754 if (ret) 755 - goto err_assert_reset; 756 } 757 758 /* Get dr_mode */ ··· 765 766 ret = priv->drvdata->usb_init(priv); 767 if (ret) 768 - goto err_assert_reset; 769 770 /* Init PHYs */ 771 for (i = 0 ; i < PHY_COUNT ; ++i) { 772 ret = phy_init(priv->phys[i]); 773 if (ret) 774 - goto err_assert_reset; 775 } 776 777 /* Set PHY Power */ ··· 808 err_phys_exit: 809 for (i = 0 ; i < PHY_COUNT ; ++i) 810 phy_exit(priv->phys[i]); 811 - 812 - err_assert_reset: 813 - reset_control_assert(priv->reset); 814 815 err_disable_clks: 816 clk_bulk_disable_unprepare(priv->drvdata->num_clks,
··· 737 goto err_disable_clks; 738 } 739 740 + ret = reset_control_reset(priv->reset); 741 if (ret) 742 + goto err_disable_clks; 743 744 ret = dwc3_meson_g12a_get_phys(priv); 745 if (ret) 746 + goto err_disable_clks; 747 748 ret = priv->drvdata->setup_regmaps(priv, base); 749 if (ret) ··· 752 if (priv->vbus) { 753 ret = regulator_enable(priv->vbus); 754 if (ret) 755 + goto err_disable_clks; 756 } 757 758 /* Get dr_mode */ ··· 765 766 ret = priv->drvdata->usb_init(priv); 767 if (ret) 768 + goto err_disable_clks; 769 770 /* Init PHYs */ 771 for (i = 0 ; i < PHY_COUNT ; ++i) { 772 ret = phy_init(priv->phys[i]); 773 if (ret) 774 + goto err_disable_clks; 775 } 776 777 /* Set PHY Power */ ··· 808 err_phys_exit: 809 for (i = 0 ; i < PHY_COUNT ; ++i) 810 phy_exit(priv->phys[i]); 811 812 err_disable_clks: 813 clk_bulk_disable_unprepare(priv->drvdata->num_clks,
+1
drivers/usb/serial/ftdi_sio.c
··· 713 { USB_DEVICE(XSENS_VID, XSENS_AWINDA_STATION_PID) }, 714 { USB_DEVICE(XSENS_VID, XSENS_CONVERTER_PID) }, 715 { USB_DEVICE(XSENS_VID, XSENS_MTDEVBOARD_PID) }, 716 { USB_DEVICE(XSENS_VID, XSENS_MTW_PID) }, 717 { USB_DEVICE(FTDI_VID, FTDI_OMNI1509) }, 718 { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) },
··· 713 { USB_DEVICE(XSENS_VID, XSENS_AWINDA_STATION_PID) }, 714 { USB_DEVICE(XSENS_VID, XSENS_CONVERTER_PID) }, 715 { USB_DEVICE(XSENS_VID, XSENS_MTDEVBOARD_PID) }, 716 + { USB_DEVICE(XSENS_VID, XSENS_MTIUSBCONVERTER_PID) }, 717 { USB_DEVICE(XSENS_VID, XSENS_MTW_PID) }, 718 { USB_DEVICE(FTDI_VID, FTDI_OMNI1509) }, 719 { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) },
+1
drivers/usb/serial/ftdi_sio_ids.h
··· 160 #define XSENS_AWINDA_DONGLE_PID 0x0102 161 #define XSENS_MTW_PID 0x0200 /* Xsens MTw */ 162 #define XSENS_MTDEVBOARD_PID 0x0300 /* Motion Tracker Development Board */ 163 #define XSENS_CONVERTER_PID 0xD00D /* Xsens USB-serial converter */ 164 165 /* Xsens devices using FTDI VID */
··· 160 #define XSENS_AWINDA_DONGLE_PID 0x0102 161 #define XSENS_MTW_PID 0x0200 /* Xsens MTw */ 162 #define XSENS_MTDEVBOARD_PID 0x0300 /* Motion Tracker Development Board */ 163 + #define XSENS_MTIUSBCONVERTER_PID 0x0301 /* MTi USB converter */ 164 #define XSENS_CONVERTER_PID 0xD00D /* Xsens USB-serial converter */ 165 166 /* Xsens devices using FTDI VID */
+14 -8
drivers/usb/serial/option.c
··· 1094 { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R410M), 1095 .driver_info = RSVD(1) | RSVD(3) }, 1096 /* Quectel products using Quectel vendor ID */ 1097 - { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21), 1098 - .driver_info = RSVD(4) }, 1099 - { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25), 1100 - .driver_info = RSVD(4) }, 1101 - { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95), 1102 - .driver_info = RSVD(4) }, 1103 - { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), 1104 - .driver_info = RSVD(4) }, 1105 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff), 1106 .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 }, 1107 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) }, ··· 1823 { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9003, 0xff) }, /* Simcom SIM7500/SIM7600 MBIM mode */ 1824 { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9011, 0xff), /* Simcom SIM7500/SIM7600 RNDIS mode */ 1825 .driver_info = RSVD(7) }, 1826 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200), 1827 .driver_info = NCTRL(0) | NCTRL(1) | RSVD(4) }, 1828 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D),
··· 1094 { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R410M), 1095 .driver_info = RSVD(1) | RSVD(3) }, 1096 /* Quectel products using Quectel vendor ID */ 1097 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21, 0xff, 0xff, 0xff), 1098 + .driver_info = NUMEP2 }, 1099 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21, 0xff, 0, 0) }, 1100 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25, 0xff, 0xff, 0xff), 1101 + .driver_info = NUMEP2 }, 1102 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25, 0xff, 0, 0) }, 1103 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0xff, 0xff), 1104 + .driver_info = NUMEP2 }, 1105 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0, 0) }, 1106 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96, 0xff, 0xff, 0xff), 1107 + .driver_info = NUMEP2 }, 1108 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96, 0xff, 0, 0) }, 1109 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff), 1110 .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 }, 1111 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) }, ··· 1819 { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9003, 0xff) }, /* Simcom SIM7500/SIM7600 MBIM mode */ 1820 { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9011, 0xff), /* Simcom SIM7500/SIM7600 RNDIS mode */ 1821 .driver_info = RSVD(7) }, 1822 + { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9205, 0xff) }, /* Simcom SIM7070/SIM7080/SIM7090 AT+ECM mode */ 1823 + { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9206, 0xff) }, /* Simcom SIM7070/SIM7080/SIM7090 AT-only mode */ 1824 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200), 1825 .driver_info = NCTRL(0) | NCTRL(1) | RSVD(4) }, 1826 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D),
+2 -12
drivers/usb/typec/mux/intel_pmc_mux.c
··· 61 62 #define PMC_USB_ALTMODE_ORI_SHIFT 1 63 #define PMC_USB_ALTMODE_UFP_SHIFT 3 64 - #define PMC_USB_ALTMODE_ORI_AUX_SHIFT 4 65 - #define PMC_USB_ALTMODE_ORI_HSL_SHIFT 5 66 67 /* DP specific Mode Data bits */ 68 #define PMC_USB_ALTMODE_DP_MODE_SHIFT 8 69 70 /* TBT specific Mode Data bits */ 71 - #define PMC_USB_ALTMODE_HPD_HIGH BIT(14) 72 #define PMC_USB_ALTMODE_TBT_TYPE BIT(17) 73 #define PMC_USB_ALTMODE_CABLE_TYPE BIT(18) 74 #define PMC_USB_ALTMODE_ACTIVE_LINK BIT(20) ··· 176 req.mode_data = (port->orientation - 1) << PMC_USB_ALTMODE_ORI_SHIFT; 177 req.mode_data |= (port->role - 1) << PMC_USB_ALTMODE_UFP_SHIFT; 178 179 - req.mode_data |= sbu_orientation(port) << PMC_USB_ALTMODE_ORI_AUX_SHIFT; 180 - req.mode_data |= hsl_orientation(port) << PMC_USB_ALTMODE_ORI_HSL_SHIFT; 181 - 182 req.mode_data |= (state->mode - TYPEC_STATE_MODAL) << 183 PMC_USB_ALTMODE_DP_MODE_SHIFT; 184 - 185 - if (data->status & DP_STATUS_HPD_STATE) 186 - req.mode_data |= PMC_USB_ALTMODE_HPD_HIGH; 187 188 ret = pmc_usb_command(port, (void *)&req, sizeof(req)); 189 if (ret) ··· 202 203 req.mode_data = (port->orientation - 1) << PMC_USB_ALTMODE_ORI_SHIFT; 204 req.mode_data |= (port->role - 1) << PMC_USB_ALTMODE_UFP_SHIFT; 205 - 206 - req.mode_data |= sbu_orientation(port) << PMC_USB_ALTMODE_ORI_AUX_SHIFT; 207 - req.mode_data |= hsl_orientation(port) << PMC_USB_ALTMODE_ORI_HSL_SHIFT; 208 209 if (TBT_ADAPTER(data->device_mode) == TBT_ADAPTER_TBT3) 210 req.mode_data |= PMC_USB_ALTMODE_TBT_TYPE; ··· 485 for (i = 0; i < pmc->num_ports; i++) { 486 typec_switch_unregister(pmc->port[i].typec_sw); 487 typec_mux_unregister(pmc->port[i].typec_mux); 488 } 489 490 return ret; ··· 499 for (i = 0; i < pmc->num_ports; i++) { 500 typec_switch_unregister(pmc->port[i].typec_sw); 501 typec_mux_unregister(pmc->port[i].typec_mux); 502 } 503 504 return 0;
··· 61 62 #define PMC_USB_ALTMODE_ORI_SHIFT 1 63 #define PMC_USB_ALTMODE_UFP_SHIFT 3 64 65 /* DP specific Mode Data bits */ 66 #define PMC_USB_ALTMODE_DP_MODE_SHIFT 8 67 68 /* TBT specific Mode Data bits */ 69 #define PMC_USB_ALTMODE_TBT_TYPE BIT(17) 70 #define PMC_USB_ALTMODE_CABLE_TYPE BIT(18) 71 #define PMC_USB_ALTMODE_ACTIVE_LINK BIT(20) ··· 179 req.mode_data = (port->orientation - 1) << PMC_USB_ALTMODE_ORI_SHIFT; 180 req.mode_data |= (port->role - 1) << PMC_USB_ALTMODE_UFP_SHIFT; 181 182 req.mode_data |= (state->mode - TYPEC_STATE_MODAL) << 183 PMC_USB_ALTMODE_DP_MODE_SHIFT; 184 185 ret = pmc_usb_command(port, (void *)&req, sizeof(req)); 186 if (ret) ··· 211 212 req.mode_data = (port->orientation - 1) << PMC_USB_ALTMODE_ORI_SHIFT; 213 req.mode_data |= (port->role - 1) << PMC_USB_ALTMODE_UFP_SHIFT; 214 215 if (TBT_ADAPTER(data->device_mode) == TBT_ADAPTER_TBT3) 216 req.mode_data |= PMC_USB_ALTMODE_TBT_TYPE; ··· 497 for (i = 0; i < pmc->num_ports; i++) { 498 typec_switch_unregister(pmc->port[i].typec_sw); 499 typec_mux_unregister(pmc->port[i].typec_mux); 500 + usb_role_switch_unregister(pmc->port[i].usb_sw); 501 } 502 503 return ret; ··· 510 for (i = 0; i < pmc->num_ports; i++) { 511 typec_switch_unregister(pmc->port[i].typec_sw); 512 typec_mux_unregister(pmc->port[i].typec_mux); 513 + usb_role_switch_unregister(pmc->port[i].usb_sw); 514 } 515 516 return 0;
+4
drivers/usb/typec/ucsi/ucsi_acpi.c
··· 112 113 static int ucsi_acpi_probe(struct platform_device *pdev) 114 { 115 struct ucsi_acpi *ua; 116 struct resource *res; 117 acpi_status status; 118 int ret; 119 120 ua = devm_kzalloc(&pdev->dev, sizeof(*ua), GFP_KERNEL); 121 if (!ua)
··· 112 113 static int ucsi_acpi_probe(struct platform_device *pdev) 114 { 115 + struct acpi_device *adev = ACPI_COMPANION(&pdev->dev); 116 struct ucsi_acpi *ua; 117 struct resource *res; 118 acpi_status status; 119 int ret; 120 + 121 + if (adev->dep_unmet) 122 + return -EPROBE_DEFER; 123 124 ua = devm_kzalloc(&pdev->dev, sizeof(*ua), GFP_KERNEL); 125 if (!ua)