Merge tag 'usb-6.4-rc7' 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 and new device
ids for 6.4-rc7 to resolve some reported problems. Included in here
are:

- new USB serial device ids

- USB gadget core fixes for long-dissussed problems

- dwc3 bugfixes for reported issues.

- typec driver fixes

- thunderbolt driver fixes

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

* tag 'usb-6.4-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
usb: gadget: udc: core: Prevent soft_connect_store() race
usb: gadget: udc: core: Offload usb_udc_vbus_handler processing
usb: typec: Fix fast_role_swap_current show function
usb: typec: ucsi: Fix command cancellation
USB: dwc3: fix use-after-free on core driver unbind
USB: dwc3: qcom: fix NULL-deref on suspend
usb: dwc3: gadget: Reset num TRBs before giving back the request
usb: gadget: udc: renesas_usb3: Fix RZ/V2M {modprobe,bind} error
USB: serial: option: add Quectel EM061KGL series
thunderbolt: Mask ring interrupt on Intel hardware as well
thunderbolt: Do not touch CL state configuration during discovery
thunderbolt: Increase DisplayPort Connection Manager handshake timeout
thunderbolt: dma_test: Use correct value for absent rings when creating paths

Changed files
+198 -70
drivers
thunderbolt
usb
dwc3
gadget
serial
typec
ucsi
+4 -4
drivers/thunderbolt/dma_test.c
··· 192 192 } 193 193 194 194 ret = tb_xdomain_enable_paths(dt->xd, dt->tx_hopid, 195 - dt->tx_ring ? dt->tx_ring->hop : 0, 195 + dt->tx_ring ? dt->tx_ring->hop : -1, 196 196 dt->rx_hopid, 197 - dt->rx_ring ? dt->rx_ring->hop : 0); 197 + dt->rx_ring ? dt->rx_ring->hop : -1); 198 198 if (ret) { 199 199 dma_test_free_rings(dt); 200 200 return ret; ··· 218 218 tb_ring_stop(dt->tx_ring); 219 219 220 220 ret = tb_xdomain_disable_paths(dt->xd, dt->tx_hopid, 221 - dt->tx_ring ? dt->tx_ring->hop : 0, 221 + dt->tx_ring ? dt->tx_ring->hop : -1, 222 222 dt->rx_hopid, 223 - dt->rx_ring ? dt->rx_ring->hop : 0); 223 + dt->rx_ring ? dt->rx_ring->hop : -1); 224 224 if (ret) 225 225 dev_warn(&dt->svc->dev, "failed to disable DMA paths\n"); 226 226
+8 -3
drivers/thunderbolt/nhi.c
··· 56 56 57 57 static void nhi_mask_interrupt(struct tb_nhi *nhi, int mask, int ring) 58 58 { 59 - if (nhi->quirks & QUIRK_AUTO_CLEAR_INT) 60 - return; 61 - iowrite32(mask, nhi->iobase + REG_RING_INTERRUPT_MASK_CLEAR_BASE + ring); 59 + if (nhi->quirks & QUIRK_AUTO_CLEAR_INT) { 60 + u32 val; 61 + 62 + val = ioread32(nhi->iobase + REG_RING_INTERRUPT_BASE + ring); 63 + iowrite32(val & ~mask, nhi->iobase + REG_RING_INTERRUPT_BASE + ring); 64 + } else { 65 + iowrite32(mask, nhi->iobase + REG_RING_INTERRUPT_MASK_CLEAR_BASE + ring); 66 + } 62 67 } 63 68 64 69 static void nhi_clear_interrupt(struct tb_nhi *nhi, int ring)
+12 -5
drivers/thunderbolt/tb.c
··· 737 737 { 738 738 struct tb_cm *tcm = tb_priv(port->sw->tb); 739 739 struct tb_port *upstream_port; 740 + bool discovery = false; 740 741 struct tb_switch *sw; 741 742 int ret; 742 743 ··· 805 804 * tunnels and know which switches were authorized already by 806 805 * the boot firmware. 807 806 */ 808 - if (!tcm->hotplug_active) 807 + if (!tcm->hotplug_active) { 809 808 dev_set_uevent_suppress(&sw->dev, true); 809 + discovery = true; 810 + } 810 811 811 812 /* 812 813 * At the moment Thunderbolt 2 and beyond (devices with LC) we ··· 838 835 * CL0s and CL1 are enabled and supported together. 839 836 * Silently ignore CLx enabling in case CLx is not supported. 840 837 */ 841 - ret = tb_switch_enable_clx(sw, TB_CL1); 842 - if (ret && ret != -EOPNOTSUPP) 843 - tb_sw_warn(sw, "failed to enable %s on upstream port\n", 844 - tb_switch_clx_name(TB_CL1)); 838 + if (discovery) { 839 + tb_sw_dbg(sw, "discovery, not touching CL states\n"); 840 + } else { 841 + ret = tb_switch_enable_clx(sw, TB_CL1); 842 + if (ret && ret != -EOPNOTSUPP) 843 + tb_sw_warn(sw, "failed to enable %s on upstream port\n", 844 + tb_switch_clx_name(TB_CL1)); 845 + } 845 846 846 847 if (tb_switch_is_clx_enabled(sw, TB_CL1)) 847 848 /*
+1 -1
drivers/thunderbolt/tunnel.c
··· 526 526 * Perform connection manager handshake between IN and OUT ports 527 527 * before capabilities exchange can take place. 528 528 */ 529 - ret = tb_dp_cm_handshake(in, out, 1500); 529 + ret = tb_dp_cm_handshake(in, out, 3000); 530 530 if (ret) 531 531 return ret; 532 532
+5
drivers/usb/dwc3/core.c
··· 1929 1929 pm_runtime_disable(&pdev->dev); 1930 1930 pm_runtime_dont_use_autosuspend(&pdev->dev); 1931 1931 pm_runtime_put_noidle(&pdev->dev); 1932 + /* 1933 + * HACK: Clear the driver data, which is currently accessed by parent 1934 + * glue drivers, before allowing the parent to suspend. 1935 + */ 1936 + platform_set_drvdata(pdev, NULL); 1932 1937 pm_runtime_set_suspended(&pdev->dev); 1933 1938 1934 1939 dwc3_free_event_buffers(dwc);
+10 -1
drivers/usb/dwc3/dwc3-qcom.c
··· 308 308 /* Only usable in contexts where the role can not change. */ 309 309 static bool dwc3_qcom_is_host(struct dwc3_qcom *qcom) 310 310 { 311 - struct dwc3 *dwc = platform_get_drvdata(qcom->dwc3); 311 + struct dwc3 *dwc; 312 + 313 + /* 314 + * FIXME: Fix this layering violation. 315 + */ 316 + dwc = platform_get_drvdata(qcom->dwc3); 317 + 318 + /* Core driver may not have probed yet. */ 319 + if (!dwc) 320 + return false; 312 321 313 322 return dwc->xhci; 314 323 }
+1
drivers/usb/dwc3/gadget.c
··· 198 198 list_del(&req->list); 199 199 req->remaining = 0; 200 200 req->needs_extra_trb = false; 201 + req->num_trbs = 0; 201 202 202 203 if (req->request.status == -EINPROGRESS) 203 204 req->request.status = status;
+131 -49
drivers/usb/gadget/udc/core.c
··· 37 37 * @vbus: for udcs who care about vbus status, this value is real vbus status; 38 38 * for udcs who do not care about vbus status, this value is always true 39 39 * @started: the UDC's started state. True if the UDC had started. 40 + * @allow_connect: Indicates whether UDC is allowed to be pulled up. 41 + * Set/cleared by gadget_(un)bind_driver() after gadget driver is bound or 42 + * unbound. 43 + * @connect_lock: protects udc->started, gadget->connect, 44 + * gadget->allow_connect and gadget->deactivate. The routines 45 + * usb_gadget_connect_locked(), usb_gadget_disconnect_locked(), 46 + * usb_udc_connect_control_locked(), usb_gadget_udc_start_locked() and 47 + * usb_gadget_udc_stop_locked() are called with this lock held. 40 48 * 41 49 * This represents the internal data structure which is used by the UDC-class 42 50 * to hold information about udc driver and gadget together. ··· 56 48 struct list_head list; 57 49 bool vbus; 58 50 bool started; 51 + bool allow_connect; 52 + struct work_struct vbus_work; 53 + struct mutex connect_lock; 59 54 }; 60 55 61 56 static struct class *udc_class; ··· 698 687 } 699 688 EXPORT_SYMBOL_GPL(usb_gadget_vbus_disconnect); 700 689 701 - /** 702 - * usb_gadget_connect - software-controlled connect to USB host 703 - * @gadget:the peripheral being connected 704 - * 705 - * Enables the D+ (or potentially D-) pullup. The host will start 706 - * enumerating this gadget when the pullup is active and a VBUS session 707 - * is active (the link is powered). 708 - * 709 - * Returns zero on success, else negative errno. 710 - */ 711 - int usb_gadget_connect(struct usb_gadget *gadget) 690 + static int usb_gadget_connect_locked(struct usb_gadget *gadget) 691 + __must_hold(&gadget->udc->connect_lock) 712 692 { 713 693 int ret = 0; 714 694 ··· 708 706 goto out; 709 707 } 710 708 711 - if (gadget->deactivated) { 709 + if (gadget->deactivated || !gadget->udc->allow_connect || !gadget->udc->started) { 712 710 /* 713 - * If gadget is deactivated we only save new state. 714 - * Gadget will be connected automatically after activation. 711 + * If the gadget isn't usable (because it is deactivated, 712 + * unbound, or not yet started), we only save the new state. 713 + * The gadget will be connected automatically when it is 714 + * activated/bound/started. 715 715 */ 716 716 gadget->connected = true; 717 717 goto out; ··· 728 724 729 725 return ret; 730 726 } 731 - EXPORT_SYMBOL_GPL(usb_gadget_connect); 732 727 733 728 /** 734 - * usb_gadget_disconnect - software-controlled disconnect from USB host 735 - * @gadget:the peripheral being disconnected 729 + * usb_gadget_connect - software-controlled connect to USB host 730 + * @gadget:the peripheral being connected 736 731 * 737 - * Disables the D+ (or potentially D-) pullup, which the host may see 738 - * as a disconnect (when a VBUS session is active). Not all systems 739 - * support software pullup controls. 740 - * 741 - * Following a successful disconnect, invoke the ->disconnect() callback 742 - * for the current gadget driver so that UDC drivers don't need to. 732 + * Enables the D+ (or potentially D-) pullup. The host will start 733 + * enumerating this gadget when the pullup is active and a VBUS session 734 + * is active (the link is powered). 743 735 * 744 736 * Returns zero on success, else negative errno. 745 737 */ 746 - int usb_gadget_disconnect(struct usb_gadget *gadget) 738 + int usb_gadget_connect(struct usb_gadget *gadget) 739 + { 740 + int ret; 741 + 742 + mutex_lock(&gadget->udc->connect_lock); 743 + ret = usb_gadget_connect_locked(gadget); 744 + mutex_unlock(&gadget->udc->connect_lock); 745 + 746 + return ret; 747 + } 748 + EXPORT_SYMBOL_GPL(usb_gadget_connect); 749 + 750 + static int usb_gadget_disconnect_locked(struct usb_gadget *gadget) 751 + __must_hold(&gadget->udc->connect_lock) 747 752 { 748 753 int ret = 0; 749 754 ··· 764 751 if (!gadget->connected) 765 752 goto out; 766 753 767 - if (gadget->deactivated) { 754 + if (gadget->deactivated || !gadget->udc->started) { 768 755 /* 769 756 * If gadget is deactivated we only save new state. 770 757 * Gadget will stay disconnected after activation. ··· 787 774 788 775 return ret; 789 776 } 777 + 778 + /** 779 + * usb_gadget_disconnect - software-controlled disconnect from USB host 780 + * @gadget:the peripheral being disconnected 781 + * 782 + * Disables the D+ (or potentially D-) pullup, which the host may see 783 + * as a disconnect (when a VBUS session is active). Not all systems 784 + * support software pullup controls. 785 + * 786 + * Following a successful disconnect, invoke the ->disconnect() callback 787 + * for the current gadget driver so that UDC drivers don't need to. 788 + * 789 + * Returns zero on success, else negative errno. 790 + */ 791 + int usb_gadget_disconnect(struct usb_gadget *gadget) 792 + { 793 + int ret; 794 + 795 + mutex_lock(&gadget->udc->connect_lock); 796 + ret = usb_gadget_disconnect_locked(gadget); 797 + mutex_unlock(&gadget->udc->connect_lock); 798 + 799 + return ret; 800 + } 790 801 EXPORT_SYMBOL_GPL(usb_gadget_disconnect); 791 802 792 803 /** ··· 828 791 { 829 792 int ret = 0; 830 793 794 + mutex_lock(&gadget->udc->connect_lock); 831 795 if (gadget->deactivated) 832 - goto out; 796 + goto unlock; 833 797 834 798 if (gadget->connected) { 835 - ret = usb_gadget_disconnect(gadget); 799 + ret = usb_gadget_disconnect_locked(gadget); 836 800 if (ret) 837 - goto out; 801 + goto unlock; 838 802 839 803 /* 840 804 * If gadget was being connected before deactivation, we want ··· 845 807 } 846 808 gadget->deactivated = true; 847 809 848 - out: 810 + unlock: 811 + mutex_unlock(&gadget->udc->connect_lock); 849 812 trace_usb_gadget_deactivate(gadget, ret); 850 813 851 814 return ret; ··· 866 827 { 867 828 int ret = 0; 868 829 830 + mutex_lock(&gadget->udc->connect_lock); 869 831 if (!gadget->deactivated) 870 - goto out; 832 + goto unlock; 871 833 872 834 gadget->deactivated = false; 873 835 ··· 877 837 * while it was being deactivated, we call usb_gadget_connect(). 878 838 */ 879 839 if (gadget->connected) 880 - ret = usb_gadget_connect(gadget); 840 + ret = usb_gadget_connect_locked(gadget); 841 + mutex_unlock(&gadget->udc->connect_lock); 881 842 882 - out: 843 + unlock: 844 + mutex_unlock(&gadget->udc->connect_lock); 883 845 trace_usb_gadget_activate(gadget, ret); 884 846 885 847 return ret; ··· 1120 1078 1121 1079 /* ------------------------------------------------------------------------- */ 1122 1080 1123 - static void usb_udc_connect_control(struct usb_udc *udc) 1081 + /* Acquire connect_lock before calling this function. */ 1082 + static void usb_udc_connect_control_locked(struct usb_udc *udc) __must_hold(&udc->connect_lock) 1124 1083 { 1125 1084 if (udc->vbus) 1126 - usb_gadget_connect(udc->gadget); 1085 + usb_gadget_connect_locked(udc->gadget); 1127 1086 else 1128 - usb_gadget_disconnect(udc->gadget); 1087 + usb_gadget_disconnect_locked(udc->gadget); 1088 + } 1089 + 1090 + static void vbus_event_work(struct work_struct *work) 1091 + { 1092 + struct usb_udc *udc = container_of(work, struct usb_udc, vbus_work); 1093 + 1094 + mutex_lock(&udc->connect_lock); 1095 + usb_udc_connect_control_locked(udc); 1096 + mutex_unlock(&udc->connect_lock); 1129 1097 } 1130 1098 1131 1099 /** ··· 1146 1094 * 1147 1095 * The udc driver calls it when it wants to connect or disconnect gadget 1148 1096 * according to vbus status. 1097 + * 1098 + * This function can be invoked from interrupt context by irq handlers of 1099 + * the gadget drivers, however, usb_udc_connect_control() has to run in 1100 + * non-atomic context due to the following: 1101 + * a. Some of the gadget driver implementations expect the ->pullup 1102 + * callback to be invoked in non-atomic context. 1103 + * b. usb_gadget_disconnect() acquires udc_lock which is a mutex. 1104 + * Hence offload invocation of usb_udc_connect_control() to workqueue. 1149 1105 */ 1150 1106 void usb_udc_vbus_handler(struct usb_gadget *gadget, bool status) 1151 1107 { ··· 1161 1101 1162 1102 if (udc) { 1163 1103 udc->vbus = status; 1164 - usb_udc_connect_control(udc); 1104 + schedule_work(&udc->vbus_work); 1165 1105 } 1166 1106 } 1167 1107 EXPORT_SYMBOL_GPL(usb_udc_vbus_handler); ··· 1184 1124 EXPORT_SYMBOL_GPL(usb_gadget_udc_reset); 1185 1125 1186 1126 /** 1187 - * usb_gadget_udc_start - tells usb device controller to start up 1127 + * usb_gadget_udc_start_locked - tells usb device controller to start up 1188 1128 * @udc: The UDC to be started 1189 1129 * 1190 1130 * This call is issued by the UDC Class driver when it's about ··· 1195 1135 * necessary to have it powered on. 1196 1136 * 1197 1137 * Returns zero on success, else negative errno. 1138 + * 1139 + * Caller should acquire connect_lock before invoking this function. 1198 1140 */ 1199 - static inline int usb_gadget_udc_start(struct usb_udc *udc) 1141 + static inline int usb_gadget_udc_start_locked(struct usb_udc *udc) 1142 + __must_hold(&udc->connect_lock) 1200 1143 { 1201 1144 int ret; 1202 1145 ··· 1216 1153 } 1217 1154 1218 1155 /** 1219 - * usb_gadget_udc_stop - tells usb device controller we don't need it anymore 1156 + * usb_gadget_udc_stop_locked - tells usb device controller we don't need it anymore 1220 1157 * @udc: The UDC to be stopped 1221 1158 * 1222 1159 * This call is issued by the UDC Class driver after calling ··· 1225 1162 * The details are implementation specific, but it can go as 1226 1163 * far as powering off UDC completely and disable its data 1227 1164 * line pullups. 1165 + * 1166 + * Caller should acquire connect lock before invoking this function. 1228 1167 */ 1229 - static inline void usb_gadget_udc_stop(struct usb_udc *udc) 1168 + static inline void usb_gadget_udc_stop_locked(struct usb_udc *udc) 1169 + __must_hold(&udc->connect_lock) 1230 1170 { 1231 1171 if (!udc->started) { 1232 1172 dev_err(&udc->dev, "UDC had already stopped\n"); ··· 1388 1322 1389 1323 udc->gadget = gadget; 1390 1324 gadget->udc = udc; 1325 + mutex_init(&udc->connect_lock); 1391 1326 1392 1327 udc->started = false; 1393 1328 1394 1329 mutex_lock(&udc_lock); 1395 1330 list_add_tail(&udc->list, &udc_list); 1396 1331 mutex_unlock(&udc_lock); 1332 + INIT_WORK(&udc->vbus_work, vbus_event_work); 1397 1333 1398 1334 ret = device_add(&udc->dev); 1399 1335 if (ret) ··· 1527 1459 flush_work(&gadget->work); 1528 1460 device_del(&gadget->dev); 1529 1461 ida_free(&gadget_id_numbers, gadget->id_number); 1462 + cancel_work_sync(&udc->vbus_work); 1530 1463 device_unregister(&udc->dev); 1531 1464 } 1532 1465 EXPORT_SYMBOL_GPL(usb_del_gadget); ··· 1592 1523 if (ret) 1593 1524 goto err_bind; 1594 1525 1595 - ret = usb_gadget_udc_start(udc); 1596 - if (ret) 1526 + mutex_lock(&udc->connect_lock); 1527 + ret = usb_gadget_udc_start_locked(udc); 1528 + if (ret) { 1529 + mutex_unlock(&udc->connect_lock); 1597 1530 goto err_start; 1531 + } 1598 1532 usb_gadget_enable_async_callbacks(udc); 1599 - usb_udc_connect_control(udc); 1533 + udc->allow_connect = true; 1534 + usb_udc_connect_control_locked(udc); 1535 + mutex_unlock(&udc->connect_lock); 1600 1536 1601 1537 kobject_uevent(&udc->dev.kobj, KOBJ_CHANGE); 1602 1538 return 0; ··· 1632 1558 1633 1559 kobject_uevent(&udc->dev.kobj, KOBJ_CHANGE); 1634 1560 1635 - usb_gadget_disconnect(gadget); 1561 + udc->allow_connect = false; 1562 + cancel_work_sync(&udc->vbus_work); 1563 + mutex_lock(&udc->connect_lock); 1564 + usb_gadget_disconnect_locked(gadget); 1636 1565 usb_gadget_disable_async_callbacks(udc); 1637 1566 if (gadget->irq) 1638 1567 synchronize_irq(gadget->irq); 1639 1568 udc->driver->unbind(gadget); 1640 - usb_gadget_udc_stop(udc); 1569 + usb_gadget_udc_stop_locked(udc); 1570 + mutex_unlock(&udc->connect_lock); 1641 1571 1642 1572 mutex_lock(&udc_lock); 1643 1573 driver->is_bound = false; ··· 1727 1649 } 1728 1650 1729 1651 if (sysfs_streq(buf, "connect")) { 1730 - usb_gadget_udc_start(udc); 1731 - usb_gadget_connect(udc->gadget); 1652 + mutex_lock(&udc->connect_lock); 1653 + usb_gadget_udc_start_locked(udc); 1654 + usb_gadget_connect_locked(udc->gadget); 1655 + mutex_unlock(&udc->connect_lock); 1732 1656 } else if (sysfs_streq(buf, "disconnect")) { 1733 - usb_gadget_disconnect(udc->gadget); 1734 - usb_gadget_udc_stop(udc); 1657 + mutex_lock(&udc->connect_lock); 1658 + usb_gadget_disconnect_locked(udc->gadget); 1659 + usb_gadget_udc_stop_locked(udc); 1660 + mutex_unlock(&udc->connect_lock); 1735 1661 } else { 1736 1662 dev_err(dev, "unsupported command '%s'\n", buf); 1737 1663 ret = -EINVAL;
+2 -2
drivers/usb/gadget/udc/renesas_usb3.c
··· 2877 2877 struct rzv2m_usb3drd *ddata = dev_get_drvdata(pdev->dev.parent); 2878 2878 2879 2879 usb3->drd_reg = ddata->reg; 2880 - ret = devm_request_irq(ddata->dev, ddata->drd_irq, 2880 + ret = devm_request_irq(&pdev->dev, ddata->drd_irq, 2881 2881 renesas_usb3_otg_irq, 0, 2882 - dev_name(ddata->dev), usb3); 2882 + dev_name(&pdev->dev), usb3); 2883 2883 if (ret < 0) 2884 2884 return ret; 2885 2885 }
+16
drivers/usb/serial/option.c
··· 248 248 #define QUECTEL_VENDOR_ID 0x2c7c 249 249 /* These Quectel products use Quectel's vendor ID */ 250 250 #define QUECTEL_PRODUCT_EC21 0x0121 251 + #define QUECTEL_PRODUCT_EM061K_LTA 0x0123 252 + #define QUECTEL_PRODUCT_EM061K_LMS 0x0124 251 253 #define QUECTEL_PRODUCT_EC25 0x0125 252 254 #define QUECTEL_PRODUCT_EG91 0x0191 253 255 #define QUECTEL_PRODUCT_EG95 0x0195 ··· 268 266 #define QUECTEL_PRODUCT_RM520N 0x0801 269 267 #define QUECTEL_PRODUCT_EC200U 0x0901 270 268 #define QUECTEL_PRODUCT_EC200S_CN 0x6002 269 + #define QUECTEL_PRODUCT_EM061K_LWW 0x6008 270 + #define QUECTEL_PRODUCT_EM061K_LCN 0x6009 271 271 #define QUECTEL_PRODUCT_EC200T 0x6026 272 272 #define QUECTEL_PRODUCT_RM500K 0x7001 273 273 ··· 1193 1189 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0x00, 0x40) }, 1194 1190 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x30) }, 1195 1191 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x40) }, 1192 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LCN, 0xff, 0xff, 0x30) }, 1193 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LCN, 0xff, 0x00, 0x40) }, 1194 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LCN, 0xff, 0xff, 0x40) }, 1195 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LMS, 0xff, 0xff, 0x30) }, 1196 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LMS, 0xff, 0x00, 0x40) }, 1197 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LMS, 0xff, 0xff, 0x40) }, 1198 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LTA, 0xff, 0xff, 0x30) }, 1199 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LTA, 0xff, 0x00, 0x40) }, 1200 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LTA, 0xff, 0xff, 0x40) }, 1201 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LWW, 0xff, 0xff, 0x30) }, 1202 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LWW, 0xff, 0x00, 0x40) }, 1203 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LWW, 0xff, 0xff, 0x40) }, 1196 1204 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0xff, 0xff), 1197 1205 .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 }, 1198 1206 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0, 0) },
+1 -1
drivers/usb/typec/pd.c
··· 95 95 static ssize_t 96 96 fast_role_swap_current_show(struct device *dev, struct device_attribute *attr, char *buf) 97 97 { 98 - return sysfs_emit(buf, "%u\n", to_pdo(dev)->pdo >> PDO_FIXED_FRS_CURR_SHIFT) & 3; 98 + return sysfs_emit(buf, "%u\n", (to_pdo(dev)->pdo >> PDO_FIXED_FRS_CURR_SHIFT) & 3); 99 99 } 100 100 static DEVICE_ATTR_RO(fast_role_swap_current); 101 101
+7 -4
drivers/usb/typec/ucsi/ucsi.c
··· 132 132 if (ret) 133 133 return ret; 134 134 135 - if (cci & UCSI_CCI_BUSY) { 136 - ucsi->ops->async_write(ucsi, UCSI_CANCEL, NULL, 0); 137 - return -EBUSY; 138 - } 135 + if (cmd != UCSI_CANCEL && cci & UCSI_CCI_BUSY) 136 + return ucsi_exec_command(ucsi, UCSI_CANCEL); 139 137 140 138 if (!(cci & UCSI_CCI_COMMAND_COMPLETE)) 141 139 return -EIO; ··· 145 147 if (cmd == UCSI_GET_ERROR_STATUS) 146 148 return -EIO; 147 149 return ucsi_read_error(ucsi); 150 + } 151 + 152 + if (cmd == UCSI_CANCEL && cci & UCSI_CCI_CANCEL_COMPLETE) { 153 + ret = ucsi_acknowledge_command(ucsi); 154 + return ret ? ret : -EBUSY; 148 155 } 149 156 150 157 return UCSI_CCI_LENGTH(cci);