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

Pull USB fixes from Greg KH:
"Here are some small USB fixes that resolve a number of tiny issues.
They include:

- new USB serial driver ids

- xhci driver fixes for a bunch of issues

- musb error path fixes.

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

* tag 'usb-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
usb: musb: dsps: Fix the probe error path
xhci: Enable trust tx length quirk for Fresco FL11 USB controller
xhci: Fix command ring pointer corruption while aborting a command
USB: xhci: dbc: fix tty registration race
xhci: add quirk for host controllers that don't update endpoint DCS
xhci: guard accesses to ep_state in xhci_endpoint_reset()
USB: serial: qcserial: add EM9191 QDL support
USB: serial: option: add Quectel EC200S-CN module support
USB: serial: option: add prod. id for Quectel EG91
USB: serial: option: add Telit LE910Cx composition 0x1204

+70 -22
+13 -15
drivers/usb/host/xhci-dbgtty.c
··· 408 408 return -EBUSY; 409 409 410 410 xhci_dbc_tty_init_port(dbc, port); 411 - tty_dev = tty_port_register_device(&port->port, 412 - dbc_tty_driver, 0, NULL); 413 - if (IS_ERR(tty_dev)) { 414 - ret = PTR_ERR(tty_dev); 415 - goto register_fail; 416 - } 417 411 418 412 ret = kfifo_alloc(&port->write_fifo, DBC_WRITE_BUF_SIZE, GFP_KERNEL); 419 413 if (ret) 420 - goto buf_alloc_fail; 414 + goto err_exit_port; 421 415 422 416 ret = xhci_dbc_alloc_requests(dbc, BULK_IN, &port->read_pool, 423 417 dbc_read_complete); 424 418 if (ret) 425 - goto request_fail; 419 + goto err_free_fifo; 426 420 427 421 ret = xhci_dbc_alloc_requests(dbc, BULK_OUT, &port->write_pool, 428 422 dbc_write_complete); 429 423 if (ret) 430 - goto request_fail; 424 + goto err_free_requests; 425 + 426 + tty_dev = tty_port_register_device(&port->port, 427 + dbc_tty_driver, 0, NULL); 428 + if (IS_ERR(tty_dev)) { 429 + ret = PTR_ERR(tty_dev); 430 + goto err_free_requests; 431 + } 431 432 432 433 port->registered = true; 433 434 434 435 return 0; 435 436 436 - request_fail: 437 + err_free_requests: 437 438 xhci_dbc_free_requests(&port->read_pool); 438 439 xhci_dbc_free_requests(&port->write_pool); 440 + err_free_fifo: 439 441 kfifo_free(&port->write_fifo); 440 - 441 - buf_alloc_fail: 442 - tty_unregister_device(dbc_tty_driver, 0); 443 - 444 - register_fail: 442 + err_exit_port: 445 443 xhci_dbc_tty_exit_port(port); 446 444 447 445 dev_err(dbc->dev, "can't register tty port, err %d\n", ret);
+5 -1
drivers/usb/host/xhci-pci.c
··· 30 30 #define PCI_VENDOR_ID_FRESCO_LOGIC 0x1b73 31 31 #define PCI_DEVICE_ID_FRESCO_LOGIC_PDK 0x1000 32 32 #define PCI_DEVICE_ID_FRESCO_LOGIC_FL1009 0x1009 33 + #define PCI_DEVICE_ID_FRESCO_LOGIC_FL1100 0x1100 33 34 #define PCI_DEVICE_ID_FRESCO_LOGIC_FL1400 0x1400 34 35 35 36 #define PCI_VENDOR_ID_ETRON 0x1b6f ··· 114 113 /* Look for vendor-specific quirks */ 115 114 if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC && 116 115 (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK || 116 + pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1100 || 117 117 pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1400)) { 118 118 if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK && 119 119 pdev->revision == 0x0) { ··· 281 279 pdev->device == 0x3432) 282 280 xhci->quirks |= XHCI_BROKEN_STREAMS; 283 281 284 - if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) 282 + if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) { 285 283 xhci->quirks |= XHCI_LPM_SUPPORT; 284 + xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS; 285 + } 286 286 287 287 if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && 288 288 pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI)
+34 -5
drivers/usb/host/xhci-ring.c
··· 366 366 /* Must be called with xhci->lock held, releases and aquires lock back */ 367 367 static int xhci_abort_cmd_ring(struct xhci_hcd *xhci, unsigned long flags) 368 368 { 369 - u64 temp_64; 369 + u32 temp_32; 370 370 int ret; 371 371 372 372 xhci_dbg(xhci, "Abort command ring\n"); 373 373 374 374 reinit_completion(&xhci->cmd_ring_stop_completion); 375 375 376 - temp_64 = xhci_read_64(xhci, &xhci->op_regs->cmd_ring); 377 - xhci_write_64(xhci, temp_64 | CMD_RING_ABORT, 378 - &xhci->op_regs->cmd_ring); 376 + /* 377 + * The control bits like command stop, abort are located in lower 378 + * dword of the command ring control register. Limit the write 379 + * to the lower dword to avoid corrupting the command ring pointer 380 + * in case if the command ring is stopped by the time upper dword 381 + * is written. 382 + */ 383 + temp_32 = readl(&xhci->op_regs->cmd_ring); 384 + writel(temp_32 | CMD_RING_ABORT, &xhci->op_regs->cmd_ring); 379 385 380 386 /* Section 4.6.1.2 of xHCI 1.0 spec says software should also time the 381 387 * completion of the Command Abort operation. If CRR is not negated in 5 ··· 565 559 struct xhci_ring *ep_ring; 566 560 struct xhci_command *cmd; 567 561 struct xhci_segment *new_seg; 562 + struct xhci_segment *halted_seg = NULL; 568 563 union xhci_trb *new_deq; 569 564 int new_cycle; 565 + union xhci_trb *halted_trb; 566 + int index = 0; 570 567 dma_addr_t addr; 571 568 u64 hw_dequeue; 572 569 bool cycle_found = false; ··· 607 598 hw_dequeue = xhci_get_hw_deq(xhci, dev, ep_index, stream_id); 608 599 new_seg = ep_ring->deq_seg; 609 600 new_deq = ep_ring->dequeue; 610 - new_cycle = hw_dequeue & 0x1; 601 + 602 + /* 603 + * Quirk: xHC write-back of the DCS field in the hardware dequeue 604 + * pointer is wrong - use the cycle state of the TRB pointed to by 605 + * the dequeue pointer. 606 + */ 607 + if (xhci->quirks & XHCI_EP_CTX_BROKEN_DCS && 608 + !(ep->ep_state & EP_HAS_STREAMS)) 609 + halted_seg = trb_in_td(xhci, td->start_seg, 610 + td->first_trb, td->last_trb, 611 + hw_dequeue & ~0xf, false); 612 + if (halted_seg) { 613 + index = ((dma_addr_t)(hw_dequeue & ~0xf) - halted_seg->dma) / 614 + sizeof(*halted_trb); 615 + halted_trb = &halted_seg->trbs[index]; 616 + new_cycle = halted_trb->generic.field[3] & 0x1; 617 + xhci_dbg(xhci, "Endpoint DCS = %d TRB index = %d cycle = %d\n", 618 + (u8)(hw_dequeue & 0x1), index, new_cycle); 619 + } else { 620 + new_cycle = hw_dequeue & 0x1; 621 + } 611 622 612 623 /* 613 624 * We want to find the pointer, segment and cycle state of the new trb
+5
drivers/usb/host/xhci.c
··· 3214 3214 return; 3215 3215 3216 3216 /* Bail out if toggle is already being cleared by a endpoint reset */ 3217 + spin_lock_irqsave(&xhci->lock, flags); 3217 3218 if (ep->ep_state & EP_HARD_CLEAR_TOGGLE) { 3218 3219 ep->ep_state &= ~EP_HARD_CLEAR_TOGGLE; 3220 + spin_unlock_irqrestore(&xhci->lock, flags); 3219 3221 return; 3220 3222 } 3223 + spin_unlock_irqrestore(&xhci->lock, flags); 3221 3224 /* Only interrupt and bulk ep's use data toggle, USB2 spec 5.5.4-> */ 3222 3225 if (usb_endpoint_xfer_control(&host_ep->desc) || 3223 3226 usb_endpoint_xfer_isoc(&host_ep->desc)) ··· 3306 3303 xhci_free_command(xhci, cfg_cmd); 3307 3304 cleanup: 3308 3305 xhci_free_command(xhci, stop_cmd); 3306 + spin_lock_irqsave(&xhci->lock, flags); 3309 3307 if (ep->ep_state & EP_SOFT_CLEAR_TOGGLE) 3310 3308 ep->ep_state &= ~EP_SOFT_CLEAR_TOGGLE; 3309 + spin_unlock_irqrestore(&xhci->lock, flags); 3311 3310 } 3312 3311 3313 3312 static int xhci_check_streams_endpoint(struct xhci_hcd *xhci,
+1
drivers/usb/host/xhci.h
··· 1899 1899 #define XHCI_SG_TRB_CACHE_SIZE_QUIRK BIT_ULL(39) 1900 1900 #define XHCI_NO_SOFT_RETRY BIT_ULL(40) 1901 1901 #define XHCI_BROKEN_D3COLD BIT_ULL(41) 1902 + #define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(42) 1902 1903 1903 1904 unsigned int num_active_eps; 1904 1905 unsigned int limit_active_eps;
+3 -1
drivers/usb/musb/musb_dsps.c
··· 899 899 if (usb_get_dr_mode(&pdev->dev) == USB_DR_MODE_PERIPHERAL) { 900 900 ret = dsps_setup_optional_vbus_irq(pdev, glue); 901 901 if (ret) 902 - goto err; 902 + goto unregister_pdev; 903 903 } 904 904 905 905 return 0; 906 906 907 + unregister_pdev: 908 + platform_device_unregister(glue->musb); 907 909 err: 908 910 pm_runtime_disable(&pdev->dev); 909 911 iounmap(glue->usbss_base);
+8
drivers/usb/serial/option.c
··· 246 246 /* These Quectel products use Quectel's vendor ID */ 247 247 #define QUECTEL_PRODUCT_EC21 0x0121 248 248 #define QUECTEL_PRODUCT_EC25 0x0125 249 + #define QUECTEL_PRODUCT_EG91 0x0191 249 250 #define QUECTEL_PRODUCT_EG95 0x0195 250 251 #define QUECTEL_PRODUCT_BG96 0x0296 251 252 #define QUECTEL_PRODUCT_EP06 0x0306 252 253 #define QUECTEL_PRODUCT_EM12 0x0512 253 254 #define QUECTEL_PRODUCT_RM500Q 0x0800 255 + #define QUECTEL_PRODUCT_EC200S_CN 0x6002 254 256 #define QUECTEL_PRODUCT_EC200T 0x6026 255 257 256 258 #define CMOTECH_VENDOR_ID 0x16d8 ··· 1113 1111 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25, 0xff, 0xff, 0xff), 1114 1112 .driver_info = NUMEP2 }, 1115 1113 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25, 0xff, 0, 0) }, 1114 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG91, 0xff, 0xff, 0xff), 1115 + .driver_info = NUMEP2 }, 1116 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG91, 0xff, 0, 0) }, 1116 1117 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0xff, 0xff), 1117 1118 .driver_info = NUMEP2 }, 1118 1119 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0, 0) }, ··· 1133 1128 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0) }, 1134 1129 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x10), 1135 1130 .driver_info = ZLP }, 1131 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) }, 1136 1132 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) }, 1137 1133 1138 1134 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, ··· 1233 1227 .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, 1234 1228 { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1203, 0xff), /* Telit LE910Cx (RNDIS) */ 1235 1229 .driver_info = NCTRL(2) | RSVD(3) }, 1230 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1204, 0xff), /* Telit LE910Cx (MBIM) */ 1231 + .driver_info = NCTRL(0) | RSVD(1) }, 1236 1232 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4), 1237 1233 .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) | RSVD(3) }, 1238 1234 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920),
+1
drivers/usb/serial/qcserial.c
··· 165 165 {DEVICE_SWI(0x1199, 0x907b)}, /* Sierra Wireless EM74xx */ 166 166 {DEVICE_SWI(0x1199, 0x9090)}, /* Sierra Wireless EM7565 QDL */ 167 167 {DEVICE_SWI(0x1199, 0x9091)}, /* Sierra Wireless EM7565 */ 168 + {DEVICE_SWI(0x1199, 0x90d2)}, /* Sierra Wireless EM9191 QDL */ 168 169 {DEVICE_SWI(0x413c, 0x81a2)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */ 169 170 {DEVICE_SWI(0x413c, 0x81a3)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */ 170 171 {DEVICE_SWI(0x413c, 0x81a4)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */