Skip to content

Commit d784ef5

Browse files
committed
Merge tag 'usb-4.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB driver fixes from Greg KH: "Here are some small USB fixes and new device ids for 4.5-rc2. Nothing major here, full details are in the shortlog, and all of these have been in linux-next successfully" * tag 'usb-4.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: option: fix Cinterion AHxx enumeration USB: mxu11x0: fix memory leak on usb_serial private data USB: serial: ftdi_sio: add support for Yaesu SCU-18 cable USB: serial: option: Adding support for Telit LE922 USB: serial: visor: fix crash on detecting device without write_urbs USB: visor: fix null-deref at probe USB: cp210x: add ID for IAI USB to RS485 adaptor usb: hub: do not clear BOS field during reset device cdc-acm:exclude Samsung phone 04e8:685d usb: cdc-acm: send zero packet for intel 7260 modem usb: cdc-acm: handle unlinked urb in acm read callback
2 parents 54e3f3e + a89a798 commit d784ef5

File tree

9 files changed

+68
-7
lines changed

9 files changed

+68
-7
lines changed

drivers/usb/class/cdc-acm.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,8 @@ static void acm_read_bulk_callback(struct urb *urb)
428428
set_bit(rb->index, &acm->read_urbs_free);
429429
dev_dbg(&acm->data->dev, "%s - non-zero urb status: %d\n",
430430
__func__, status);
431-
return;
431+
if ((status != -ENOENT) || (urb->actual_length == 0))
432+
return;
432433
}
433434

434435
usb_mark_last_busy(acm->dev);
@@ -1404,6 +1405,8 @@ static int acm_probe(struct usb_interface *intf,
14041405
usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress),
14051406
NULL, acm->writesize, acm_write_bulk, snd);
14061407
snd->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
1408+
if (quirks & SEND_ZERO_PACKET)
1409+
snd->urb->transfer_flags |= URB_ZERO_PACKET;
14071410
snd->instance = acm;
14081411
}
14091412

@@ -1838,6 +1841,11 @@ static const struct usb_device_id acm_ids[] = {
18381841
},
18391842
#endif
18401843

1844+
/*Samsung phone in firmware update mode */
1845+
{ USB_DEVICE(0x04e8, 0x685d),
1846+
.driver_info = IGNORE_DEVICE,
1847+
},
1848+
18411849
/* Exclude Infineon Flash Loader utility */
18421850
{ USB_DEVICE(0x058b, 0x0041),
18431851
.driver_info = IGNORE_DEVICE,
@@ -1861,6 +1869,10 @@ static const struct usb_device_id acm_ids[] = {
18611869
{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
18621870
USB_CDC_ACM_PROTO_AT_CDMA) },
18631871

1872+
{ USB_DEVICE(0x1519, 0x0452), /* Intel 7260 modem */
1873+
.driver_info = SEND_ZERO_PACKET,
1874+
},
1875+
18641876
{ }
18651877
};
18661878

drivers/usb/class/cdc-acm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,4 @@ struct acm {
134134
#define IGNORE_DEVICE BIT(5)
135135
#define QUIRK_CONTROL_LINE_STATE BIT(6)
136136
#define CLEAR_HALT_CONDITIONS BIT(7)
137+
#define SEND_ZERO_PACKET BIT(8)

drivers/usb/core/hub.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5401,7 +5401,6 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
54015401
}
54025402

54035403
bos = udev->bos;
5404-
udev->bos = NULL;
54055404

54065405
for (i = 0; i < SET_CONFIG_TRIES; ++i) {
54075406

@@ -5494,8 +5493,11 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
54945493
usb_set_usb2_hardware_lpm(udev, 1);
54955494
usb_unlocked_enable_lpm(udev);
54965495
usb_enable_ltm(udev);
5497-
usb_release_bos_descriptor(udev);
5498-
udev->bos = bos;
5496+
/* release the new BOS descriptor allocated by hub_port_init() */
5497+
if (udev->bos != bos) {
5498+
usb_release_bos_descriptor(udev);
5499+
udev->bos = bos;
5500+
}
54995501
return 0;
55005502

55015503
re_enumerate:

drivers/usb/serial/cp210x.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ static const struct usb_device_id id_table[] = {
9999
{ USB_DEVICE(0x10C4, 0x81AC) }, /* MSD Dash Hawk */
100100
{ USB_DEVICE(0x10C4, 0x81AD) }, /* INSYS USB Modem */
101101
{ USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */
102+
{ USB_DEVICE(0x10C4, 0x81D7) }, /* IAI Corp. RCB-CV-USB USB to RS485 Adaptor */
102103
{ USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */
103104
{ USB_DEVICE(0x10C4, 0x81E7) }, /* Aerocomm Radio */
104105
{ USB_DEVICE(0x10C4, 0x81E8) }, /* Zephyr Bioharness */

drivers/usb/serial/ftdi_sio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,7 @@ static const struct usb_device_id id_table_combined[] = {
824824
{ USB_DEVICE(FTDI_VID, FTDI_TURTELIZER_PID),
825825
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
826826
{ USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
827+
{ USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_SCU18) },
827828
{ USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) },
828829

829830
/* Papouch devices based on FTDI chip */

drivers/usb/serial/ftdi_sio_ids.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@
615615
*/
616616
#define RATOC_VENDOR_ID 0x0584
617617
#define RATOC_PRODUCT_ID_USB60F 0xb020
618+
#define RATOC_PRODUCT_ID_SCU18 0xb03a
618619

619620
/*
620621
* Infineon Technologies

drivers/usb/serial/mxu11x0.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,16 @@ static int mxu1_port_probe(struct usb_serial_port *port)
368368
return 0;
369369
}
370370

371+
static int mxu1_port_remove(struct usb_serial_port *port)
372+
{
373+
struct mxu1_port *mxport;
374+
375+
mxport = usb_get_serial_port_data(port);
376+
kfree(mxport);
377+
378+
return 0;
379+
}
380+
371381
static int mxu1_startup(struct usb_serial *serial)
372382
{
373383
struct mxu1_device *mxdev;
@@ -427,6 +437,14 @@ static int mxu1_startup(struct usb_serial *serial)
427437
return err;
428438
}
429439

440+
static void mxu1_release(struct usb_serial *serial)
441+
{
442+
struct mxu1_device *mxdev;
443+
444+
mxdev = usb_get_serial_data(serial);
445+
kfree(mxdev);
446+
}
447+
430448
static int mxu1_write_byte(struct usb_serial_port *port, u32 addr,
431449
u8 mask, u8 byte)
432450
{
@@ -957,7 +975,9 @@ static struct usb_serial_driver mxu11x0_device = {
957975
.id_table = mxu1_idtable,
958976
.num_ports = 1,
959977
.port_probe = mxu1_port_probe,
978+
.port_remove = mxu1_port_remove,
960979
.attach = mxu1_startup,
980+
.release = mxu1_release,
961981
.open = mxu1_open,
962982
.close = mxu1_close,
963983
.ioctl = mxu1_ioctl,

drivers/usb/serial/option.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ static void option_instat_callback(struct urb *urb);
268268
#define TELIT_PRODUCT_CC864_SINGLE 0x1006
269269
#define TELIT_PRODUCT_DE910_DUAL 0x1010
270270
#define TELIT_PRODUCT_UE910_V2 0x1012
271+
#define TELIT_PRODUCT_LE922_USBCFG0 0x1042
272+
#define TELIT_PRODUCT_LE922_USBCFG3 0x1043
271273
#define TELIT_PRODUCT_LE920 0x1200
272274
#define TELIT_PRODUCT_LE910 0x1201
273275

@@ -615,6 +617,16 @@ static const struct option_blacklist_info telit_le920_blacklist = {
615617
.reserved = BIT(1) | BIT(5),
616618
};
617619

620+
static const struct option_blacklist_info telit_le922_blacklist_usbcfg0 = {
621+
.sendsetup = BIT(2),
622+
.reserved = BIT(0) | BIT(1) | BIT(3),
623+
};
624+
625+
static const struct option_blacklist_info telit_le922_blacklist_usbcfg3 = {
626+
.sendsetup = BIT(0),
627+
.reserved = BIT(1) | BIT(2) | BIT(3),
628+
};
629+
618630
static const struct usb_device_id option_ids[] = {
619631
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
620632
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
@@ -1160,6 +1172,10 @@ static const struct usb_device_id option_ids[] = {
11601172
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_SINGLE) },
11611173
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_DE910_DUAL) },
11621174
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UE910_V2) },
1175+
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG0),
1176+
.driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg0 },
1177+
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG3),
1178+
.driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 },
11631179
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910),
11641180
.driver_info = (kernel_ulong_t)&telit_le910_blacklist },
11651181
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920),
@@ -1679,7 +1695,7 @@ static const struct usb_device_id option_ids[] = {
16791695
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) },
16801696
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8),
16811697
.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
1682-
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX) },
1698+
{ USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX, 0xff) },
16831699
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PLXX),
16841700
.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
16851701
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) },

drivers/usb/serial/visor.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,11 @@ static int treo_attach(struct usb_serial *serial)
544544
(serial->num_interrupt_in == 0))
545545
return 0;
546546

547+
if (serial->num_bulk_in < 2 || serial->num_interrupt_in < 2) {
548+
dev_err(&serial->interface->dev, "missing endpoints\n");
549+
return -ENODEV;
550+
}
551+
547552
/*
548553
* It appears that Treos and Kyoceras want to use the
549554
* 1st bulk in endpoint to communicate with the 2nd bulk out endpoint,
@@ -597,8 +602,10 @@ static int clie_5_attach(struct usb_serial *serial)
597602
*/
598603

599604
/* some sanity check */
600-
if (serial->num_ports < 2)
601-
return -1;
605+
if (serial->num_bulk_out < 2) {
606+
dev_err(&serial->interface->dev, "missing bulk out endpoints\n");
607+
return -ENODEV;
608+
}
602609

603610
/* port 0 now uses the modified endpoint Address */
604611
port = serial->port[0];

0 commit comments

Comments
 (0)