Skip to content

Commit cc02f85

Browse files
committed
Merge tag 'usb-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
I wrote: "USB fixes for 4.19-rc7 Here are some small USB fixes for 4.19-rc7 These include: - the usual xhci bugfixes for reported issues - some new serial driver device ids - bugfix for the option serial driver for some devices - bugfix for the cdc_acm driver that has been there for a long time. All of these have been in linux-next for a while with no reported issues." * tag 'usb-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: xhci-mtk: resume USB3 roothub first xhci: Add missing CAS workaround for Intel Sunrise Point xHCI usb: cdc_acm: Do not leak URB buffers USB: serial: simple: add Motorola Tetra MTP6550 id USB: serial: option: add two-endpoints device-id flag USB: serial: option: improve Quectel EP06 detection
2 parents 055d8d9 + 555df58 commit cc02f85

File tree

5 files changed

+25
-5
lines changed

5 files changed

+25
-5
lines changed

drivers/usb/class/cdc-acm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,6 +1514,7 @@ static void acm_disconnect(struct usb_interface *intf)
15141514
{
15151515
struct acm *acm = usb_get_intfdata(intf);
15161516
struct tty_struct *tty;
1517+
int i;
15171518

15181519
/* sibling interface is already cleaning up */
15191520
if (!acm)
@@ -1544,6 +1545,11 @@ static void acm_disconnect(struct usb_interface *intf)
15441545

15451546
tty_unregister_device(acm_tty_driver, acm->minor);
15461547

1548+
usb_free_urb(acm->ctrlurb);
1549+
for (i = 0; i < ACM_NW; i++)
1550+
usb_free_urb(acm->wb[i].urb);
1551+
for (i = 0; i < acm->rx_buflimit; i++)
1552+
usb_free_urb(acm->read_urbs[i]);
15471553
acm_write_buffers_free(acm);
15481554
usb_free_coherent(acm->dev, acm->ctrlsize, acm->ctrl_buffer, acm->ctrl_dma);
15491555
acm_read_buffers_free(acm);

drivers/usb/host/xhci-mtk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,10 +642,10 @@ static int __maybe_unused xhci_mtk_resume(struct device *dev)
642642
xhci_mtk_host_enable(mtk);
643643

644644
xhci_dbg(xhci, "%s: restart port polling\n", __func__);
645-
set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
646-
usb_hcd_poll_rh_status(hcd);
647645
set_bit(HCD_FLAG_POLL_RH, &xhci->shared_hcd->flags);
648646
usb_hcd_poll_rh_status(xhci->shared_hcd);
647+
set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
648+
usb_hcd_poll_rh_status(hcd);
649649
return 0;
650650
}
651651

drivers/usb/host/xhci-pci.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
185185
}
186186
if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
187187
(pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI ||
188+
pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI ||
189+
pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI ||
188190
pdev->device == PCI_DEVICE_ID_INTEL_APL_XHCI ||
189191
pdev->device == PCI_DEVICE_ID_INTEL_DNV_XHCI))
190192
xhci->quirks |= XHCI_MISSING_CAS;

drivers/usb/serial/option.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,9 @@ static void option_instat_callback(struct urb *urb);
561561
/* Interface is reserved */
562562
#define RSVD(ifnum) ((BIT(ifnum) & 0xff) << 0)
563563

564+
/* Interface must have two endpoints */
565+
#define NUMEP2 BIT(16)
566+
564567

565568
static const struct usb_device_id option_ids[] = {
566569
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
@@ -1081,8 +1084,9 @@ static const struct usb_device_id option_ids[] = {
10811084
.driver_info = RSVD(4) },
10821085
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96),
10831086
.driver_info = RSVD(4) },
1084-
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06),
1085-
.driver_info = RSVD(4) | RSVD(5) },
1087+
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff),
1088+
.driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 },
1089+
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) },
10861090
{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },
10871091
{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) },
10881092
{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003),
@@ -1999,6 +2003,13 @@ static int option_probe(struct usb_serial *serial,
19992003
if (device_flags & RSVD(iface_desc->bInterfaceNumber))
20002004
return -ENODEV;
20012005

2006+
/*
2007+
* Allow matching on bNumEndpoints for devices whose interface numbers
2008+
* can change (e.g. Quectel EP06).
2009+
*/
2010+
if (device_flags & NUMEP2 && iface_desc->bNumEndpoints != 2)
2011+
return -ENODEV;
2012+
20022013
/* Store the device flags so we can use them during attach. */
20032014
usb_set_serial_data(serial, (void *)device_flags);
20042015

drivers/usb/serial/usb-serial-simple.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ DEVICE(moto_modem, MOTO_IDS);
8484

8585
/* Motorola Tetra driver */
8686
#define MOTOROLA_TETRA_IDS() \
87-
{ USB_DEVICE(0x0cad, 0x9011) } /* Motorola Solutions TETRA PEI */
87+
{ USB_DEVICE(0x0cad, 0x9011) }, /* Motorola Solutions TETRA PEI */ \
88+
{ USB_DEVICE(0x0cad, 0x9012) } /* MTP6550 */
8889
DEVICE(motorola_tetra, MOTOROLA_TETRA_IDS);
8990

9091
/* Novatel Wireless GPS driver */

0 commit comments

Comments
 (0)