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

Pull USB fixes from Greg KH:
"Here are some small USB fixes for 5.6-rc7. And there's a thunderbolt
driver fix thrown in for good measure as well.

These fixes are:
- new device ids for usb-serial drivers
- thunderbolt error code fix
- xhci driver fixes
- typec fixes
- cdc-acm driver fixes
- chipidea driver fix
- more USB quirks added for devices that need them.

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

* tag 'usb-5.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
USB: cdc-acm: fix rounding error in TIOCSSERIAL
USB: cdc-acm: fix close_delay and closing_wait units in TIOCSSERIAL
usb: quirks: add NO_LPM quirk for RTL8153 based ethernet adapters
usb: chipidea: udc: fix sleeping function called from invalid context
USB: serial: pl2303: add device-id for HP LD381
USB: serial: option: add ME910G1 ECM composition 0x110b
usb: host: xhci-plat: add a shutdown
usb: typec: ucsi: displayport: Fix a potential race during registration
usb: typec: ucsi: displayport: Fix NULL pointer dereference
USB: Disable LPM on WD19's Realtek Hub
usb: xhci: apply XHCI_SUSPEND_DELAY to AMD XHCI controller 1022:145c
xhci: Do not open code __print_symbolic() in xhci trace events
thunderbolt: Fix error code in tb_port_is_width_supported()

Changed files
+56 -36
drivers
thunderbolt
usb
+1 -1
drivers/thunderbolt/switch.c
··· 954 954 ret = tb_port_read(port, &phy, TB_CFG_PORT, 955 955 port->cap_phy + LANE_ADP_CS_0, 1); 956 956 if (ret) 957 - return ret; 957 + return false; 958 958 959 959 widths = (phy & LANE_ADP_CS_0_SUPPORTED_WIDTH_MASK) >> 960 960 LANE_ADP_CS_0_SUPPORTED_WIDTH_SHIFT;
+4 -3
drivers/usb/chipidea/udc.c
··· 1530 1530 static void ci_hdrc_gadget_connect(struct usb_gadget *_gadget, int is_active) 1531 1531 { 1532 1532 struct ci_hdrc *ci = container_of(_gadget, struct ci_hdrc, gadget); 1533 - unsigned long flags; 1534 1533 1535 1534 if (is_active) { 1536 1535 pm_runtime_get_sync(&_gadget->dev); 1537 1536 hw_device_reset(ci); 1538 - spin_lock_irqsave(&ci->lock, flags); 1537 + spin_lock_irq(&ci->lock); 1539 1538 if (ci->driver) { 1540 1539 hw_device_state(ci, ci->ep0out->qh.dma); 1541 1540 usb_gadget_set_state(_gadget, USB_STATE_POWERED); 1541 + spin_unlock_irq(&ci->lock); 1542 1542 usb_udc_vbus_handler(_gadget, true); 1543 + } else { 1544 + spin_unlock_irq(&ci->lock); 1543 1545 } 1544 - spin_unlock_irqrestore(&ci->lock, flags); 1545 1546 } else { 1546 1547 usb_udc_vbus_handler(_gadget, false); 1547 1548 if (ci->driver)
+21 -13
drivers/usb/class/cdc-acm.c
··· 896 896 897 897 ss->xmit_fifo_size = acm->writesize; 898 898 ss->baud_base = le32_to_cpu(acm->line.dwDTERate); 899 - ss->close_delay = acm->port.close_delay / 10; 899 + ss->close_delay = jiffies_to_msecs(acm->port.close_delay) / 10; 900 900 ss->closing_wait = acm->port.closing_wait == ASYNC_CLOSING_WAIT_NONE ? 901 901 ASYNC_CLOSING_WAIT_NONE : 902 - acm->port.closing_wait / 10; 902 + jiffies_to_msecs(acm->port.closing_wait) / 10; 903 903 return 0; 904 904 } 905 905 ··· 907 907 { 908 908 struct acm *acm = tty->driver_data; 909 909 unsigned int closing_wait, close_delay; 910 + unsigned int old_closing_wait, old_close_delay; 910 911 int retval = 0; 911 912 912 - close_delay = ss->close_delay * 10; 913 + close_delay = msecs_to_jiffies(ss->close_delay * 10); 913 914 closing_wait = ss->closing_wait == ASYNC_CLOSING_WAIT_NONE ? 914 - ASYNC_CLOSING_WAIT_NONE : ss->closing_wait * 10; 915 + ASYNC_CLOSING_WAIT_NONE : 916 + msecs_to_jiffies(ss->closing_wait * 10); 917 + 918 + /* we must redo the rounding here, so that the values match */ 919 + old_close_delay = jiffies_to_msecs(acm->port.close_delay) / 10; 920 + old_closing_wait = acm->port.closing_wait == ASYNC_CLOSING_WAIT_NONE ? 921 + ASYNC_CLOSING_WAIT_NONE : 922 + jiffies_to_msecs(acm->port.closing_wait) / 10; 915 923 916 924 mutex_lock(&acm->port.mutex); 917 925 918 - if (!capable(CAP_SYS_ADMIN)) { 919 - if ((close_delay != acm->port.close_delay) || 920 - (closing_wait != acm->port.closing_wait)) 926 + if ((ss->close_delay != old_close_delay) || 927 + (ss->closing_wait != old_closing_wait)) { 928 + if (!capable(CAP_SYS_ADMIN)) 921 929 retval = -EPERM; 922 - else 923 - retval = -EOPNOTSUPP; 924 - } else { 925 - acm->port.close_delay = close_delay; 926 - acm->port.closing_wait = closing_wait; 927 - } 930 + else { 931 + acm->port.close_delay = close_delay; 932 + acm->port.closing_wait = closing_wait; 933 + } 934 + } else 935 + retval = -EOPNOTSUPP; 928 936 929 937 mutex_unlock(&acm->port.mutex); 930 938 return retval;
+6
drivers/usb/core/quirks.c
··· 378 378 { USB_DEVICE(0x0b05, 0x17e0), .driver_info = 379 379 USB_QUIRK_IGNORE_REMOTE_WAKEUP }, 380 380 381 + /* Realtek hub in Dell WD19 (Type-C) */ 382 + { USB_DEVICE(0x0bda, 0x0487), .driver_info = USB_QUIRK_NO_LPM }, 383 + 384 + /* Generic RTL8153 based ethernet adapters */ 385 + { USB_DEVICE(0x0bda, 0x8153), .driver_info = USB_QUIRK_NO_LPM }, 386 + 381 387 /* Action Semiconductor flash disk */ 382 388 { USB_DEVICE(0x10d6, 0x2200), .driver_info = 383 389 USB_QUIRK_STRING_FETCH_255 },
+2 -1
drivers/usb/host/xhci-pci.c
··· 136 136 xhci->quirks |= XHCI_AMD_PLL_FIX; 137 137 138 138 if (pdev->vendor == PCI_VENDOR_ID_AMD && 139 - (pdev->device == 0x15e0 || 139 + (pdev->device == 0x145c || 140 + pdev->device == 0x15e0 || 140 141 pdev->device == 0x15e1 || 141 142 pdev->device == 0x43bb)) 142 143 xhci->quirks |= XHCI_SUSPEND_DELAY;
+1
drivers/usb/host/xhci-plat.c
··· 445 445 static struct platform_driver usb_xhci_driver = { 446 446 .probe = xhci_plat_probe, 447 447 .remove = xhci_plat_remove, 448 + .shutdown = usb_hcd_platform_shutdown, 448 449 .driver = { 449 450 .name = "xhci-hcd", 450 451 .pm = &xhci_plat_pm_ops,
+6 -17
drivers/usb/host/xhci-trace.h
··· 289 289 ), 290 290 TP_printk("ep%d%s-%s: urb %p pipe %u slot %d length %d/%d sgs %d/%d stream %d flags %08x", 291 291 __entry->epnum, __entry->dir_in ? "in" : "out", 292 - ({ char *s; 293 - switch (__entry->type) { 294 - case USB_ENDPOINT_XFER_INT: 295 - s = "intr"; 296 - break; 297 - case USB_ENDPOINT_XFER_CONTROL: 298 - s = "control"; 299 - break; 300 - case USB_ENDPOINT_XFER_BULK: 301 - s = "bulk"; 302 - break; 303 - case USB_ENDPOINT_XFER_ISOC: 304 - s = "isoc"; 305 - break; 306 - default: 307 - s = "UNKNOWN"; 308 - } s; }), __entry->urb, __entry->pipe, __entry->slot_id, 292 + __print_symbolic(__entry->type, 293 + { USB_ENDPOINT_XFER_INT, "intr" }, 294 + { USB_ENDPOINT_XFER_CONTROL, "control" }, 295 + { USB_ENDPOINT_XFER_BULK, "bulk" }, 296 + { USB_ENDPOINT_XFER_ISOC, "isoc" }), 297 + __entry->urb, __entry->pipe, __entry->slot_id, 309 298 __entry->actual, __entry->length, __entry->num_mapped_sgs, 310 299 __entry->num_sgs, __entry->stream, __entry->flags 311 300 )
+2
drivers/usb/serial/option.c
··· 1183 1183 .driver_info = NCTRL(0) }, 1184 1184 { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x110a, 0xff), /* Telit ME910G1 */ 1185 1185 .driver_info = NCTRL(0) | RSVD(3) }, 1186 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x110b, 0xff), /* Telit ME910G1 (ECM) */ 1187 + .driver_info = NCTRL(0) }, 1186 1188 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910), 1187 1189 .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, 1188 1190 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4),
+1
drivers/usb/serial/pl2303.c
··· 99 99 { USB_DEVICE(SUPERIAL_VENDOR_ID, SUPERIAL_PRODUCT_ID) }, 100 100 { USB_DEVICE(HP_VENDOR_ID, HP_LD220_PRODUCT_ID) }, 101 101 { USB_DEVICE(HP_VENDOR_ID, HP_LD220TA_PRODUCT_ID) }, 102 + { USB_DEVICE(HP_VENDOR_ID, HP_LD381_PRODUCT_ID) }, 102 103 { USB_DEVICE(HP_VENDOR_ID, HP_LD960_PRODUCT_ID) }, 103 104 { USB_DEVICE(HP_VENDOR_ID, HP_LD960TA_PRODUCT_ID) }, 104 105 { USB_DEVICE(HP_VENDOR_ID, HP_LCM220_PRODUCT_ID) },
+1
drivers/usb/serial/pl2303.h
··· 130 130 #define HP_LM920_PRODUCT_ID 0x026b 131 131 #define HP_TD620_PRODUCT_ID 0x0956 132 132 #define HP_LD960_PRODUCT_ID 0x0b39 133 + #define HP_LD381_PRODUCT_ID 0x0f7f 133 134 #define HP_LCM220_PRODUCT_ID 0x3139 134 135 #define HP_LCM960_PRODUCT_ID 0x3239 135 136 #define HP_LD220_PRODUCT_ID 0x3524
+11 -1
drivers/usb/typec/ucsi/displayport.c
··· 271 271 return; 272 272 273 273 dp = typec_altmode_get_drvdata(alt); 274 + if (!dp) 275 + return; 276 + 274 277 dp->data.conf = 0; 275 278 dp->data.status = 0; 276 279 dp->initialized = false; ··· 288 285 struct typec_altmode *alt; 289 286 struct ucsi_dp *dp; 290 287 288 + mutex_lock(&con->lock); 289 + 291 290 /* We can't rely on the firmware with the capabilities. */ 292 291 desc->vdo |= DP_CAP_DP_SIGNALING | DP_CAP_RECEPTACLE; 293 292 ··· 298 293 desc->vdo |= all_assignments << 16; 299 294 300 295 alt = typec_port_register_altmode(con->port, desc); 301 - if (IS_ERR(alt)) 296 + if (IS_ERR(alt)) { 297 + mutex_unlock(&con->lock); 302 298 return alt; 299 + } 303 300 304 301 dp = devm_kzalloc(&alt->dev, sizeof(*dp), GFP_KERNEL); 305 302 if (!dp) { 306 303 typec_unregister_altmode(alt); 304 + mutex_unlock(&con->lock); 307 305 return ERR_PTR(-ENOMEM); 308 306 } 309 307 ··· 318 310 319 311 alt->ops = &ucsi_displayport_ops; 320 312 typec_altmode_set_drvdata(alt, dp); 313 + 314 + mutex_unlock(&con->lock); 321 315 322 316 return alt; 323 317 }