Skip to content

Commit 10a0540

Browse files
committed
Merge tag 'usb-serial-5.11-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus
Johan writes: USB-serial fixes for 5.11-rc3 Here's a fix for a DMA-from-stack issue in iuu_phoenix and a couple of new modem device ids. All have been in linux-next with no reported issues. * tag 'usb-serial-5.11-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: iuu_phoenix: fix DMA from stack USB: serial: option: add LongSung M5710 module support USB: serial: option: add Quectel EM160R-GL
2 parents 96ebc9c + 54d0a3a commit 10a0540

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

drivers/usb/serial/iuu_phoenix.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -532,36 +532,46 @@ static int iuu_uart_flush(struct usb_serial_port *port)
532532
struct device *dev = &port->dev;
533533
int i;
534534
int status;
535-
u8 rxcmd = IUU_UART_RX;
535+
u8 *rxcmd;
536536
struct iuu_private *priv = usb_get_serial_port_data(port);
537537

538538
if (iuu_led(port, 0xF000, 0, 0, 0xFF) < 0)
539539
return -EIO;
540540

541+
rxcmd = kmalloc(1, GFP_KERNEL);
542+
if (!rxcmd)
543+
return -ENOMEM;
544+
545+
rxcmd[0] = IUU_UART_RX;
546+
541547
for (i = 0; i < 2; i++) {
542-
status = bulk_immediate(port, &rxcmd, 1);
548+
status = bulk_immediate(port, rxcmd, 1);
543549
if (status != IUU_OPERATION_OK) {
544550
dev_dbg(dev, "%s - uart_flush_write error\n", __func__);
545-
return status;
551+
goto out_free;
546552
}
547553

548554
status = read_immediate(port, &priv->len, 1);
549555
if (status != IUU_OPERATION_OK) {
550556
dev_dbg(dev, "%s - uart_flush_read error\n", __func__);
551-
return status;
557+
goto out_free;
552558
}
553559

554560
if (priv->len > 0) {
555561
dev_dbg(dev, "%s - uart_flush datalen is : %i\n", __func__, priv->len);
556562
status = read_immediate(port, priv->buf, priv->len);
557563
if (status != IUU_OPERATION_OK) {
558564
dev_dbg(dev, "%s - uart_flush_read error\n", __func__);
559-
return status;
565+
goto out_free;
560566
}
561567
}
562568
}
563569
dev_dbg(dev, "%s - uart_flush_read OK!\n", __func__);
564570
iuu_led(port, 0, 0xF000, 0, 0xFF);
571+
572+
out_free:
573+
kfree(rxcmd);
574+
565575
return status;
566576
}
567577

drivers/usb/serial/option.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,8 @@ static const struct usb_device_id option_ids[] = {
11171117
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0xff, 0xff),
11181118
.driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 },
11191119
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0, 0) },
1120+
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, 0x0620, 0xff, 0xff, 0x30) }, /* EM160R-GL */
1121+
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, 0x0620, 0xff, 0, 0) },
11201122
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x30) },
11211123
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0) },
11221124
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x10),
@@ -2057,6 +2059,7 @@ static const struct usb_device_id option_ids[] = {
20572059
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */
20582060
.driver_info = RSVD(6) },
20592061
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */
2062+
{ USB_DEVICE_INTERFACE_CLASS(0x2df3, 0x9d03, 0xff) }, /* LongSung M5710 */
20602063
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1404, 0xff) }, /* GosunCn GM500 RNDIS */
20612064
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1405, 0xff) }, /* GosunCn GM500 MBIM */
20622065
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */

0 commit comments

Comments
 (0)