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.10-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.10-rc7 that resolve a number of
reported issues, and add some new device ids.

Nothing major here, but these solve some problems that people were
having with the 5.10-rc tree:

- reverts for USB storage dma settings that broke working devices

- thunderbolt use-after-free fix

- cdns3 driver fixes

- gadget driver userspace copy fix

- new device ids

All of these except for the reverts have been in linux-next with no
reported issues. The reverts are "clean" and were tested by Hans, as
well as passing the 0-day tests"

* tag 'usb-5.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
usb: gadget: f_fs: Use local copy of descriptors for userspace copy
usb: ohci-omap: Fix descriptor conversion
Revert "usb-storage: fix sdev->host->dma_dev"
Revert "uas: fix sdev->host->dma_dev"
Revert "uas: bump hw_max_sectors to 2048 blocks for SS or faster drives"
USB: serial: kl5kusb105: fix memleak on open
USB: serial: ch341: sort device-id entries
USB: serial: ch341: add new Product ID for CH341A
USB: serial: option: fix Quectel BG96 matching
usb: cdns3: core: fix goto label for error path
usb: cdns3: gadget: clear trb->length as zero after preparing every trb
usb: cdns3: Fix hardware based role switch
USB: serial: option: add support for Thales Cinterion EXS82
USB: serial: option: add Fibocom NL668 variants
thunderbolt: Fix use-after-free in remove_unplugged_switch()

+53 -50
+1 -1
arch/arm/mach-omap1/board-osk.c
··· 288 288 .dev_id = "ohci", 289 289 .table = { 290 290 /* Power GPIO on the I2C-attached TPS65010 */ 291 - GPIO_LOOKUP("i2c-tps65010", 1, "power", GPIO_ACTIVE_HIGH), 291 + GPIO_LOOKUP("tps65010", 0, "power", GPIO_ACTIVE_HIGH), 292 292 GPIO_LOOKUP(OMAP_GPIO_LABEL, 9, "overcurrent", 293 293 GPIO_ACTIVE_HIGH), 294 294 },
+7 -3
drivers/thunderbolt/icm.c
··· 1976 1976 1977 1977 static void remove_unplugged_switch(struct tb_switch *sw) 1978 1978 { 1979 - pm_runtime_get_sync(sw->dev.parent); 1979 + struct device *parent = get_device(sw->dev.parent); 1980 + 1981 + pm_runtime_get_sync(parent); 1980 1982 1981 1983 /* 1982 1984 * Signal this and switches below for rpm_complete because ··· 1989 1987 bus_for_each_dev(&tb_bus_type, &sw->dev, NULL, complete_rpm); 1990 1988 tb_switch_remove(sw); 1991 1989 1992 - pm_runtime_mark_last_busy(sw->dev.parent); 1993 - pm_runtime_put_autosuspend(sw->dev.parent); 1990 + pm_runtime_mark_last_busy(parent); 1991 + pm_runtime_put_autosuspend(parent); 1992 + 1993 + put_device(parent); 1994 1994 } 1995 1995 1996 1996 static void icm_free_unplugged_children(struct tb_switch *sw)
+16 -13
drivers/usb/cdns3/core.c
··· 427 427 */ 428 428 static int cdns3_probe(struct platform_device *pdev) 429 429 { 430 - struct usb_role_switch_desc sw_desc = { }; 431 430 struct device *dev = &pdev->dev; 432 431 struct resource *res; 433 432 struct cdns3 *cdns; ··· 528 529 if (ret) 529 530 goto err2; 530 531 531 - sw_desc.set = cdns3_role_set; 532 - sw_desc.get = cdns3_role_get; 533 - sw_desc.allow_userspace_control = true; 534 - sw_desc.driver_data = cdns; 535 - if (device_property_read_bool(dev, "usb-role-switch")) 532 + if (device_property_read_bool(dev, "usb-role-switch")) { 533 + struct usb_role_switch_desc sw_desc = { }; 534 + 535 + sw_desc.set = cdns3_role_set; 536 + sw_desc.get = cdns3_role_get; 537 + sw_desc.allow_userspace_control = true; 538 + sw_desc.driver_data = cdns; 536 539 sw_desc.fwnode = dev->fwnode; 537 540 538 - cdns->role_sw = usb_role_switch_register(dev, &sw_desc); 539 - if (IS_ERR(cdns->role_sw)) { 540 - ret = PTR_ERR(cdns->role_sw); 541 - dev_warn(dev, "Unable to register Role Switch\n"); 542 - goto err3; 541 + cdns->role_sw = usb_role_switch_register(dev, &sw_desc); 542 + if (IS_ERR(cdns->role_sw)) { 543 + ret = PTR_ERR(cdns->role_sw); 544 + dev_warn(dev, "Unable to register Role Switch\n"); 545 + goto err3; 546 + } 543 547 } 544 548 545 549 if (cdns->wakeup_irq) { ··· 553 551 554 552 if (ret) { 555 553 dev_err(cdns->dev, "couldn't register wakeup irq handler\n"); 556 - goto err3; 554 + goto err4; 557 555 } 558 556 } 559 557 ··· 584 582 return 0; 585 583 err4: 586 584 cdns3_drd_exit(cdns); 587 - usb_role_switch_unregister(cdns->role_sw); 585 + if (cdns->role_sw) 586 + usb_role_switch_unregister(cdns->role_sw); 588 587 err3: 589 588 set_phy_power_off(cdns); 590 589 err2:
+1
drivers/usb/cdns3/gadget.c
··· 1260 1260 priv_req->end_trb = priv_ep->enqueue; 1261 1261 cdns3_ep_inc_enq(priv_ep); 1262 1262 trb = priv_ep->trb_pool + priv_ep->enqueue; 1263 + trb->length = 0; 1263 1264 } while (sg_iter < num_trb); 1264 1265 1265 1266 trb = priv_req->trb;
+4 -2
drivers/usb/gadget/function/f_fs.c
··· 1324 1324 case FUNCTIONFS_ENDPOINT_DESC: 1325 1325 { 1326 1326 int desc_idx; 1327 - struct usb_endpoint_descriptor *desc; 1327 + struct usb_endpoint_descriptor desc1, *desc; 1328 1328 1329 1329 switch (epfile->ffs->gadget->speed) { 1330 1330 case USB_SPEED_SUPER: ··· 1336 1336 default: 1337 1337 desc_idx = 0; 1338 1338 } 1339 + 1339 1340 desc = epfile->ep->descs[desc_idx]; 1341 + memcpy(&desc1, desc, desc->bLength); 1340 1342 1341 1343 spin_unlock_irq(&epfile->ffs->eps_lock); 1342 - ret = copy_to_user((void __user *)value, desc, desc->bLength); 1344 + ret = copy_to_user((void __user *)value, &desc1, desc1.bLength); 1343 1345 if (ret) 1344 1346 ret = -EFAULT; 1345 1347 return ret;
+2 -2
drivers/usb/host/ohci-omap.c
··· 91 91 | ((1 << 5/*usb1*/) | (1 << 3/*usb2*/)), 92 92 INNOVATOR_FPGA_CAM_USB_CONTROL); 93 93 else if (priv->power) 94 - gpiod_set_value(priv->power, 0); 94 + gpiod_set_value_cansleep(priv->power, 0); 95 95 } else { 96 96 if (machine_is_omap_innovator() && cpu_is_omap1510()) 97 97 __raw_writeb(__raw_readb(INNOVATOR_FPGA_CAM_USB_CONTROL) 98 98 & ~((1 << 5/*usb1*/) | (1 << 3/*usb2*/)), 99 99 INNOVATOR_FPGA_CAM_USB_CONTROL); 100 100 else if (priv->power) 101 - gpiod_set_value(priv->power, 1); 101 + gpiod_set_value_cansleep(priv->power, 1); 102 102 } 103 103 104 104 return 0;
+3 -2
drivers/usb/serial/ch341.c
··· 81 81 #define CH341_QUIRK_SIMULATE_BREAK BIT(1) 82 82 83 83 static const struct usb_device_id id_table[] = { 84 - { USB_DEVICE(0x4348, 0x5523) }, 84 + { USB_DEVICE(0x1a86, 0x5512) }, 85 + { USB_DEVICE(0x1a86, 0x5523) }, 85 86 { USB_DEVICE(0x1a86, 0x7522) }, 86 87 { USB_DEVICE(0x1a86, 0x7523) }, 87 - { USB_DEVICE(0x1a86, 0x5523) }, 88 + { USB_DEVICE(0x4348, 0x5523) }, 88 89 { }, 89 90 }; 90 91 MODULE_DEVICE_TABLE(usb, id_table);
+4 -6
drivers/usb/serial/kl5kusb105.c
··· 276 276 priv->cfg.unknown2 = cfg->unknown2; 277 277 spin_unlock_irqrestore(&priv->lock, flags); 278 278 279 + kfree(cfg); 280 + 279 281 /* READ_ON and urb submission */ 280 282 rc = usb_serial_generic_open(tty, port); 281 - if (rc) { 282 - retval = rc; 283 - goto err_free_cfg; 284 - } 283 + if (rc) 284 + return rc; 285 285 286 286 rc = usb_control_msg(port->serial->dev, 287 287 usb_sndctrlpipe(port->serial->dev, 0), ··· 324 324 KLSI_TIMEOUT); 325 325 err_generic_close: 326 326 usb_serial_generic_close(port); 327 - err_free_cfg: 328 - kfree(cfg); 329 327 330 328 return retval; 331 329 }
+6 -4
drivers/usb/serial/option.c
··· 419 419 #define CINTERION_PRODUCT_PH8 0x0053 420 420 #define CINTERION_PRODUCT_AHXX 0x0055 421 421 #define CINTERION_PRODUCT_PLXX 0x0060 422 + #define CINTERION_PRODUCT_EXS82 0x006c 422 423 #define CINTERION_PRODUCT_PH8_2RMNET 0x0082 423 424 #define CINTERION_PRODUCT_PH8_AUDIO 0x0083 424 425 #define CINTERION_PRODUCT_AHXX_2RMNET 0x0084 ··· 1106 1105 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0xff, 0xff), 1107 1106 .driver_info = NUMEP2 }, 1108 1107 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0, 0) }, 1109 - { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96, 0xff, 0xff, 0xff), 1110 - .driver_info = NUMEP2 }, 1111 - { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96, 0xff, 0, 0) }, 1108 + { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), 1109 + .driver_info = RSVD(4) }, 1112 1110 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff), 1113 1111 .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 }, 1114 1112 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) }, ··· 1902 1902 { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX_AUDIO, 0xff) }, 1903 1903 { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_CLS8, 0xff), 1904 1904 .driver_info = RSVD(0) | RSVD(4) }, 1905 + { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EXS82, 0xff) }, 1905 1906 { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, 1906 1907 { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, 1907 1908 { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDM) }, ··· 2047 2046 .driver_info = RSVD(0) | RSVD(1) | RSVD(6) }, 2048 2047 { USB_DEVICE(0x0489, 0xe0b5), /* Foxconn T77W968 ESIM */ 2049 2048 .driver_info = RSVD(0) | RSVD(1) | RSVD(6) }, 2050 - { USB_DEVICE(0x1508, 0x1001), /* Fibocom NL668 */ 2049 + { USB_DEVICE(0x1508, 0x1001), /* Fibocom NL668 (IOT version) */ 2051 2050 .driver_info = RSVD(4) | RSVD(5) | RSVD(6) }, 2052 2051 { USB_DEVICE(0x2cb7, 0x0104), /* Fibocom NL678 series */ 2053 2052 .driver_info = RSVD(4) | RSVD(5) }, 2054 2053 { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */ 2055 2054 .driver_info = RSVD(6) }, 2055 + { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */ 2056 2056 { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1404, 0xff) }, /* GosunCn GM500 RNDIS */ 2057 2057 { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1405, 0xff) }, /* GosunCn GM500 MBIM */ 2058 2058 { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */
+1 -1
drivers/usb/storage/scsiglue.c
··· 92 92 static int slave_configure(struct scsi_device *sdev) 93 93 { 94 94 struct us_data *us = host_to_us(sdev->host); 95 - struct device *dev = sdev->host->dma_dev; 95 + struct device *dev = us->pusb_dev->bus->sysdev; 96 96 97 97 /* 98 98 * Many devices have trouble transferring more than 32KB at a time,
+6 -13
drivers/usb/storage/uas.c
··· 837 837 */ 838 838 blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1)); 839 839 840 + if (devinfo->flags & US_FL_MAX_SECTORS_64) 841 + blk_queue_max_hw_sectors(sdev->request_queue, 64); 842 + else if (devinfo->flags & US_FL_MAX_SECTORS_240) 843 + blk_queue_max_hw_sectors(sdev->request_queue, 240); 844 + 840 845 return 0; 841 846 } 842 847 843 848 static int uas_slave_configure(struct scsi_device *sdev) 844 849 { 845 850 struct uas_dev_info *devinfo = sdev->hostdata; 846 - struct device *dev = sdev->host->dma_dev; 847 - 848 - if (devinfo->flags & US_FL_MAX_SECTORS_64) 849 - blk_queue_max_hw_sectors(sdev->request_queue, 64); 850 - else if (devinfo->flags & US_FL_MAX_SECTORS_240) 851 - blk_queue_max_hw_sectors(sdev->request_queue, 240); 852 - else if (devinfo->udev->speed >= USB_SPEED_SUPER) 853 - blk_queue_max_hw_sectors(sdev->request_queue, 2048); 854 - 855 - blk_queue_max_hw_sectors(sdev->request_queue, 856 - min_t(size_t, queue_max_hw_sectors(sdev->request_queue), 857 - dma_max_mapping_size(dev) >> SECTOR_SHIFT)); 858 851 859 852 if (devinfo->flags & US_FL_NO_REPORT_OPCODES) 860 853 sdev->no_report_opcodes = 1; ··· 1033 1040 shost->can_queue = devinfo->qdepth - 2; 1034 1041 1035 1042 usb_set_intfdata(intf, shost); 1036 - result = scsi_add_host_with_dma(shost, &intf->dev, udev->bus->sysdev); 1043 + result = scsi_add_host(shost, &intf->dev); 1037 1044 if (result) 1038 1045 goto free_streams; 1039 1046
+2 -3
drivers/usb/storage/usb.c
··· 1049 1049 goto BadDevice; 1050 1050 usb_autopm_get_interface_no_resume(us->pusb_intf); 1051 1051 snprintf(us->scsi_name, sizeof(us->scsi_name), "usb-storage %s", 1052 - dev_name(dev)); 1053 - result = scsi_add_host_with_dma(us_to_host(us), dev, 1054 - us->pusb_dev->bus->sysdev); 1052 + dev_name(&us->pusb_intf->dev)); 1053 + result = scsi_add_host(us_to_host(us), dev); 1055 1054 if (result) { 1056 1055 dev_warn(dev, 1057 1056 "Unable to add the scsi host\n");