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

Pull USB driver fixes from Greg KH:
"Here are some small USB driver fixes and new device ids for 5.19-rc4
for a few small reported issues. They include:

- new usb-serial driver ids

- MAINTAINERS file update to properly catch the USB dts files

- dt-bindings fixes for reported build warnings

- xhci driver fixes for reported problems

- typec Kconfig dependancy fix

- raw_gadget fuzzing fixes found by syzbot

- chipidea driver bugfix

- usb gadget uvc bugfix

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

* tag 'usb-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
usb: chipidea: udc: check request status before setting device address
USB: gadget: Fix double-free bug in raw_gadget driver
xhci-pci: Allow host runtime PM as default for Intel Meteor Lake xHCI
xhci-pci: Allow host runtime PM as default for Intel Raptor Lake xHCI
xhci: turn off port power in shutdown
xhci: Keep interrupt disabled in initialization until host is running.
USB: serial: option: add Quectel RM500K module support
USB: serial: option: add Quectel EM05-G modem
USB: serial: pl2303: add support for more HXN (G) types
usb: typec: wcove: Drop wrong dependency to INTEL_SOC_PMIC
usb: gadget: uvc: fix list double add in uvcg_video_pump
dt-bindings: usb: ehci: Increase the number of PHYs
dt-bindings: usb: ohci: Increase the number of PHYs
usb: gadget: Fix non-unique driver names in raw-gadget driver
MAINTAINERS: add include/dt-bindings/usb to USB SUBSYSTEM
USB: serial: option: add Telit LE910Cx 0x1250 composition

+124 -48
+2 -1
Documentation/devicetree/bindings/usb/generic-ehci.yaml
··· 136 136 Phandle of a companion. 137 137 138 138 phys: 139 - maxItems: 1 139 + minItems: 1 140 + maxItems: 3 140 141 141 142 phy-names: 142 143 const: usb
+2 -1
Documentation/devicetree/bindings/usb/generic-ohci.yaml
··· 103 103 Overrides the detected port count 104 104 105 105 phys: 106 - maxItems: 1 106 + minItems: 1 107 + maxItems: 3 107 108 108 109 phy-names: 109 110 const: usb
+1
MAINTAINERS
··· 20749 20749 F: Documentation/devicetree/bindings/usb/ 20750 20750 F: Documentation/usb/ 20751 20751 F: drivers/usb/ 20752 + F: include/dt-bindings/usb/ 20752 20753 F: include/linux/usb.h 20753 20754 F: include/linux/usb/ 20754 20755
+3
drivers/usb/chipidea/udc.c
··· 1048 1048 struct ci_hdrc *ci = req->context; 1049 1049 unsigned long flags; 1050 1050 1051 + if (req->status < 0) 1052 + return; 1053 + 1051 1054 if (ci->setaddr) { 1052 1055 hw_usb_set_address(ci, ci->address); 1053 1056 ci->setaddr = false;
+3
drivers/usb/gadget/function/uvc_video.c
··· 424 424 uvcg_queue_cancel(queue, 0); 425 425 break; 426 426 } 427 + 428 + /* Endpoint now owns the request */ 429 + req = NULL; 427 430 video->req_int_count++; 428 431 } 429 432
+47 -16
drivers/usb/gadget/legacy/raw_gadget.c
··· 11 11 #include <linux/ctype.h> 12 12 #include <linux/debugfs.h> 13 13 #include <linux/delay.h> 14 + #include <linux/idr.h> 14 15 #include <linux/kref.h> 15 16 #include <linux/miscdevice.h> 16 17 #include <linux/module.h> ··· 36 35 MODULE_LICENSE("GPL"); 37 36 38 37 /*----------------------------------------------------------------------*/ 38 + 39 + static DEFINE_IDA(driver_id_numbers); 40 + #define DRIVER_DRIVER_NAME_LENGTH_MAX 32 39 41 40 42 #define RAW_EVENT_QUEUE_SIZE 16 41 43 ··· 165 161 /* Reference to misc device: */ 166 162 struct device *dev; 167 163 164 + /* Make driver names unique */ 165 + int driver_id_number; 166 + 168 167 /* Protected by lock: */ 169 168 enum dev_state state; 170 169 bool gadget_registered; ··· 196 189 spin_lock_init(&dev->lock); 197 190 init_completion(&dev->ep0_done); 198 191 raw_event_queue_init(&dev->queue); 192 + dev->driver_id_number = -1; 199 193 return dev; 200 194 } 201 195 ··· 207 199 208 200 kfree(dev->udc_name); 209 201 kfree(dev->driver.udc_name); 202 + kfree(dev->driver.driver.name); 203 + if (dev->driver_id_number >= 0) 204 + ida_free(&driver_id_numbers, dev->driver_id_number); 210 205 if (dev->req) { 211 206 if (dev->ep0_urb_queued) 212 207 usb_ep_dequeue(dev->gadget->ep0, dev->req); ··· 430 419 static int raw_ioctl_init(struct raw_dev *dev, unsigned long value) 431 420 { 432 421 int ret = 0; 422 + int driver_id_number; 433 423 struct usb_raw_init arg; 434 424 char *udc_driver_name; 435 425 char *udc_device_name; 426 + char *driver_driver_name; 436 427 unsigned long flags; 437 428 438 429 if (copy_from_user(&arg, (void __user *)value, sizeof(arg))) ··· 453 440 return -EINVAL; 454 441 } 455 442 443 + driver_id_number = ida_alloc(&driver_id_numbers, GFP_KERNEL); 444 + if (driver_id_number < 0) 445 + return driver_id_number; 446 + 447 + driver_driver_name = kmalloc(DRIVER_DRIVER_NAME_LENGTH_MAX, GFP_KERNEL); 448 + if (!driver_driver_name) { 449 + ret = -ENOMEM; 450 + goto out_free_driver_id_number; 451 + } 452 + snprintf(driver_driver_name, DRIVER_DRIVER_NAME_LENGTH_MAX, 453 + DRIVER_NAME ".%d", driver_id_number); 454 + 456 455 udc_driver_name = kmalloc(UDC_NAME_LENGTH_MAX, GFP_KERNEL); 457 - if (!udc_driver_name) 458 - return -ENOMEM; 456 + if (!udc_driver_name) { 457 + ret = -ENOMEM; 458 + goto out_free_driver_driver_name; 459 + } 459 460 ret = strscpy(udc_driver_name, &arg.driver_name[0], 460 461 UDC_NAME_LENGTH_MAX); 461 - if (ret < 0) { 462 - kfree(udc_driver_name); 463 - return ret; 464 - } 462 + if (ret < 0) 463 + goto out_free_udc_driver_name; 465 464 ret = 0; 466 465 467 466 udc_device_name = kmalloc(UDC_NAME_LENGTH_MAX, GFP_KERNEL); 468 467 if (!udc_device_name) { 469 - kfree(udc_driver_name); 470 - return -ENOMEM; 468 + ret = -ENOMEM; 469 + goto out_free_udc_driver_name; 471 470 } 472 471 ret = strscpy(udc_device_name, &arg.device_name[0], 473 472 UDC_NAME_LENGTH_MAX); 474 - if (ret < 0) { 475 - kfree(udc_driver_name); 476 - kfree(udc_device_name); 477 - return ret; 478 - } 473 + if (ret < 0) 474 + goto out_free_udc_device_name; 479 475 ret = 0; 480 476 481 477 spin_lock_irqsave(&dev->lock, flags); 482 478 if (dev->state != STATE_DEV_OPENED) { 483 479 dev_dbg(dev->dev, "fail, device is not opened\n"); 484 - kfree(udc_driver_name); 485 - kfree(udc_device_name); 486 480 ret = -EINVAL; 487 481 goto out_unlock; 488 482 } ··· 504 484 dev->driver.suspend = gadget_suspend; 505 485 dev->driver.resume = gadget_resume; 506 486 dev->driver.reset = gadget_reset; 507 - dev->driver.driver.name = DRIVER_NAME; 487 + dev->driver.driver.name = driver_driver_name; 508 488 dev->driver.udc_name = udc_device_name; 509 489 dev->driver.match_existing_only = 1; 490 + dev->driver_id_number = driver_id_number; 510 491 511 492 dev->state = STATE_DEV_INITIALIZED; 493 + spin_unlock_irqrestore(&dev->lock, flags); 494 + return ret; 512 495 513 496 out_unlock: 514 497 spin_unlock_irqrestore(&dev->lock, flags); 498 + out_free_udc_device_name: 499 + kfree(udc_device_name); 500 + out_free_udc_driver_name: 501 + kfree(udc_driver_name); 502 + out_free_driver_driver_name: 503 + kfree(driver_driver_name); 504 + out_free_driver_id_number: 505 + ida_free(&driver_id_numbers, driver_id_number); 515 506 return ret; 516 507 } 517 508
+1 -1
drivers/usb/host/xhci-hub.c
··· 652 652 * It will release and re-aquire the lock while calling ACPI 653 653 * method. 654 654 */ 655 - static void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd, 655 + void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd, 656 656 u16 index, bool on, unsigned long *flags) 657 657 __must_hold(&xhci->lock) 658 658 {
+5 -1
drivers/usb/host/xhci-pci.c
··· 61 61 #define PCI_DEVICE_ID_INTEL_ALDER_LAKE_XHCI 0x461e 62 62 #define PCI_DEVICE_ID_INTEL_ALDER_LAKE_N_XHCI 0x464e 63 63 #define PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI 0x51ed 64 + #define PCI_DEVICE_ID_INTEL_RAPTOR_LAKE_XHCI 0xa71e 65 + #define PCI_DEVICE_ID_INTEL_METEOR_LAKE_XHCI 0x7ec0 64 66 65 67 #define PCI_DEVICE_ID_AMD_RENOIR_XHCI 0x1639 66 68 #define PCI_DEVICE_ID_AMD_PROMONTORYA_4 0x43b9 ··· 271 269 pdev->device == PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI || 272 270 pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_XHCI || 273 271 pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_N_XHCI || 274 - pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI)) 272 + pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI || 273 + pdev->device == PCI_DEVICE_ID_INTEL_RAPTOR_LAKE_XHCI || 274 + pdev->device == PCI_DEVICE_ID_INTEL_METEOR_LAKE_XHCI)) 275 275 xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW; 276 276 277 277 if (pdev->vendor == PCI_VENDOR_ID_ETRON &&
+35 -15
drivers/usb/host/xhci.c
··· 611 611 612 612 static int xhci_run_finished(struct xhci_hcd *xhci) 613 613 { 614 + unsigned long flags; 615 + u32 temp; 616 + 617 + /* 618 + * Enable interrupts before starting the host (xhci 4.2 and 5.5.2). 619 + * Protect the short window before host is running with a lock 620 + */ 621 + spin_lock_irqsave(&xhci->lock, flags); 622 + 623 + xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Enable interrupts"); 624 + temp = readl(&xhci->op_regs->command); 625 + temp |= (CMD_EIE); 626 + writel(temp, &xhci->op_regs->command); 627 + 628 + xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Enable primary interrupter"); 629 + temp = readl(&xhci->ir_set->irq_pending); 630 + writel(ER_IRQ_ENABLE(temp), &xhci->ir_set->irq_pending); 631 + 614 632 if (xhci_start(xhci)) { 615 633 xhci_halt(xhci); 634 + spin_unlock_irqrestore(&xhci->lock, flags); 616 635 return -ENODEV; 617 636 } 637 + 618 638 xhci->cmd_ring_state = CMD_RING_STATE_RUNNING; 619 639 620 640 if (xhci->quirks & XHCI_NEC_HOST) 621 641 xhci_ring_cmd_db(xhci); 642 + 643 + spin_unlock_irqrestore(&xhci->lock, flags); 622 644 623 645 return 0; 624 646 } ··· 689 667 temp &= ~ER_IRQ_INTERVAL_MASK; 690 668 temp |= (xhci->imod_interval / 250) & ER_IRQ_INTERVAL_MASK; 691 669 writel(temp, &xhci->ir_set->irq_control); 692 - 693 - /* Set the HCD state before we enable the irqs */ 694 - temp = readl(&xhci->op_regs->command); 695 - temp |= (CMD_EIE); 696 - xhci_dbg_trace(xhci, trace_xhci_dbg_init, 697 - "// Enable interrupts, cmd = 0x%x.", temp); 698 - writel(temp, &xhci->op_regs->command); 699 - 700 - temp = readl(&xhci->ir_set->irq_pending); 701 - xhci_dbg_trace(xhci, trace_xhci_dbg_init, 702 - "// Enabling event ring interrupter %p by writing 0x%x to irq_pending", 703 - xhci->ir_set, (unsigned int) ER_IRQ_ENABLE(temp)); 704 - writel(ER_IRQ_ENABLE(temp), &xhci->ir_set->irq_pending); 705 670 706 671 if (xhci->quirks & XHCI_NEC_HOST) { 707 672 struct xhci_command *command; ··· 791 782 void xhci_shutdown(struct usb_hcd *hcd) 792 783 { 793 784 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 785 + unsigned long flags; 786 + int i; 794 787 795 788 if (xhci->quirks & XHCI_SPURIOUS_REBOOT) 796 789 usb_disable_xhci_ports(to_pci_dev(hcd->self.sysdev)); ··· 808 797 del_timer_sync(&xhci->shared_hcd->rh_timer); 809 798 } 810 799 811 - spin_lock_irq(&xhci->lock); 800 + spin_lock_irqsave(&xhci->lock, flags); 812 801 xhci_halt(xhci); 802 + 803 + /* Power off USB2 ports*/ 804 + for (i = 0; i < xhci->usb2_rhub.num_ports; i++) 805 + xhci_set_port_power(xhci, xhci->main_hcd, i, false, &flags); 806 + 807 + /* Power off USB3 ports*/ 808 + for (i = 0; i < xhci->usb3_rhub.num_ports; i++) 809 + xhci_set_port_power(xhci, xhci->shared_hcd, i, false, &flags); 810 + 813 811 /* Workaround for spurious wakeups at shutdown with HSW */ 814 812 if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) 815 813 xhci_reset(xhci, XHCI_RESET_SHORT_USEC); 816 - spin_unlock_irq(&xhci->lock); 814 + spin_unlock_irqrestore(&xhci->lock, flags); 817 815 818 816 xhci_cleanup_msix(xhci); 819 817
+2
drivers/usb/host/xhci.h
··· 2196 2196 int xhci_hub_status_data(struct usb_hcd *hcd, char *buf); 2197 2197 int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1); 2198 2198 struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd); 2199 + void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd, u16 index, 2200 + bool on, unsigned long *flags); 2199 2201 2200 2202 void xhci_hc_died(struct xhci_hcd *xhci); 2201 2203
+6
drivers/usb/serial/option.c
··· 252 252 #define QUECTEL_PRODUCT_EG95 0x0195 253 253 #define QUECTEL_PRODUCT_BG96 0x0296 254 254 #define QUECTEL_PRODUCT_EP06 0x0306 255 + #define QUECTEL_PRODUCT_EM05G 0x030a 255 256 #define QUECTEL_PRODUCT_EM12 0x0512 256 257 #define QUECTEL_PRODUCT_RM500Q 0x0800 257 258 #define QUECTEL_PRODUCT_EC200S_CN 0x6002 258 259 #define QUECTEL_PRODUCT_EC200T 0x6026 260 + #define QUECTEL_PRODUCT_RM500K 0x7001 259 261 260 262 #define CMOTECH_VENDOR_ID 0x16d8 261 263 #define CMOTECH_PRODUCT_6001 0x6001 ··· 1136 1134 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff), 1137 1135 .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 }, 1138 1136 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) }, 1137 + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G, 0xff), 1138 + .driver_info = RSVD(6) | ZLP }, 1139 1139 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0xff, 0xff), 1140 1140 .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 }, 1141 1141 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0, 0) }, ··· 1151 1147 .driver_info = ZLP }, 1152 1148 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) }, 1153 1149 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) }, 1150 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500K, 0xff, 0x00, 0x00) }, 1154 1151 1155 1152 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, 1156 1153 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) }, ··· 1284 1279 .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, 1285 1280 { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1231, 0xff), /* Telit LE910Cx (RNDIS) */ 1286 1281 .driver_info = NCTRL(2) | RSVD(3) }, 1282 + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x1250, 0xff, 0x00, 0x00) }, /* Telit LE910Cx (rmnet) */ 1287 1283 { USB_DEVICE(TELIT_VENDOR_ID, 0x1260), 1288 1284 .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, 1289 1285 { USB_DEVICE(TELIT_VENDOR_ID, 0x1261),
+17 -12
drivers/usb/serial/pl2303.c
··· 436 436 break; 437 437 case 0x200: 438 438 switch (bcdDevice) { 439 - case 0x100: 439 + case 0x100: /* GC */ 440 440 case 0x105: 441 + return TYPE_HXN; 442 + case 0x300: /* GT / TA */ 443 + if (pl2303_supports_hx_status(serial)) 444 + return TYPE_TA; 445 + fallthrough; 441 446 case 0x305: 447 + case 0x400: /* GL */ 442 448 case 0x405: 449 + return TYPE_HXN; 450 + case 0x500: /* GE / TB */ 451 + if (pl2303_supports_hx_status(serial)) 452 + return TYPE_TB; 453 + fallthrough; 454 + case 0x505: 455 + case 0x600: /* GS */ 443 456 case 0x605: 444 - /* 445 - * Assume it's an HXN-type if the device doesn't 446 - * support the old read request value. 447 - */ 448 - if (!pl2303_supports_hx_status(serial)) 449 - return TYPE_HXN; 450 - break; 451 - case 0x300: 452 - return TYPE_TA; 453 - case 0x500: 454 - return TYPE_TB; 457 + case 0x700: /* GR */ 458 + case 0x705: 459 + return TYPE_HXN; 455 460 } 456 461 break; 457 462 }
-1
drivers/usb/typec/tcpm/Kconfig
··· 56 56 tristate "Intel WhiskeyCove PMIC USB Type-C PHY driver" 57 57 depends on ACPI 58 58 depends on MFD_INTEL_PMC_BXT 59 - depends on INTEL_SOC_PMIC 60 59 depends on BXT_WC_PMIC_OPREGION 61 60 help 62 61 This driver adds support for USB Type-C on Intel Broxton platforms