]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge tag 'usb-serial-4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 May 2017 08:10:07 +0000 (10:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 May 2017 08:10:07 +0000 (10:10 +0200)
Johan writes:

USB-serial fixes for v4.12-rc2

Here's a fix for a long-standing issue in the ftdi_sio driver that
prevented unprivileged users from updating the low-latency flag,
something which became apparent after a recent change that restored the
older setting of not using low-latency mode by default.

A run of sparse revealed a couple of endianness issues that are now
fixed, and addressed is also a user-triggerable division-by-zero in
io_ti when debugging is enabled.

Finally there are some new device ids, including a simplification of how
we deal with a couple of older Olimex JTAG adapters.

All have been in linux-next with no reported issues.

Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/ftdi_sio_ids.h
drivers/usb/serial/io_ti.c
drivers/usb/serial/ir-usb.c
drivers/usb/serial/mct_u232.c
drivers/usb/serial/option.c
drivers/usb/serial/qcserial.c

index d38780fa87881a0ef3696e73e61527304271393c..aba74f817dc6594064241013b92e31138e587dce 100644 (file)
@@ -809,10 +809,10 @@ static const struct usb_device_id id_table_combined[] = {
        { USB_DEVICE(FTDI_VID, FTDI_PROPOX_ISPCABLEIII_PID) },
        { USB_DEVICE(FTDI_VID, CYBER_CORTEX_AV_PID),
                .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
-       { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID),
-               .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
-       { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID),
-               .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
+       { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID, 1) },
+       { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID, 1) },
+       { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_TINY_PID, 1) },
+       { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_TINY_H_PID, 1) },
        { USB_DEVICE(FIC_VID, FIC_NEO1973_DEBUG_PID),
                .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
        { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID),
@@ -1527,9 +1527,9 @@ static int set_serial_info(struct tty_struct *tty,
                                        (new_serial.flags & ASYNC_FLAGS));
        priv->custom_divisor = new_serial.custom_divisor;
 
+check_and_exit:
        write_latency_timer(port);
 
-check_and_exit:
        if ((old_priv.flags & ASYNC_SPD_MASK) !=
             (priv->flags & ASYNC_SPD_MASK)) {
                if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
index 71fb9e59db7125c845a9a1c23c4e33430a142a3e..4fcf1cecb6d721ad366666eec49774bcf9d00808 100644 (file)
 /* Olimex */
 #define OLIMEX_VID                     0x15BA
 #define OLIMEX_ARM_USB_OCD_PID         0x0003
+#define OLIMEX_ARM_USB_TINY_PID        0x0004
+#define OLIMEX_ARM_USB_TINY_H_PID      0x002a
 #define OLIMEX_ARM_USB_OCD_H_PID       0x002b
 
 /*
index 87798e625d6c827ed09b79a011eb46cdd770c864..6cefb9cb133d7bad8678e9b9400b077afc75474e 100644 (file)
@@ -2336,8 +2336,11 @@ static void change_port_settings(struct tty_struct *tty,
        if (!baud) {
                /* pick a default, any default... */
                baud = 9600;
-       } else
+       } else {
+               /* Avoid a zero divisor. */
+               baud = min(baud, 461550);
                tty_encode_baud_rate(tty, baud, baud);
+       }
 
        edge_port->baud_rate = baud;
        config->wBaudRate = (__u16)((461550L + baud/2) / baud);
index 73956d48a0c57bb5566fb0c1b47a581e438bb4a1..f9734a96d51681d689c5028e6777fec03c401d5a 100644 (file)
@@ -197,6 +197,7 @@ static u8 ir_xbof_change(u8 xbof)
 static int ir_startup(struct usb_serial *serial)
 {
        struct usb_irda_cs_descriptor *irda_desc;
+       int rates;
 
        irda_desc = irda_usb_find_class_desc(serial, 0);
        if (!irda_desc) {
@@ -205,18 +206,20 @@ static int ir_startup(struct usb_serial *serial)
                return -ENODEV;
        }
 
+       rates = le16_to_cpu(irda_desc->wBaudRate);
+
        dev_dbg(&serial->dev->dev,
                "%s - Baud rates supported:%s%s%s%s%s%s%s%s%s\n",
                __func__,
-               (irda_desc->wBaudRate & USB_IRDA_BR_2400) ? " 2400" : "",
-               (irda_desc->wBaudRate & USB_IRDA_BR_9600) ? " 9600" : "",
-               (irda_desc->wBaudRate & USB_IRDA_BR_19200) ? " 19200" : "",
-               (irda_desc->wBaudRate & USB_IRDA_BR_38400) ? " 38400" : "",
-               (irda_desc->wBaudRate & USB_IRDA_BR_57600) ? " 57600" : "",
-               (irda_desc->wBaudRate & USB_IRDA_BR_115200) ? " 115200" : "",
-               (irda_desc->wBaudRate & USB_IRDA_BR_576000) ? " 576000" : "",
-               (irda_desc->wBaudRate & USB_IRDA_BR_1152000) ? " 1152000" : "",
-               (irda_desc->wBaudRate & USB_IRDA_BR_4000000) ? " 4000000" : "");
+               (rates & USB_IRDA_BR_2400) ? " 2400" : "",
+               (rates & USB_IRDA_BR_9600) ? " 9600" : "",
+               (rates & USB_IRDA_BR_19200) ? " 19200" : "",
+               (rates & USB_IRDA_BR_38400) ? " 38400" : "",
+               (rates & USB_IRDA_BR_57600) ? " 57600" : "",
+               (rates & USB_IRDA_BR_115200) ? " 115200" : "",
+               (rates & USB_IRDA_BR_576000) ? " 576000" : "",
+               (rates & USB_IRDA_BR_1152000) ? " 1152000" : "",
+               (rates & USB_IRDA_BR_4000000) ? " 4000000" : "");
 
        switch (irda_desc->bmAdditionalBOFs) {
        case USB_IRDA_AB_48:
index edbc81f205c253f41f7afa2d3375ef7818e0ae86..70f346f1aa86f4a7c9eb880cd725cd0d2e6fb1b5 100644 (file)
@@ -189,7 +189,7 @@ static int mct_u232_set_baud_rate(struct tty_struct *tty,
                return -ENOMEM;
 
        divisor = mct_u232_calculate_baud_rate(serial, value, &speed);
-       put_unaligned_le32(cpu_to_le32(divisor), buf);
+       put_unaligned_le32(divisor, buf);
        rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
                                MCT_U232_SET_BAUD_RATE_REQUEST,
                                MCT_U232_SET_REQUEST_TYPE,
index af67a0de6b5d475d2be95952ddfb2354546a0fbb..3bf61acfc26b9cfdee5496feeb64bdbcfd58015c 100644 (file)
@@ -281,6 +281,7 @@ static void option_instat_callback(struct urb *urb);
 #define TELIT_PRODUCT_LE922_USBCFG0            0x1042
 #define TELIT_PRODUCT_LE922_USBCFG3            0x1043
 #define TELIT_PRODUCT_LE922_USBCFG5            0x1045
+#define TELIT_PRODUCT_ME910                    0x1100
 #define TELIT_PRODUCT_LE920                    0x1200
 #define TELIT_PRODUCT_LE910                    0x1201
 #define TELIT_PRODUCT_LE910_USBCFG4            0x1206
@@ -640,6 +641,11 @@ static const struct option_blacklist_info simcom_sim7100e_blacklist = {
        .reserved = BIT(5) | BIT(6),
 };
 
+static const struct option_blacklist_info telit_me910_blacklist = {
+       .sendsetup = BIT(0),
+       .reserved = BIT(1) | BIT(3),
+};
+
 static const struct option_blacklist_info telit_le910_blacklist = {
        .sendsetup = BIT(0),
        .reserved = BIT(1) | BIT(2),
@@ -1235,6 +1241,8 @@ static const struct usb_device_id option_ids[] = {
                .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 },
        { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG5, 0xff),
                .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg0 },
+       { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910),
+               .driver_info = (kernel_ulong_t)&telit_me910_blacklist },
        { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910),
                .driver_info = (kernel_ulong_t)&telit_le910_blacklist },
        { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4),
index 38b3f0d8cd580f2366136003934d00a475b1d7f1..fd509ed6cf7065725c097ab1bc4eac84359be1f6 100644 (file)
@@ -162,6 +162,8 @@ static const struct usb_device_id id_table[] = {
        {DEVICE_SWI(0x1199, 0x9071)},   /* Sierra Wireless MC74xx */
        {DEVICE_SWI(0x1199, 0x9078)},   /* Sierra Wireless EM74xx */
        {DEVICE_SWI(0x1199, 0x9079)},   /* Sierra Wireless EM74xx */
+       {DEVICE_SWI(0x1199, 0x907a)},   /* Sierra Wireless EM74xx QDL */
+       {DEVICE_SWI(0x1199, 0x907b)},   /* Sierra Wireless EM74xx */
        {DEVICE_SWI(0x413c, 0x81a2)},   /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */
        {DEVICE_SWI(0x413c, 0x81a3)},   /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */
        {DEVICE_SWI(0x413c, 0x81a4)},   /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */