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

Pull USB fixes from Greg KH:
"Here are some small USB driver fixes and new device ids for 6.17-rc6.
Included in here are:

- new usb-serial driver device ids

- dummy-hcd locking bugfix for rt-enabled systems (which is crazy,
but people have odd testing requirements at times...)

- xhci driver bugfixes for reported issues

- typec driver bugfix

- midi2 gadget driver bugfixes

- usb core sysfs file regression fix from -rc1

All of these, except for the last usb sysfs file fix, have been in
linux-next with no reported issues. The sysfs fix was added to the
tree on Friday, and is "obviously correct" and should not have any
problems either, it just didn't have any time for linux-next to pick
up (0-day had no problems with it)"

* tag 'usb-6.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
USB: core: remove the move buf action
usb: gadget: midi2: Fix MIDI2 IN EP max packet size
usb: gadget: midi2: Fix missing UMP group attributes initialization
usb: typec: tcpm: properly deliver cable vdms to altmode drivers
USB: gadget: dummy-hcd: Fix locking bug in RT-enabled kernels
xhci: fix memory leak regression when freeing xhci vdev devices depth first
xhci: dbc: Fix full DbC transfer ring after several reconnects
xhci: dbc: decouple endpoint allocation from initialization
USB: serial: option: add Telit Cinterion LE910C4-WWX new compositions
USB: serial: option: add Telit Cinterion FN990A w/audio compositions

+108 -40
+2 -2
drivers/usb/core/driver.c
··· 119 119 guard(mutex)(&usb_dynids_lock); 120 120 list_for_each_entry(dynid, &dynids->list, node) 121 121 if (dynid->id.bInterfaceClass != 0) 122 - count += sysfs_emit_at(&buf[count], count, "%04x %04x %02x\n", 122 + count += sysfs_emit_at(buf, count, "%04x %04x %02x\n", 123 123 dynid->id.idVendor, dynid->id.idProduct, 124 124 dynid->id.bInterfaceClass); 125 125 else 126 - count += sysfs_emit_at(&buf[count], count, "%04x %04x\n", 126 + count += sysfs_emit_at(buf, count, "%04x %04x\n", 127 127 dynid->id.idVendor, dynid->id.idProduct); 128 128 return count; 129 129 }
+9 -2
drivers/usb/gadget/function/f_midi2.c
··· 1599 1599 strscpy(fb->info.name, ump_fb_name(b), 1600 1600 sizeof(fb->info.name)); 1601 1601 } 1602 + snd_ump_update_group_attrs(ump); 1602 1603 } 1603 1604 1604 1605 for (i = 0; i < midi2->num_eps; i++) { ··· 1737 1736 case USB_SPEED_HIGH: 1738 1737 midi2_midi1_ep_out_desc.wMaxPacketSize = cpu_to_le16(512); 1739 1738 midi2_midi1_ep_in_desc.wMaxPacketSize = cpu_to_le16(512); 1740 - for (i = 0; i < midi2->num_eps; i++) 1739 + for (i = 0; i < midi2->num_eps; i++) { 1741 1740 midi2_midi2_ep_out_desc[i].wMaxPacketSize = 1742 1741 cpu_to_le16(512); 1742 + midi2_midi2_ep_in_desc[i].wMaxPacketSize = 1743 + cpu_to_le16(512); 1744 + } 1743 1745 fallthrough; 1744 1746 case USB_SPEED_FULL: 1745 1747 midi1_in_eps = midi2_midi1_ep_in_descs; ··· 1751 1747 case USB_SPEED_SUPER: 1752 1748 midi2_midi1_ep_out_desc.wMaxPacketSize = cpu_to_le16(1024); 1753 1749 midi2_midi1_ep_in_desc.wMaxPacketSize = cpu_to_le16(1024); 1754 - for (i = 0; i < midi2->num_eps; i++) 1750 + for (i = 0; i < midi2->num_eps; i++) { 1755 1751 midi2_midi2_ep_out_desc[i].wMaxPacketSize = 1756 1752 cpu_to_le16(1024); 1753 + midi2_midi2_ep_in_desc[i].wMaxPacketSize = 1754 + cpu_to_le16(1024); 1755 + } 1757 1756 midi1_in_eps = midi2_midi1_ep_in_ss_descs; 1758 1757 midi1_out_eps = midi2_midi1_ep_out_ss_descs; 1759 1758 break;
+4 -4
drivers/usb/gadget/udc/dummy_hcd.c
··· 765 765 if (!dum->driver) 766 766 return -ESHUTDOWN; 767 767 768 - local_irq_save(flags); 769 - spin_lock(&dum->lock); 768 + spin_lock_irqsave(&dum->lock, flags); 770 769 list_for_each_entry(iter, &ep->queue, queue) { 771 770 if (&iter->req != _req) 772 771 continue; ··· 775 776 retval = 0; 776 777 break; 777 778 } 778 - spin_unlock(&dum->lock); 779 779 780 780 if (retval == 0) { 781 781 dev_dbg(udc_dev(dum), 782 782 "dequeued req %p from %s, len %d buf %p\n", 783 783 req, _ep->name, _req->length, _req->buf); 784 + spin_unlock(&dum->lock); 784 785 usb_gadget_giveback_request(_ep, _req); 786 + spin_lock(&dum->lock); 785 787 } 786 - local_irq_restore(flags); 788 + spin_unlock_irqrestore(&dum->lock, flags); 787 789 return retval; 788 790 } 789 791
+67 -27
drivers/usb/host/xhci-dbgcap.c
··· 101 101 return string_length; 102 102 } 103 103 104 + static void xhci_dbc_init_ep_contexts(struct xhci_dbc *dbc) 105 + { 106 + struct xhci_ep_ctx *ep_ctx; 107 + unsigned int max_burst; 108 + dma_addr_t deq; 109 + 110 + max_burst = DBC_CTRL_MAXBURST(readl(&dbc->regs->control)); 111 + 112 + /* Populate bulk out endpoint context: */ 113 + ep_ctx = dbc_bulkout_ctx(dbc); 114 + deq = dbc_bulkout_enq(dbc); 115 + ep_ctx->ep_info = 0; 116 + ep_ctx->ep_info2 = dbc_epctx_info2(BULK_OUT_EP, 1024, max_burst); 117 + ep_ctx->deq = cpu_to_le64(deq | dbc->ring_out->cycle_state); 118 + 119 + /* Populate bulk in endpoint context: */ 120 + ep_ctx = dbc_bulkin_ctx(dbc); 121 + deq = dbc_bulkin_enq(dbc); 122 + ep_ctx->ep_info = 0; 123 + ep_ctx->ep_info2 = dbc_epctx_info2(BULK_IN_EP, 1024, max_burst); 124 + ep_ctx->deq = cpu_to_le64(deq | dbc->ring_in->cycle_state); 125 + } 126 + 104 127 static void xhci_dbc_init_contexts(struct xhci_dbc *dbc, u32 string_length) 105 128 { 106 129 struct dbc_info_context *info; 107 - struct xhci_ep_ctx *ep_ctx; 108 130 u32 dev_info; 109 - dma_addr_t deq, dma; 110 - unsigned int max_burst; 131 + dma_addr_t dma; 111 132 112 133 if (!dbc) 113 134 return; ··· 142 121 info->serial = cpu_to_le64(dma + DBC_MAX_STRING_LENGTH * 3); 143 122 info->length = cpu_to_le32(string_length); 144 123 145 - /* Populate bulk out endpoint context: */ 146 - ep_ctx = dbc_bulkout_ctx(dbc); 147 - max_burst = DBC_CTRL_MAXBURST(readl(&dbc->regs->control)); 148 - deq = dbc_bulkout_enq(dbc); 149 - ep_ctx->ep_info = 0; 150 - ep_ctx->ep_info2 = dbc_epctx_info2(BULK_OUT_EP, 1024, max_burst); 151 - ep_ctx->deq = cpu_to_le64(deq | dbc->ring_out->cycle_state); 152 - 153 - /* Populate bulk in endpoint context: */ 154 - ep_ctx = dbc_bulkin_ctx(dbc); 155 - deq = dbc_bulkin_enq(dbc); 156 - ep_ctx->ep_info = 0; 157 - ep_ctx->ep_info2 = dbc_epctx_info2(BULK_IN_EP, 1024, max_burst); 158 - ep_ctx->deq = cpu_to_le64(deq | dbc->ring_in->cycle_state); 124 + /* Populate bulk in and out endpoint contexts: */ 125 + xhci_dbc_init_ep_contexts(dbc); 159 126 160 127 /* Set DbC context and info registers: */ 161 128 lo_hi_writeq(dbc->ctx->dma, &dbc->regs->dccp); ··· 445 436 return ctx; 446 437 } 447 438 439 + static void xhci_dbc_ring_init(struct xhci_ring *ring) 440 + { 441 + struct xhci_segment *seg = ring->first_seg; 442 + 443 + /* clear all trbs on ring in case of old ring */ 444 + memset(seg->trbs, 0, TRB_SEGMENT_SIZE); 445 + 446 + /* Only event ring does not use link TRB */ 447 + if (ring->type != TYPE_EVENT) { 448 + union xhci_trb *trb = &seg->trbs[TRBS_PER_SEGMENT - 1]; 449 + 450 + trb->link.segment_ptr = cpu_to_le64(ring->first_seg->dma); 451 + trb->link.control = cpu_to_le32(LINK_TOGGLE | TRB_TYPE(TRB_LINK)); 452 + } 453 + xhci_initialize_ring_info(ring); 454 + } 455 + 456 + static int xhci_dbc_reinit_ep_rings(struct xhci_dbc *dbc) 457 + { 458 + struct xhci_ring *in_ring = dbc->eps[BULK_IN].ring; 459 + struct xhci_ring *out_ring = dbc->eps[BULK_OUT].ring; 460 + 461 + if (!in_ring || !out_ring || !dbc->ctx) { 462 + dev_warn(dbc->dev, "Can't re-init unallocated endpoints\n"); 463 + return -ENODEV; 464 + } 465 + 466 + xhci_dbc_ring_init(in_ring); 467 + xhci_dbc_ring_init(out_ring); 468 + 469 + /* set ep context enqueue, dequeue, and cycle to initial values */ 470 + xhci_dbc_init_ep_contexts(dbc); 471 + 472 + return 0; 473 + } 474 + 448 475 static struct xhci_ring * 449 476 xhci_dbc_ring_alloc(struct device *dev, enum xhci_ring_type type, gfp_t flags) 450 477 { ··· 509 464 510 465 seg->dma = dma; 511 466 512 - /* Only event ring does not use link TRB */ 513 - if (type != TYPE_EVENT) { 514 - union xhci_trb *trb = &seg->trbs[TRBS_PER_SEGMENT - 1]; 515 - 516 - trb->link.segment_ptr = cpu_to_le64(dma); 517 - trb->link.control = cpu_to_le32(LINK_TOGGLE | TRB_TYPE(TRB_LINK)); 518 - } 519 467 INIT_LIST_HEAD(&ring->td_list); 520 - xhci_initialize_ring_info(ring); 468 + 469 + xhci_dbc_ring_init(ring); 470 + 521 471 return ring; 522 472 dma_fail: 523 473 kfree(seg); ··· 904 864 dev_info(dbc->dev, "DbC cable unplugged\n"); 905 865 dbc->state = DS_ENABLED; 906 866 xhci_dbc_flush_requests(dbc); 907 - 867 + xhci_dbc_reinit_ep_rings(dbc); 908 868 return EVT_DISC; 909 869 } 910 870 ··· 914 874 writel(portsc, &dbc->regs->portsc); 915 875 dbc->state = DS_ENABLED; 916 876 xhci_dbc_flush_requests(dbc); 917 - 877 + xhci_dbc_reinit_ep_rings(dbc); 918 878 return EVT_DISC; 919 879 } 920 880
+1 -1
drivers/usb/host/xhci-mem.c
··· 962 962 out: 963 963 /* we are now at a leaf device */ 964 964 xhci_debugfs_remove_slot(xhci, slot_id); 965 - xhci_free_virt_device(xhci, vdev, slot_id); 965 + xhci_free_virt_device(xhci, xhci->devs[slot_id], slot_id); 966 966 } 967 967 968 968 int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id,
+17
drivers/usb/serial/option.c
··· 1322 1322 .driver_info = NCTRL(0) | RSVD(3) }, 1323 1323 { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1033, 0xff), /* Telit LE910C1-EUX (ECM) */ 1324 1324 .driver_info = NCTRL(0) }, 1325 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1034, 0xff), /* Telit LE910C4-WWX (rmnet) */ 1326 + .driver_info = RSVD(2) }, 1325 1327 { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1035, 0xff) }, /* Telit LE910C4-WWX (ECM) */ 1328 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1036, 0xff) }, /* Telit LE910C4-WWX */ 1329 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1037, 0xff), /* Telit LE910C4-WWX (rmnet) */ 1330 + .driver_info = NCTRL(0) | NCTRL(1) | RSVD(4) }, 1331 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1038, 0xff), /* Telit LE910C4-WWX (rmnet) */ 1332 + .driver_info = NCTRL(0) | RSVD(3) }, 1333 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x103b, 0xff), /* Telit LE910C4-WWX */ 1334 + .driver_info = NCTRL(0) | NCTRL(1) }, 1335 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x103c, 0xff), /* Telit LE910C4-WWX */ 1336 + .driver_info = NCTRL(0) }, 1326 1337 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG0), 1327 1338 .driver_info = RSVD(0) | RSVD(1) | NCTRL(2) | RSVD(3) }, 1328 1339 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG1), ··· 1380 1369 .driver_info = NCTRL(0) | RSVD(1) }, 1381 1370 { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1075, 0xff), /* Telit FN990A (PCIe) */ 1382 1371 .driver_info = RSVD(0) }, 1372 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1077, 0xff), /* Telit FN990A (rmnet + audio) */ 1373 + .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, 1374 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1078, 0xff), /* Telit FN990A (MBIM + audio) */ 1375 + .driver_info = NCTRL(0) | RSVD(1) }, 1376 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1079, 0xff), /* Telit FN990A (RNDIS + audio) */ 1377 + .driver_info = NCTRL(2) | RSVD(3) }, 1383 1378 { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1080, 0xff), /* Telit FE990A (rmnet) */ 1384 1379 .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, 1385 1380 { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1081, 0xff), /* Telit FE990A (MBIM) */
+8 -4
drivers/usb/typec/tcpm/tcpm.c
··· 2426 2426 case ADEV_NONE: 2427 2427 break; 2428 2428 case ADEV_NOTIFY_USB_AND_QUEUE_VDM: 2429 - WARN_ON(typec_altmode_notify(adev, TYPEC_STATE_USB, NULL)); 2430 - typec_altmode_vdm(adev, p[0], &p[1], cnt); 2429 + if (rx_sop_type == TCPC_TX_SOP_PRIME) { 2430 + typec_cable_altmode_vdm(adev, TYPEC_PLUG_SOP_P, p[0], &p[1], cnt); 2431 + } else { 2432 + WARN_ON(typec_altmode_notify(adev, TYPEC_STATE_USB, NULL)); 2433 + typec_altmode_vdm(adev, p[0], &p[1], cnt); 2434 + } 2431 2435 break; 2432 2436 case ADEV_QUEUE_VDM: 2433 - if (response_tx_sop_type == TCPC_TX_SOP_PRIME) 2437 + if (rx_sop_type == TCPC_TX_SOP_PRIME) 2434 2438 typec_cable_altmode_vdm(adev, TYPEC_PLUG_SOP_P, p[0], &p[1], cnt); 2435 2439 else 2436 2440 typec_altmode_vdm(adev, p[0], &p[1], cnt); 2437 2441 break; 2438 2442 case ADEV_QUEUE_VDM_SEND_EXIT_MODE_ON_FAIL: 2439 - if (response_tx_sop_type == TCPC_TX_SOP_PRIME) { 2443 + if (rx_sop_type == TCPC_TX_SOP_PRIME) { 2440 2444 if (typec_cable_altmode_vdm(adev, TYPEC_PLUG_SOP_P, 2441 2445 p[0], &p[1], cnt)) { 2442 2446 int svdm_version = typec_get_cable_svdm_version(