Skip to content

Commit df53b81

Browse files
committed
Merge tag 'usb-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH: "Here are some small USB fixes and new device ids: - USB gadget fixes for some reported issues - Fixes for the ever-troublesome apple fastcharge driver, hopefully we finally have it right. - More USB core quirks for odd devices - USB serial driver fixes for some long-standing issues that were recently found - some new USB serial driver device ids All have been in linux-next with no reported issues" * tag 'usb-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: apple-mfi-fastcharge: fix reference leak in apple_mfi_fc_set_property usb: mtu3: fix panic in mtu3_gadget_stop() USB: serial: option: add Telit FN980 composition 0x1055 USB: serial: option: add LE910Cx compositions 0x1203, 0x1230, 0x1231 USB: serial: cyberjack: fix write-URB completion race USB: Add NO_LPM quirk for Kingston flash drive USB: serial: option: add Quectel EC200T module support usb: raw-gadget: fix memory leak in gadget_setup usb: dwc2: Avoid leaving the error_debugfs label unused usb: dwc3: ep0: Fix delay status handling usb: gadget: fsl: fix null pointer checking usb: gadget: goku_udc: fix potential crashes in probe usb: dwc3: pci: add support for the Intel Alder Lake-S
2 parents b4e0044 + db388a6 commit df53b81

File tree

11 files changed

+38
-6
lines changed

11 files changed

+38
-6
lines changed

drivers/usb/core/quirks.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,9 @@ static const struct usb_device_id usb_quirk_list[] = {
378378
{ USB_DEVICE(0x0926, 0x3333), .driver_info =
379379
USB_QUIRK_CONFIG_INTF_STRINGS },
380380

381+
/* Kingston DataTraveler 3.0 */
382+
{ USB_DEVICE(0x0951, 0x1666), .driver_info = USB_QUIRK_NO_LPM },
383+
381384
/* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */
382385
{ USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF },
383386

drivers/usb/dwc2/platform.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,10 +608,13 @@ static int dwc2_driver_probe(struct platform_device *dev)
608608
#endif /* CONFIG_USB_DWC2_PERIPHERAL || CONFIG_USB_DWC2_DUAL_ROLE */
609609
return 0;
610610

611+
#if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \
612+
IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
611613
error_debugfs:
612614
dwc2_debugfs_exit(hsotg);
613615
if (hsotg->hcd_enabled)
614616
dwc2_hcd_remove(hsotg);
617+
#endif
615618
error_drd:
616619
dwc2_drd_exit(hsotg);
617620

drivers/usb/dwc3/dwc3-pci.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#define PCI_DEVICE_ID_INTEL_TGPLP 0xa0ee
4141
#define PCI_DEVICE_ID_INTEL_TGPH 0x43ee
4242
#define PCI_DEVICE_ID_INTEL_JSP 0x4dee
43+
#define PCI_DEVICE_ID_INTEL_ADLS 0x7ae1
4344

4445
#define PCI_INTEL_BXT_DSM_GUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511"
4546
#define PCI_INTEL_BXT_FUNC_PMU_PWR 4
@@ -367,6 +368,9 @@ static const struct pci_device_id dwc3_pci_id_table[] = {
367368
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_JSP),
368369
(kernel_ulong_t) &dwc3_pci_intel_properties, },
369370

371+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ADLS),
372+
(kernel_ulong_t) &dwc3_pci_intel_properties, },
373+
370374
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_NL_USB),
371375
(kernel_ulong_t) &dwc3_pci_amd_properties, },
372376
{ } /* Terminating Entry */

drivers/usb/dwc3/ep0.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,10 +1058,11 @@ void dwc3_ep0_send_delayed_status(struct dwc3 *dwc)
10581058
{
10591059
unsigned int direction = !dwc->ep0_expect_in;
10601060

1061+
dwc->delayed_status = false;
1062+
10611063
if (dwc->ep0state != EP0_STATUS_PHASE)
10621064
return;
10631065

1064-
dwc->delayed_status = false;
10651066
__dwc3_ep0_do_control_status(dwc, dwc->eps[direction]);
10661067
}
10671068

drivers/usb/gadget/legacy/raw_gadget.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,9 +564,12 @@ static int raw_ioctl_event_fetch(struct raw_dev *dev, unsigned long value)
564564
return -ENODEV;
565565
}
566566
length = min(arg.length, event->length);
567-
if (copy_to_user((void __user *)value, event, sizeof(*event) + length))
567+
if (copy_to_user((void __user *)value, event, sizeof(*event) + length)) {
568+
kfree(event);
568569
return -EFAULT;
570+
}
569571

572+
kfree(event);
570573
return 0;
571574
}
572575

drivers/usb/gadget/udc/fsl_udc_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ static int fsl_ep_fifo_status(struct usb_ep *_ep)
10511051
u32 bitmask;
10521052
struct ep_queue_head *qh;
10531053

1054-
if (!_ep || _ep->desc || !(_ep->desc->bEndpointAddress&0xF))
1054+
if (!_ep || !_ep->desc || !(_ep->desc->bEndpointAddress&0xF))
10551055
return -ENODEV;
10561056

10571057
ep = container_of(_ep, struct fsl_ep, ep);

drivers/usb/gadget/udc/goku_udc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1760,6 +1760,7 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
17601760
goto err;
17611761
}
17621762

1763+
pci_set_drvdata(pdev, dev);
17631764
spin_lock_init(&dev->lock);
17641765
dev->pdev = pdev;
17651766
dev->gadget.ops = &goku_ops;
@@ -1793,7 +1794,6 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
17931794
}
17941795
dev->regs = (struct goku_udc_regs __iomem *) base;
17951796

1796-
pci_set_drvdata(pdev, dev);
17971797
INFO(dev, "%s\n", driver_desc);
17981798
INFO(dev, "version: " DRIVER_VERSION " %s\n", dmastr());
17991799
INFO(dev, "irq %d, pci mem %p\n", pdev->irq, base);

drivers/usb/misc/apple-mfi-fastcharge.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,10 @@ static int apple_mfi_fc_set_property(struct power_supply *psy,
120120
dev_dbg(&mfi->udev->dev, "prop: %d\n", psp);
121121

122122
ret = pm_runtime_get_sync(&mfi->udev->dev);
123-
if (ret < 0)
123+
if (ret < 0) {
124+
pm_runtime_put_noidle(&mfi->udev->dev);
124125
return ret;
126+
}
125127

126128
switch (psp) {
127129
case POWER_SUPPLY_PROP_CHARGE_TYPE:

drivers/usb/mtu3/mtu3_gadget.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@ static int mtu3_gadget_stop(struct usb_gadget *g)
564564

565565
spin_unlock_irqrestore(&mtu->lock, flags);
566566

567+
synchronize_irq(mtu->irq);
567568
return 0;
568569
}
569570

drivers/usb/serial/cyberjack.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,11 +357,12 @@ static void cyberjack_write_bulk_callback(struct urb *urb)
357357
struct device *dev = &port->dev;
358358
int status = urb->status;
359359
unsigned long flags;
360+
bool resubmitted = false;
360361

361-
set_bit(0, &port->write_urbs_free);
362362
if (status) {
363363
dev_dbg(dev, "%s - nonzero write bulk status received: %d\n",
364364
__func__, status);
365+
set_bit(0, &port->write_urbs_free);
365366
return;
366367
}
367368

@@ -394,6 +395,8 @@ static void cyberjack_write_bulk_callback(struct urb *urb)
394395
goto exit;
395396
}
396397

398+
resubmitted = true;
399+
397400
dev_dbg(dev, "%s - priv->wrsent=%d\n", __func__, priv->wrsent);
398401
dev_dbg(dev, "%s - priv->wrfilled=%d\n", __func__, priv->wrfilled);
399402

@@ -410,6 +413,8 @@ static void cyberjack_write_bulk_callback(struct urb *urb)
410413

411414
exit:
412415
spin_unlock_irqrestore(&priv->lock, flags);
416+
if (!resubmitted)
417+
set_bit(0, &port->write_urbs_free);
413418
usb_serial_port_softint(port);
414419
}
415420

drivers/usb/serial/option.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ static void option_instat_callback(struct urb *urb);
250250
#define QUECTEL_PRODUCT_EP06 0x0306
251251
#define QUECTEL_PRODUCT_EM12 0x0512
252252
#define QUECTEL_PRODUCT_RM500Q 0x0800
253+
#define QUECTEL_PRODUCT_EC200T 0x6026
253254

254255
#define CMOTECH_VENDOR_ID 0x16d8
255256
#define CMOTECH_PRODUCT_6001 0x6001
@@ -1117,6 +1118,7 @@ static const struct usb_device_id option_ids[] = {
11171118
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0) },
11181119
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x10),
11191120
.driver_info = ZLP },
1121+
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) },
11201122

11211123
{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },
11221124
{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) },
@@ -1189,6 +1191,8 @@ static const struct usb_device_id option_ids[] = {
11891191
.driver_info = NCTRL(0) | RSVD(1) },
11901192
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1054, 0xff), /* Telit FT980-KS */
11911193
.driver_info = NCTRL(2) | RSVD(3) },
1194+
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1055, 0xff), /* Telit FN980 (PCIe) */
1195+
.driver_info = NCTRL(0) | RSVD(1) },
11921196
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910),
11931197
.driver_info = NCTRL(0) | RSVD(1) | RSVD(3) },
11941198
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
@@ -1201,6 +1205,8 @@ static const struct usb_device_id option_ids[] = {
12011205
.driver_info = NCTRL(0) },
12021206
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910),
12031207
.driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
1208+
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1203, 0xff), /* Telit LE910Cx (RNDIS) */
1209+
.driver_info = NCTRL(2) | RSVD(3) },
12041210
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4),
12051211
.driver_info = NCTRL(0) | RSVD(1) | RSVD(2) | RSVD(3) },
12061212
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920),
@@ -1215,6 +1221,10 @@ static const struct usb_device_id option_ids[] = {
12151221
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1213, 0xff) },
12161222
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1214),
12171223
.driver_info = NCTRL(0) | RSVD(1) | RSVD(2) | RSVD(3) },
1224+
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1230, 0xff), /* Telit LE910Cx (rmnet) */
1225+
.driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
1226+
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1231, 0xff), /* Telit LE910Cx (RNDIS) */
1227+
.driver_info = NCTRL(2) | RSVD(3) },
12181228
{ USB_DEVICE(TELIT_VENDOR_ID, 0x1260),
12191229
.driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
12201230
{ USB_DEVICE(TELIT_VENDOR_ID, 0x1261),

0 commit comments

Comments
 (0)