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

Pull USB fixes from Greg KH:
"Here are a few small USB fixes, and one thunderbolt fix, for 5.8-rc6.

Nothing huge in here, just the normal collection of gadget, dwc2/3,
serial, and other minor USB driver fixes and id additions. Full
details are in the shortlog.

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

* tag 'usb-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
USB: serial: iuu_phoenix: fix memory corruption
USB: c67x00: fix use after free in c67x00_giveback_urb
usb: gadget: function: fix missing spinlock in f_uac1_legacy
usb: gadget: udc: atmel: fix uninitialized read in debug printk
usb: gadget: udc: atmel: remove outdated comment in usba_ep_disable()
usb: dwc2: Fix shutdown callback in platform
usb: cdns3: trace: fix some endian issues
usb: cdns3: ep0: fix some endian issues
usb: gadget: udc: gr_udc: fix memleak on error handling path in gr_ep_init()
usb: gadget: fix langid kernel-doc warning in usbstring.c
usb: dwc3: pci: add support for the Intel Jasper Lake
usb: dwc3: pci: add support for the Intel Tiger Lake PCH -H variant
usb: chipidea: core: add wakeup support for extcon
USB: serial: option: add Quectel EG95 LTE modem
thunderbolt: Fix path indices used in USB3 tunnel discovery
USB: serial: ch341: add new Product ID for CH340
USB: serial: option: add GosunCn GM500 series
USB: serial: cypress_m8: enable Simply Automated UPB PIM

+88 -42
+8 -8
drivers/thunderbolt/tunnel.c
··· 913 913 * case. 914 914 */ 915 915 path = tb_path_discover(down, TB_USB3_HOPID, NULL, -1, 916 - &tunnel->dst_port, "USB3 Up"); 916 + &tunnel->dst_port, "USB3 Down"); 917 917 if (!path) { 918 918 /* Just disable the downstream port */ 919 919 tb_usb3_port_enable(down, false); 920 920 goto err_free; 921 921 } 922 - tunnel->paths[TB_USB3_PATH_UP] = path; 923 - tb_usb3_init_path(tunnel->paths[TB_USB3_PATH_UP]); 924 - 925 - path = tb_path_discover(tunnel->dst_port, -1, down, TB_USB3_HOPID, NULL, 926 - "USB3 Down"); 927 - if (!path) 928 - goto err_deactivate; 929 922 tunnel->paths[TB_USB3_PATH_DOWN] = path; 930 923 tb_usb3_init_path(tunnel->paths[TB_USB3_PATH_DOWN]); 924 + 925 + path = tb_path_discover(tunnel->dst_port, -1, down, TB_USB3_HOPID, NULL, 926 + "USB3 Up"); 927 + if (!path) 928 + goto err_deactivate; 929 + tunnel->paths[TB_USB3_PATH_UP] = path; 930 + tb_usb3_init_path(tunnel->paths[TB_USB3_PATH_UP]); 931 931 932 932 /* Validate that the tunnel is complete */ 933 933 if (!tb_port_is_usb3_up(tunnel->dst_port)) {
+1 -1
drivers/usb/c67x00/c67x00-sched.c
··· 486 486 c67x00_release_urb(c67x00, urb); 487 487 usb_hcd_unlink_urb_from_ep(c67x00_hcd_to_hcd(c67x00), urb); 488 488 spin_unlock(&c67x00->lock); 489 - usb_hcd_giveback_urb(c67x00_hcd_to_hcd(c67x00), urb, urbp->status); 489 + usb_hcd_giveback_urb(c67x00_hcd_to_hcd(c67x00), urb, status); 490 490 spin_lock(&c67x00->lock); 491 491 } 492 492
+15 -15
drivers/usb/cdns3/ep0.c
··· 37 37 struct cdns3_usb_regs __iomem *regs = priv_dev->regs; 38 38 struct cdns3_endpoint *priv_ep = priv_dev->eps[0]; 39 39 40 - priv_ep->trb_pool[0].buffer = TRB_BUFFER(dma_addr); 41 - priv_ep->trb_pool[0].length = TRB_LEN(length); 40 + priv_ep->trb_pool[0].buffer = cpu_to_le32(TRB_BUFFER(dma_addr)); 41 + priv_ep->trb_pool[0].length = cpu_to_le32(TRB_LEN(length)); 42 42 43 43 if (zlp) { 44 - priv_ep->trb_pool[0].control = TRB_CYCLE | TRB_TYPE(TRB_NORMAL); 45 - priv_ep->trb_pool[1].buffer = TRB_BUFFER(dma_addr); 46 - priv_ep->trb_pool[1].length = TRB_LEN(0); 47 - priv_ep->trb_pool[1].control = TRB_CYCLE | TRB_IOC | 48 - TRB_TYPE(TRB_NORMAL); 44 + priv_ep->trb_pool[0].control = cpu_to_le32(TRB_CYCLE | TRB_TYPE(TRB_NORMAL)); 45 + priv_ep->trb_pool[1].buffer = cpu_to_le32(TRB_BUFFER(dma_addr)); 46 + priv_ep->trb_pool[1].length = cpu_to_le32(TRB_LEN(0)); 47 + priv_ep->trb_pool[1].control = cpu_to_le32(TRB_CYCLE | TRB_IOC | 48 + TRB_TYPE(TRB_NORMAL)); 49 49 } else { 50 - priv_ep->trb_pool[0].control = TRB_CYCLE | TRB_IOC | 51 - TRB_TYPE(TRB_NORMAL); 50 + priv_ep->trb_pool[0].control = cpu_to_le32(TRB_CYCLE | TRB_IOC | 51 + TRB_TYPE(TRB_NORMAL)); 52 52 priv_ep->trb_pool[1].control = 0; 53 53 } 54 54 ··· 264 264 case USB_RECIP_INTERFACE: 265 265 return cdns3_ep0_delegate_req(priv_dev, ctrl); 266 266 case USB_RECIP_ENDPOINT: 267 - index = cdns3_ep_addr_to_index(ctrl->wIndex); 267 + index = cdns3_ep_addr_to_index(le16_to_cpu(ctrl->wIndex)); 268 268 priv_ep = priv_dev->eps[index]; 269 269 270 270 /* check if endpoint is stalled or stall is pending */ 271 - cdns3_select_ep(priv_dev, ctrl->wIndex); 271 + cdns3_select_ep(priv_dev, le16_to_cpu(ctrl->wIndex)); 272 272 if (EP_STS_STALL(readl(&priv_dev->regs->ep_sts)) || 273 273 (priv_ep->flags & EP_STALL_PENDING)) 274 274 usb_status = BIT(USB_ENDPOINT_HALT); ··· 381 381 if (!(ctrl->wIndex & ~USB_DIR_IN)) 382 382 return 0; 383 383 384 - index = cdns3_ep_addr_to_index(ctrl->wIndex); 384 + index = cdns3_ep_addr_to_index(le16_to_cpu(ctrl->wIndex)); 385 385 priv_ep = priv_dev->eps[index]; 386 386 387 - cdns3_select_ep(priv_dev, ctrl->wIndex); 387 + cdns3_select_ep(priv_dev, le16_to_cpu(ctrl->wIndex)); 388 388 389 389 if (set) 390 390 __cdns3_gadget_ep_set_halt(priv_ep); ··· 445 445 if (priv_dev->gadget.state < USB_STATE_ADDRESS) 446 446 return -EINVAL; 447 447 448 - if (ctrl_req->wLength != 6) { 448 + if (le16_to_cpu(ctrl_req->wLength) != 6) { 449 449 dev_err(priv_dev->dev, "Set SEL should be 6 bytes, got %d\n", 450 450 ctrl_req->wLength); 451 451 return -EINVAL; ··· 469 469 if (ctrl_req->wIndex || ctrl_req->wLength) 470 470 return -EINVAL; 471 471 472 - priv_dev->isoch_delay = ctrl_req->wValue; 472 + priv_dev->isoch_delay = le16_to_cpu(ctrl_req->wValue); 473 473 474 474 return 0; 475 475 }
+3 -3
drivers/usb/cdns3/trace.h
··· 404 404 TP_fast_assign( 405 405 __assign_str(name, priv_ep->name); 406 406 __entry->trb = trb; 407 - __entry->buffer = trb->buffer; 408 - __entry->length = trb->length; 409 - __entry->control = trb->control; 407 + __entry->buffer = le32_to_cpu(trb->buffer); 408 + __entry->length = le32_to_cpu(trb->length); 409 + __entry->control = le32_to_cpu(trb->control); 410 410 __entry->type = usb_endpoint_type(priv_ep->endpoint.desc); 411 411 __entry->last_stream_id = priv_ep->last_stream_id; 412 412 ),
+24
drivers/usb/chipidea/core.c
··· 1243 1243 enable_irq(ci->irq); 1244 1244 } 1245 1245 1246 + /* 1247 + * Handle the wakeup interrupt triggered by extcon connector 1248 + * We need to call ci_irq again for extcon since the first 1249 + * interrupt (wakeup int) only let the controller be out of 1250 + * low power mode, but not handle any interrupts. 1251 + */ 1252 + static void ci_extcon_wakeup_int(struct ci_hdrc *ci) 1253 + { 1254 + struct ci_hdrc_cable *cable_id, *cable_vbus; 1255 + u32 otgsc = hw_read_otgsc(ci, ~0); 1256 + 1257 + cable_id = &ci->platdata->id_extcon; 1258 + cable_vbus = &ci->platdata->vbus_extcon; 1259 + 1260 + if (!IS_ERR(cable_id->edev) && ci->is_otg && 1261 + (otgsc & OTGSC_IDIE) && (otgsc & OTGSC_IDIS)) 1262 + ci_irq(ci->irq, ci); 1263 + 1264 + if (!IS_ERR(cable_vbus->edev) && ci->is_otg && 1265 + (otgsc & OTGSC_BSVIE) && (otgsc & OTGSC_BSVIS)) 1266 + ci_irq(ci->irq, ci); 1267 + } 1268 + 1246 1269 static int ci_controller_resume(struct device *dev) 1247 1270 { 1248 1271 struct ci_hdrc *ci = dev_get_drvdata(dev); ··· 1298 1275 enable_irq(ci->irq); 1299 1276 if (ci_otg_is_fsm_mode(ci)) 1300 1277 ci_otg_fsm_wakeup_by_srp(ci); 1278 + ci_extcon_wakeup_int(ci); 1301 1279 } 1302 1280 1303 1281 return 0;
+2 -1
drivers/usb/dwc2/platform.c
··· 342 342 { 343 343 struct dwc2_hsotg *hsotg = platform_get_drvdata(dev); 344 344 345 - disable_irq(hsotg->irq); 345 + dwc2_disable_global_interrupts(hsotg); 346 + synchronize_irq(hsotg->irq); 346 347 } 347 348 348 349 /**
+8
drivers/usb/dwc3/dwc3-pci.c
··· 38 38 #define PCI_DEVICE_ID_INTEL_ICLLP 0x34ee 39 39 #define PCI_DEVICE_ID_INTEL_EHLLP 0x4b7e 40 40 #define PCI_DEVICE_ID_INTEL_TGPLP 0xa0ee 41 + #define PCI_DEVICE_ID_INTEL_TGPH 0x43ee 42 + #define PCI_DEVICE_ID_INTEL_JSP 0x4dee 41 43 42 44 #define PCI_INTEL_BXT_DSM_GUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511" 43 45 #define PCI_INTEL_BXT_FUNC_PMU_PWR 4 ··· 358 356 (kernel_ulong_t) &dwc3_pci_intel_properties, }, 359 357 360 358 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_TGPLP), 359 + (kernel_ulong_t) &dwc3_pci_intel_properties, }, 360 + 361 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_TGPH), 362 + (kernel_ulong_t) &dwc3_pci_intel_properties, }, 363 + 364 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_JSP), 361 365 (kernel_ulong_t) &dwc3_pci_intel_properties, }, 362 366 363 367 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_NL_USB),
+2
drivers/usb/gadget/function/f_uac1_legacy.c
··· 336 336 337 337 /* Copy buffer is full, add it to the play_queue */ 338 338 if (audio_buf_size - copy_buf->actual < req->actual) { 339 + spin_lock_irq(&audio->lock); 339 340 list_add_tail(&copy_buf->list, &audio->play_queue); 341 + spin_unlock_irq(&audio->lock); 340 342 schedule_work(&audio->playback_work); 341 343 copy_buf = f_audio_buffer_alloc(audio_buf_size); 342 344 if (IS_ERR(copy_buf))
+2 -8
drivers/usb/gadget/udc/atmel_usba_udc.c
··· 676 676 677 677 if (!ep->ep.desc) { 678 678 spin_unlock_irqrestore(&udc->lock, flags); 679 - /* REVISIT because this driver disables endpoints in 680 - * reset_all_endpoints() before calling disconnect(), 681 - * most gadget drivers would trigger this non-error ... 682 - */ 683 - if (udc->gadget.speed != USB_SPEED_UNKNOWN) 684 - DBG(DBG_ERR, "ep_disable: %s not enabled\n", 685 - ep->ep.name); 679 + DBG(DBG_ERR, "ep_disable: %s not enabled\n", ep->ep.name); 686 680 return -EINVAL; 687 681 } 688 682 ep->ep.desc = NULL; ··· 865 871 u32 status; 866 872 867 873 DBG(DBG_GADGET | DBG_QUEUE, "ep_dequeue: %s, req %p\n", 868 - ep->ep.name, req); 874 + ep->ep.name, _req); 869 875 870 876 spin_lock_irqsave(&udc->lock, flags); 871 877
+5 -2
drivers/usb/gadget/udc/gr_udc.c
··· 1980 1980 1981 1981 if (num == 0) { 1982 1982 _req = gr_alloc_request(&ep->ep, GFP_ATOMIC); 1983 + if (!_req) 1984 + return -ENOMEM; 1985 + 1983 1986 buf = devm_kzalloc(dev->dev, PAGE_SIZE, GFP_DMA | GFP_ATOMIC); 1984 - if (!_req || !buf) { 1985 - /* possible _req freed by gr_probe via gr_remove */ 1987 + if (!buf) { 1988 + gr_free_request(&ep->ep, _req); 1986 1989 return -ENOMEM; 1987 1990 } 1988 1991
+1 -1
drivers/usb/gadget/usbstring.c
··· 68 68 69 69 /** 70 70 * usb_validate_langid - validate usb language identifiers 71 - * @lang: usb language identifier 71 + * @langid: usb language identifier 72 72 * 73 73 * Returns true for valid language identifier, otherwise false. 74 74 */
+1
drivers/usb/serial/ch341.c
··· 77 77 78 78 static const struct usb_device_id id_table[] = { 79 79 { USB_DEVICE(0x4348, 0x5523) }, 80 + { USB_DEVICE(0x1a86, 0x7522) }, 80 81 { USB_DEVICE(0x1a86, 0x7523) }, 81 82 { USB_DEVICE(0x1a86, 0x5523) }, 82 83 { },
+2
drivers/usb/serial/cypress_m8.c
··· 59 59 60 60 static const struct usb_device_id id_table_cyphidcomrs232[] = { 61 61 { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) }, 62 + { USB_DEVICE(VENDOR_ID_SAI, PRODUCT_ID_CYPHIDCOM) }, 62 63 { USB_DEVICE(VENDOR_ID_POWERCOM, PRODUCT_ID_UPS) }, 63 64 { USB_DEVICE(VENDOR_ID_FRWD, PRODUCT_ID_CYPHIDCOM_FRWD) }, 64 65 { } /* Terminating entry */ ··· 74 73 { USB_DEVICE(VENDOR_ID_DELORME, PRODUCT_ID_EARTHMATEUSB) }, 75 74 { USB_DEVICE(VENDOR_ID_DELORME, PRODUCT_ID_EARTHMATEUSB_LT20) }, 76 75 { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) }, 76 + { USB_DEVICE(VENDOR_ID_SAI, PRODUCT_ID_CYPHIDCOM) }, 77 77 { USB_DEVICE(VENDOR_ID_POWERCOM, PRODUCT_ID_UPS) }, 78 78 { USB_DEVICE(VENDOR_ID_FRWD, PRODUCT_ID_CYPHIDCOM_FRWD) }, 79 79 { USB_DEVICE(VENDOR_ID_DAZZLE, PRODUCT_ID_CA42) },
+3
drivers/usb/serial/cypress_m8.h
··· 25 25 #define VENDOR_ID_CYPRESS 0x04b4 26 26 #define PRODUCT_ID_CYPHIDCOM 0x5500 27 27 28 + /* Simply Automated HID->COM UPB PIM (using Cypress PID 0x5500) */ 29 + #define VENDOR_ID_SAI 0x17dd 30 + 28 31 /* FRWD Dongle - a GPS sports watch */ 29 32 #define VENDOR_ID_FRWD 0x6737 30 33 #define PRODUCT_ID_CYPHIDCOM_FRWD 0x0001
+5 -3
drivers/usb/serial/iuu_phoenix.c
··· 697 697 struct iuu_private *priv = usb_get_serial_port_data(port); 698 698 unsigned long flags; 699 699 700 - if (count > 256) 701 - return -ENOMEM; 702 - 703 700 spin_lock_irqsave(&priv->lock, flags); 701 + 702 + count = min(count, 256 - priv->writelen); 703 + if (count == 0) 704 + goto out; 704 705 705 706 /* fill the buffer */ 706 707 memcpy(priv->writebuf + priv->writelen, buf, count); 707 708 priv->writelen += count; 709 + out: 708 710 spin_unlock_irqrestore(&priv->lock, flags); 709 711 710 712 return count;
+6
drivers/usb/serial/option.c
··· 245 245 /* These Quectel products use Quectel's vendor ID */ 246 246 #define QUECTEL_PRODUCT_EC21 0x0121 247 247 #define QUECTEL_PRODUCT_EC25 0x0125 248 + #define QUECTEL_PRODUCT_EG95 0x0195 248 249 #define QUECTEL_PRODUCT_BG96 0x0296 249 250 #define QUECTEL_PRODUCT_EP06 0x0306 250 251 #define QUECTEL_PRODUCT_EM12 0x0512 ··· 1097 1096 { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21), 1098 1097 .driver_info = RSVD(4) }, 1099 1098 { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25), 1099 + .driver_info = RSVD(4) }, 1100 + { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95), 1100 1101 .driver_info = RSVD(4) }, 1101 1102 { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), 1102 1103 .driver_info = RSVD(4) }, ··· 2031 2028 .driver_info = RSVD(4) | RSVD(5) }, 2032 2029 { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */ 2033 2030 .driver_info = RSVD(6) }, 2031 + { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1404, 0xff) }, /* GosunCn GM500 RNDIS */ 2032 + { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1405, 0xff) }, /* GosunCn GM500 MBIM */ 2033 + { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */ 2034 2034 { } /* Terminating entry */ 2035 2035 }; 2036 2036 MODULE_DEVICE_TABLE(usb, option_ids);