mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
USB-serial fixes for v3.18-rc5
Here are a few fixes for reported problems including a possible null-deref on probe with keyspan, a misbehaving modem, and a couple of issues with the USB console. Some new device IDs are also added. Signed-off-by: Johan Hovold <[email protected]> -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABAgAGBQJUtivAAAoJEEEN5E/e4bSV6eEQALGHzwqFXAZvWQRuAIA6yEYy 7KFDtU2bPBLorm6vDFPc9J3Q8Nh8cSwoMneJrrdKZiXoEoRrK5R9Mj34ENTrNNCX HwbjHx0QS3OysG3L09uciMxZbtHBZvr72s08QEJrLM9jgzKWdOBJORNeuUihw6vr YnxbAvpM4XPmb2PZ3GcvtP9tY12Kbh6Gb8kViaxn9jXFrLyjdsZq9TBqFlmFpwzs rk1wSIyo3dnQ41umKcalwqqni03pmdh+JMhXsWUXtFYExknvxQIpvzivUPHjX9pp OA1y8AX5l2MAUH2DVPSmPPwjDu4AMT3MLkdzonPNPSmvRPPoygEINaAVY6yxhImj nnXUCQKz4YEPBw9YGh4lsYLJlTthV+oit2QS65aJf/itBJYo0lGZUKFX9luHBQZD dQ7xYwT9fAmpUZVhNSZDVf6uDCv6fOn3Q5/R5ivTRdLjlTys6xS7FTDVgqzAB0tL ztM2P8ujexUt4CYMT28lqy8JbLsTqCRjoyKuuDeiIa1/QaanxIRXeUfj6TUYR9Rz 9LT+a0V05fWakzzCgyKFD6ul8l1KLzu2pV2Xk35JB+0oyRFr495wcGqS+la85djS KXG664RNOtXrsmbjKQFTsJ3MdShcbbyS9gOubLWlp74lNsMVKl5MLACUAyOWuB6o HYYC0VCVce1rJKI08s3P =umHr -----END PGP SIGNATURE----- Merge tag 'usb-serial-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial fixes for v3.18-rc5 Here are a few fixes for reported problems including a possible null-deref on probe with keyspan, a misbehaving modem, and a couple of issues with the USB console. Some new device IDs are also added. Signed-off-by: Johan Hovold <[email protected]>
This commit is contained in:
commit
919ba4ee1b
72 changed files with 668 additions and 357 deletions
|
|
@ -46,6 +46,8 @@ static struct console usbcons;
|
|||
* ------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static const struct tty_operations usb_console_fake_tty_ops = {
|
||||
};
|
||||
|
||||
/*
|
||||
* The parsing of the command line works exactly like the
|
||||
|
|
@ -137,13 +139,17 @@ static int usb_console_setup(struct console *co, char *options)
|
|||
goto reset_open_count;
|
||||
}
|
||||
kref_init(&tty->kref);
|
||||
tty_port_tty_set(&port->port, tty);
|
||||
tty->driver = usb_serial_tty_driver;
|
||||
tty->index = co->index;
|
||||
init_ldsem(&tty->ldisc_sem);
|
||||
INIT_LIST_HEAD(&tty->tty_files);
|
||||
kref_get(&tty->driver->kref);
|
||||
tty->ops = &usb_console_fake_tty_ops;
|
||||
if (tty_init_termios(tty)) {
|
||||
retval = -ENOMEM;
|
||||
goto free_tty;
|
||||
goto put_tty;
|
||||
}
|
||||
tty_port_tty_set(&port->port, tty);
|
||||
}
|
||||
|
||||
/* only call the device specific open if this
|
||||
|
|
@ -161,7 +167,7 @@ static int usb_console_setup(struct console *co, char *options)
|
|||
serial->type->set_termios(tty, port, &dummy);
|
||||
|
||||
tty_port_tty_set(&port->port, NULL);
|
||||
kfree(tty);
|
||||
tty_kref_put(tty);
|
||||
}
|
||||
set_bit(ASYNCB_INITIALIZED, &port->port.flags);
|
||||
}
|
||||
|
|
@ -177,8 +183,8 @@ static int usb_console_setup(struct console *co, char *options)
|
|||
|
||||
fail:
|
||||
tty_port_tty_set(&port->port, NULL);
|
||||
free_tty:
|
||||
kfree(tty);
|
||||
put_tty:
|
||||
tty_kref_put(tty);
|
||||
reset_open_count:
|
||||
port->port.count = 0;
|
||||
usb_autopm_put_interface(serial->interface);
|
||||
|
|
|
|||
|
|
@ -120,10 +120,12 @@ static const struct usb_device_id id_table[] = {
|
|||
{ USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */
|
||||
{ USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */
|
||||
{ USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */
|
||||
{ USB_DEVICE(0x10C4, 0x8875) }, /* CEL MeshConnect USB Stick */
|
||||
{ USB_DEVICE(0x10C4, 0x8856) }, /* CEL EM357 ZigBee USB Stick - LR */
|
||||
{ USB_DEVICE(0x10C4, 0x8857) }, /* CEL EM357 ZigBee USB Stick */
|
||||
{ USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */
|
||||
{ USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */
|
||||
{ USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */
|
||||
{ USB_DEVICE(0x10C4, 0x8977) }, /* CEL MeshWorks DevKit Device */
|
||||
{ USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
|
||||
{ USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
|
||||
{ USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ static int usb_serial_generic_submit_read_urb(struct usb_serial_port *port,
|
|||
|
||||
res = usb_submit_urb(port->read_urbs[index], mem_flags);
|
||||
if (res) {
|
||||
if (res != -EPERM) {
|
||||
if (res != -EPERM && res != -ENODEV) {
|
||||
dev_err(&port->dev,
|
||||
"%s - usb_submit_urb failed: %d\n",
|
||||
__func__, res);
|
||||
|
|
@ -373,7 +373,7 @@ void usb_serial_generic_read_bulk_callback(struct urb *urb)
|
|||
__func__, urb->status);
|
||||
return;
|
||||
default:
|
||||
dev_err(&port->dev, "%s - nonzero urb status: %d\n",
|
||||
dev_dbg(&port->dev, "%s - nonzero urb status: %d\n",
|
||||
__func__, urb->status);
|
||||
goto resubmit;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -410,6 +410,8 @@ static void usa26_instat_callback(struct urb *urb)
|
|||
}
|
||||
port = serial->port[msg->port];
|
||||
p_priv = usb_get_serial_port_data(port);
|
||||
if (!p_priv)
|
||||
goto resubmit;
|
||||
|
||||
/* Update handshaking pin state information */
|
||||
old_dcd_state = p_priv->dcd_state;
|
||||
|
|
@ -420,7 +422,7 @@ static void usa26_instat_callback(struct urb *urb)
|
|||
|
||||
if (old_dcd_state != p_priv->dcd_state)
|
||||
tty_port_tty_hangup(&port->port, true);
|
||||
|
||||
resubmit:
|
||||
/* Resubmit urb so we continue receiving */
|
||||
err = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
if (err != 0)
|
||||
|
|
@ -527,6 +529,8 @@ static void usa28_instat_callback(struct urb *urb)
|
|||
}
|
||||
port = serial->port[msg->port];
|
||||
p_priv = usb_get_serial_port_data(port);
|
||||
if (!p_priv)
|
||||
goto resubmit;
|
||||
|
||||
/* Update handshaking pin state information */
|
||||
old_dcd_state = p_priv->dcd_state;
|
||||
|
|
@ -537,7 +541,7 @@ static void usa28_instat_callback(struct urb *urb)
|
|||
|
||||
if (old_dcd_state != p_priv->dcd_state && old_dcd_state)
|
||||
tty_port_tty_hangup(&port->port, true);
|
||||
|
||||
resubmit:
|
||||
/* Resubmit urb so we continue receiving */
|
||||
err = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
if (err != 0)
|
||||
|
|
@ -607,6 +611,8 @@ static void usa49_instat_callback(struct urb *urb)
|
|||
}
|
||||
port = serial->port[msg->portNumber];
|
||||
p_priv = usb_get_serial_port_data(port);
|
||||
if (!p_priv)
|
||||
goto resubmit;
|
||||
|
||||
/* Update handshaking pin state information */
|
||||
old_dcd_state = p_priv->dcd_state;
|
||||
|
|
@ -617,7 +623,7 @@ static void usa49_instat_callback(struct urb *urb)
|
|||
|
||||
if (old_dcd_state != p_priv->dcd_state && old_dcd_state)
|
||||
tty_port_tty_hangup(&port->port, true);
|
||||
|
||||
resubmit:
|
||||
/* Resubmit urb so we continue receiving */
|
||||
err = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
if (err != 0)
|
||||
|
|
@ -855,6 +861,8 @@ static void usa90_instat_callback(struct urb *urb)
|
|||
|
||||
port = serial->port[0];
|
||||
p_priv = usb_get_serial_port_data(port);
|
||||
if (!p_priv)
|
||||
goto resubmit;
|
||||
|
||||
/* Update handshaking pin state information */
|
||||
old_dcd_state = p_priv->dcd_state;
|
||||
|
|
@ -865,7 +873,7 @@ static void usa90_instat_callback(struct urb *urb)
|
|||
|
||||
if (old_dcd_state != p_priv->dcd_state && old_dcd_state)
|
||||
tty_port_tty_hangup(&port->port, true);
|
||||
|
||||
resubmit:
|
||||
/* Resubmit urb so we continue receiving */
|
||||
err = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
if (err != 0)
|
||||
|
|
@ -926,6 +934,8 @@ static void usa67_instat_callback(struct urb *urb)
|
|||
|
||||
port = serial->port[msg->port];
|
||||
p_priv = usb_get_serial_port_data(port);
|
||||
if (!p_priv)
|
||||
goto resubmit;
|
||||
|
||||
/* Update handshaking pin state information */
|
||||
old_dcd_state = p_priv->dcd_state;
|
||||
|
|
@ -934,7 +944,7 @@ static void usa67_instat_callback(struct urb *urb)
|
|||
|
||||
if (old_dcd_state != p_priv->dcd_state && old_dcd_state)
|
||||
tty_port_tty_hangup(&port->port, true);
|
||||
|
||||
resubmit:
|
||||
/* Resubmit urb so we continue receiving */
|
||||
err = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
if (err != 0)
|
||||
|
|
|
|||
|
|
@ -234,6 +234,8 @@ static void option_instat_callback(struct urb *urb);
|
|||
|
||||
#define QUALCOMM_VENDOR_ID 0x05C6
|
||||
|
||||
#define SIERRA_VENDOR_ID 0x1199
|
||||
|
||||
#define CMOTECH_VENDOR_ID 0x16d8
|
||||
#define CMOTECH_PRODUCT_6001 0x6001
|
||||
#define CMOTECH_PRODUCT_CMU_300 0x6002
|
||||
|
|
@ -512,7 +514,7 @@ enum option_blacklist_reason {
|
|||
OPTION_BLACKLIST_RESERVED_IF = 2
|
||||
};
|
||||
|
||||
#define MAX_BL_NUM 8
|
||||
#define MAX_BL_NUM 11
|
||||
struct option_blacklist_info {
|
||||
/* bitfield of interface numbers for OPTION_BLACKLIST_SENDSETUP */
|
||||
const unsigned long sendsetup;
|
||||
|
|
@ -601,6 +603,11 @@ static const struct option_blacklist_info telit_le920_blacklist = {
|
|||
.reserved = BIT(1) | BIT(5),
|
||||
};
|
||||
|
||||
static const struct option_blacklist_info sierra_mc73xx_blacklist = {
|
||||
.sendsetup = BIT(0) | BIT(2),
|
||||
.reserved = BIT(8) | BIT(10) | BIT(11),
|
||||
};
|
||||
|
||||
static const struct usb_device_id option_ids[] = {
|
||||
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
|
||||
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
|
||||
|
|
@ -1098,6 +1105,8 @@ static const struct usb_device_id option_ids[] = {
|
|||
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
|
||||
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */
|
||||
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(SIERRA_VENDOR_ID, 0x68c0, 0xff),
|
||||
.driver_info = (kernel_ulong_t)&sierra_mc73xx_blacklist }, /* MC73xx */
|
||||
{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },
|
||||
{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) },
|
||||
{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003),
|
||||
|
|
|
|||
|
|
@ -142,7 +142,6 @@ static const struct usb_device_id id_table[] = {
|
|||
{DEVICE_SWI(0x0f3d, 0x68a2)}, /* Sierra Wireless MC7700 */
|
||||
{DEVICE_SWI(0x114f, 0x68a2)}, /* Sierra Wireless MC7750 */
|
||||
{DEVICE_SWI(0x1199, 0x68a2)}, /* Sierra Wireless MC7710 */
|
||||
{DEVICE_SWI(0x1199, 0x68c0)}, /* Sierra Wireless MC73xx */
|
||||
{DEVICE_SWI(0x1199, 0x901c)}, /* Sierra Wireless EM7700 */
|
||||
{DEVICE_SWI(0x1199, 0x901f)}, /* Sierra Wireless EM7355 */
|
||||
{DEVICE_SWI(0x1199, 0x9040)}, /* Sierra Wireless Modem */
|
||||
|
|
|
|||
Loading…
Reference in a new issue