Commit d784ef58 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 54e3f3e3 a89a798a
...@@ -428,7 +428,8 @@ static void acm_read_bulk_callback(struct urb *urb) ...@@ -428,7 +428,8 @@ static void acm_read_bulk_callback(struct urb *urb)
set_bit(rb->index, &acm->read_urbs_free); set_bit(rb->index, &acm->read_urbs_free);
dev_dbg(&acm->data->dev, "%s - non-zero urb status: %d\n", dev_dbg(&acm->data->dev, "%s - non-zero urb status: %d\n",
__func__, status); __func__, status);
return; if ((status != -ENOENT) || (urb->actual_length == 0))
return;
} }
usb_mark_last_busy(acm->dev); usb_mark_last_busy(acm->dev);
...@@ -1404,6 +1405,8 @@ static int acm_probe(struct usb_interface *intf, ...@@ -1404,6 +1405,8 @@ static int acm_probe(struct usb_interface *intf,
usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress), usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress),
NULL, acm->writesize, acm_write_bulk, snd); NULL, acm->writesize, acm_write_bulk, snd);
snd->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; snd->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
if (quirks & SEND_ZERO_PACKET)
snd->urb->transfer_flags |= URB_ZERO_PACKET;
snd->instance = acm; snd->instance = acm;
} }
...@@ -1838,6 +1841,11 @@ static const struct usb_device_id acm_ids[] = { ...@@ -1838,6 +1841,11 @@ static const struct usb_device_id acm_ids[] = {
}, },
#endif #endif
/*Samsung phone in firmware update mode */
{ USB_DEVICE(0x04e8, 0x685d),
.driver_info = IGNORE_DEVICE,
},
/* Exclude Infineon Flash Loader utility */ /* Exclude Infineon Flash Loader utility */
{ USB_DEVICE(0x058b, 0x0041), { USB_DEVICE(0x058b, 0x0041),
.driver_info = IGNORE_DEVICE, .driver_info = IGNORE_DEVICE,
...@@ -1861,6 +1869,10 @@ static const struct usb_device_id acm_ids[] = { ...@@ -1861,6 +1869,10 @@ static const struct usb_device_id acm_ids[] = {
{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
USB_CDC_ACM_PROTO_AT_CDMA) }, USB_CDC_ACM_PROTO_AT_CDMA) },
{ USB_DEVICE(0x1519, 0x0452), /* Intel 7260 modem */
.driver_info = SEND_ZERO_PACKET,
},
{ } { }
}; };
......
...@@ -134,3 +134,4 @@ struct acm { ...@@ -134,3 +134,4 @@ struct acm {
#define IGNORE_DEVICE BIT(5) #define IGNORE_DEVICE BIT(5)
#define QUIRK_CONTROL_LINE_STATE BIT(6) #define QUIRK_CONTROL_LINE_STATE BIT(6)
#define CLEAR_HALT_CONDITIONS BIT(7) #define CLEAR_HALT_CONDITIONS BIT(7)
#define SEND_ZERO_PACKET BIT(8)
...@@ -5401,7 +5401,6 @@ static int usb_reset_and_verify_device(struct usb_device *udev) ...@@ -5401,7 +5401,6 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
} }
bos = udev->bos; bos = udev->bos;
udev->bos = NULL;
for (i = 0; i < SET_CONFIG_TRIES; ++i) { for (i = 0; i < SET_CONFIG_TRIES; ++i) {
...@@ -5494,8 +5493,11 @@ static int usb_reset_and_verify_device(struct usb_device *udev) ...@@ -5494,8 +5493,11 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
usb_set_usb2_hardware_lpm(udev, 1); usb_set_usb2_hardware_lpm(udev, 1);
usb_unlocked_enable_lpm(udev); usb_unlocked_enable_lpm(udev);
usb_enable_ltm(udev); usb_enable_ltm(udev);
usb_release_bos_descriptor(udev); /* release the new BOS descriptor allocated by hub_port_init() */
udev->bos = bos; if (udev->bos != bos) {
usb_release_bos_descriptor(udev);
udev->bos = bos;
}
return 0; return 0;
re_enumerate: re_enumerate:
......
...@@ -99,6 +99,7 @@ static const struct usb_device_id id_table[] = { ...@@ -99,6 +99,7 @@ static const struct usb_device_id id_table[] = {
{ USB_DEVICE(0x10C4, 0x81AC) }, /* MSD Dash Hawk */ { USB_DEVICE(0x10C4, 0x81AC) }, /* MSD Dash Hawk */
{ USB_DEVICE(0x10C4, 0x81AD) }, /* INSYS USB Modem */ { USB_DEVICE(0x10C4, 0x81AD) }, /* INSYS USB Modem */
{ USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */ { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */
{ USB_DEVICE(0x10C4, 0x81D7) }, /* IAI Corp. RCB-CV-USB USB to RS485 Adaptor */
{ USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */ { USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */
{ USB_DEVICE(0x10C4, 0x81E7) }, /* Aerocomm Radio */ { USB_DEVICE(0x10C4, 0x81E7) }, /* Aerocomm Radio */
{ USB_DEVICE(0x10C4, 0x81E8) }, /* Zephyr Bioharness */ { USB_DEVICE(0x10C4, 0x81E8) }, /* Zephyr Bioharness */
......
...@@ -824,6 +824,7 @@ static const struct usb_device_id id_table_combined[] = { ...@@ -824,6 +824,7 @@ static const struct usb_device_id id_table_combined[] = {
{ USB_DEVICE(FTDI_VID, FTDI_TURTELIZER_PID), { USB_DEVICE(FTDI_VID, FTDI_TURTELIZER_PID),
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
{ USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) }, { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
{ USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_SCU18) },
{ USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) }, { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) },
/* Papouch devices based on FTDI chip */ /* Papouch devices based on FTDI chip */
......
...@@ -615,6 +615,7 @@ ...@@ -615,6 +615,7 @@
*/ */
#define RATOC_VENDOR_ID 0x0584 #define RATOC_VENDOR_ID 0x0584
#define RATOC_PRODUCT_ID_USB60F 0xb020 #define RATOC_PRODUCT_ID_USB60F 0xb020
#define RATOC_PRODUCT_ID_SCU18 0xb03a
/* /*
* Infineon Technologies * Infineon Technologies
......
...@@ -368,6 +368,16 @@ static int mxu1_port_probe(struct usb_serial_port *port) ...@@ -368,6 +368,16 @@ static int mxu1_port_probe(struct usb_serial_port *port)
return 0; return 0;
} }
static int mxu1_port_remove(struct usb_serial_port *port)
{
struct mxu1_port *mxport;
mxport = usb_get_serial_port_data(port);
kfree(mxport);
return 0;
}
static int mxu1_startup(struct usb_serial *serial) static int mxu1_startup(struct usb_serial *serial)
{ {
struct mxu1_device *mxdev; struct mxu1_device *mxdev;
...@@ -427,6 +437,14 @@ static int mxu1_startup(struct usb_serial *serial) ...@@ -427,6 +437,14 @@ static int mxu1_startup(struct usb_serial *serial)
return err; return err;
} }
static void mxu1_release(struct usb_serial *serial)
{
struct mxu1_device *mxdev;
mxdev = usb_get_serial_data(serial);
kfree(mxdev);
}
static int mxu1_write_byte(struct usb_serial_port *port, u32 addr, static int mxu1_write_byte(struct usb_serial_port *port, u32 addr,
u8 mask, u8 byte) u8 mask, u8 byte)
{ {
...@@ -957,7 +975,9 @@ static struct usb_serial_driver mxu11x0_device = { ...@@ -957,7 +975,9 @@ static struct usb_serial_driver mxu11x0_device = {
.id_table = mxu1_idtable, .id_table = mxu1_idtable,
.num_ports = 1, .num_ports = 1,
.port_probe = mxu1_port_probe, .port_probe = mxu1_port_probe,
.port_remove = mxu1_port_remove,
.attach = mxu1_startup, .attach = mxu1_startup,
.release = mxu1_release,
.open = mxu1_open, .open = mxu1_open,
.close = mxu1_close, .close = mxu1_close,
.ioctl = mxu1_ioctl, .ioctl = mxu1_ioctl,
......
...@@ -268,6 +268,8 @@ static void option_instat_callback(struct urb *urb); ...@@ -268,6 +268,8 @@ static void option_instat_callback(struct urb *urb);
#define TELIT_PRODUCT_CC864_SINGLE 0x1006 #define TELIT_PRODUCT_CC864_SINGLE 0x1006
#define TELIT_PRODUCT_DE910_DUAL 0x1010 #define TELIT_PRODUCT_DE910_DUAL 0x1010
#define TELIT_PRODUCT_UE910_V2 0x1012 #define TELIT_PRODUCT_UE910_V2 0x1012
#define TELIT_PRODUCT_LE922_USBCFG0 0x1042
#define TELIT_PRODUCT_LE922_USBCFG3 0x1043
#define TELIT_PRODUCT_LE920 0x1200 #define TELIT_PRODUCT_LE920 0x1200
#define TELIT_PRODUCT_LE910 0x1201 #define TELIT_PRODUCT_LE910 0x1201
...@@ -615,6 +617,16 @@ static const struct option_blacklist_info telit_le920_blacklist = { ...@@ -615,6 +617,16 @@ static const struct option_blacklist_info telit_le920_blacklist = {
.reserved = BIT(1) | BIT(5), .reserved = BIT(1) | BIT(5),
}; };
static const struct option_blacklist_info telit_le922_blacklist_usbcfg0 = {
.sendsetup = BIT(2),
.reserved = BIT(0) | BIT(1) | BIT(3),
};
static const struct option_blacklist_info telit_le922_blacklist_usbcfg3 = {
.sendsetup = BIT(0),
.reserved = BIT(1) | BIT(2) | BIT(3),
};
static const struct usb_device_id option_ids[] = { static const struct usb_device_id option_ids[] = {
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
...@@ -1160,6 +1172,10 @@ static const struct usb_device_id option_ids[] = { ...@@ -1160,6 +1172,10 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_SINGLE) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_SINGLE) },
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_DE910_DUAL) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_DE910_DUAL) },
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UE910_V2) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UE910_V2) },
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG0),
.driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg0 },
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG3),
.driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 },
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910), { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910),
.driver_info = (kernel_ulong_t)&telit_le910_blacklist }, .driver_info = (kernel_ulong_t)&telit_le910_blacklist },
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920), { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920),
...@@ -1679,7 +1695,7 @@ static const struct usb_device_id option_ids[] = { ...@@ -1679,7 +1695,7 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) },
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8), { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8),
.driver_info = (kernel_ulong_t)&net_intf4_blacklist }, .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX) }, { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX, 0xff) },
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PLXX), { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PLXX),
.driver_info = (kernel_ulong_t)&net_intf4_blacklist }, .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) },
......
...@@ -544,6 +544,11 @@ static int treo_attach(struct usb_serial *serial) ...@@ -544,6 +544,11 @@ static int treo_attach(struct usb_serial *serial)
(serial->num_interrupt_in == 0)) (serial->num_interrupt_in == 0))
return 0; return 0;
if (serial->num_bulk_in < 2 || serial->num_interrupt_in < 2) {
dev_err(&serial->interface->dev, "missing endpoints\n");
return -ENODEV;
}
/* /*
* It appears that Treos and Kyoceras want to use the * It appears that Treos and Kyoceras want to use the
* 1st bulk in endpoint to communicate with the 2nd bulk out endpoint, * 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) ...@@ -597,8 +602,10 @@ static int clie_5_attach(struct usb_serial *serial)
*/ */
/* some sanity check */ /* some sanity check */
if (serial->num_ports < 2) if (serial->num_bulk_out < 2) {
return -1; dev_err(&serial->interface->dev, "missing bulk out endpoints\n");
return -ENODEV;
}
/* port 0 now uses the modified endpoint Address */ /* port 0 now uses the modified endpoint Address */
port = serial->port[0]; port = serial->port[0];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment