diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-19 04:10:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-19 04:10:07 -0400 |
commit | b51e0ceed1f93a1eda3cbee328a396a188ec79e3 (patch) | |
tree | 351d9e1acaea0c3fc0997fc4c14a4d4bfe5e715c | |
parent | 6df2b42f7c040d57d9ecb67244e04e905ab87ac6 (diff) | |
parent | 8d7a10dd323993cc40bd37bce8bc570133b0c396 (diff) |
Merge tag 'usb-serial-4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus
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>
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 10 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio_ids.h | 2 | ||||
-rw-r--r-- | drivers/usb/serial/io_ti.c | 5 | ||||
-rw-r--r-- | drivers/usb/serial/ir-usb.c | 21 | ||||
-rw-r--r-- | drivers/usb/serial/mct_u232.c | 2 | ||||
-rw-r--r-- | drivers/usb/serial/option.c | 8 | ||||
-rw-r--r-- | drivers/usb/serial/qcserial.c | 2 |
7 files changed, 34 insertions, 16 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index d38780fa8788..aba74f817dc6 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -809,10 +809,10 @@ static const struct usb_device_id id_table_combined[] = { | |||
809 | { USB_DEVICE(FTDI_VID, FTDI_PROPOX_ISPCABLEIII_PID) }, | 809 | { USB_DEVICE(FTDI_VID, FTDI_PROPOX_ISPCABLEIII_PID) }, |
810 | { USB_DEVICE(FTDI_VID, CYBER_CORTEX_AV_PID), | 810 | { USB_DEVICE(FTDI_VID, CYBER_CORTEX_AV_PID), |
811 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | 811 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, |
812 | { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID), | 812 | { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID, 1) }, |
813 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | 813 | { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID, 1) }, |
814 | { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID), | 814 | { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_TINY_PID, 1) }, |
815 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | 815 | { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_TINY_H_PID, 1) }, |
816 | { USB_DEVICE(FIC_VID, FIC_NEO1973_DEBUG_PID), | 816 | { USB_DEVICE(FIC_VID, FIC_NEO1973_DEBUG_PID), |
817 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | 817 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, |
818 | { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID), | 818 | { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID), |
@@ -1527,9 +1527,9 @@ static int set_serial_info(struct tty_struct *tty, | |||
1527 | (new_serial.flags & ASYNC_FLAGS)); | 1527 | (new_serial.flags & ASYNC_FLAGS)); |
1528 | priv->custom_divisor = new_serial.custom_divisor; | 1528 | priv->custom_divisor = new_serial.custom_divisor; |
1529 | 1529 | ||
1530 | check_and_exit: | ||
1530 | write_latency_timer(port); | 1531 | write_latency_timer(port); |
1531 | 1532 | ||
1532 | check_and_exit: | ||
1533 | if ((old_priv.flags & ASYNC_SPD_MASK) != | 1533 | if ((old_priv.flags & ASYNC_SPD_MASK) != |
1534 | (priv->flags & ASYNC_SPD_MASK)) { | 1534 | (priv->flags & ASYNC_SPD_MASK)) { |
1535 | if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) | 1535 | if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index 71fb9e59db71..4fcf1cecb6d7 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
@@ -882,6 +882,8 @@ | |||
882 | /* Olimex */ | 882 | /* Olimex */ |
883 | #define OLIMEX_VID 0x15BA | 883 | #define OLIMEX_VID 0x15BA |
884 | #define OLIMEX_ARM_USB_OCD_PID 0x0003 | 884 | #define OLIMEX_ARM_USB_OCD_PID 0x0003 |
885 | #define OLIMEX_ARM_USB_TINY_PID 0x0004 | ||
886 | #define OLIMEX_ARM_USB_TINY_H_PID 0x002a | ||
885 | #define OLIMEX_ARM_USB_OCD_H_PID 0x002b | 887 | #define OLIMEX_ARM_USB_OCD_H_PID 0x002b |
886 | 888 | ||
887 | /* | 889 | /* |
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 87798e625d6c..6cefb9cb133d 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c | |||
@@ -2336,8 +2336,11 @@ static void change_port_settings(struct tty_struct *tty, | |||
2336 | if (!baud) { | 2336 | if (!baud) { |
2337 | /* pick a default, any default... */ | 2337 | /* pick a default, any default... */ |
2338 | baud = 9600; | 2338 | baud = 9600; |
2339 | } else | 2339 | } else { |
2340 | /* Avoid a zero divisor. */ | ||
2341 | baud = min(baud, 461550); | ||
2340 | tty_encode_baud_rate(tty, baud, baud); | 2342 | tty_encode_baud_rate(tty, baud, baud); |
2343 | } | ||
2341 | 2344 | ||
2342 | edge_port->baud_rate = baud; | 2345 | edge_port->baud_rate = baud; |
2343 | config->wBaudRate = (__u16)((461550L + baud/2) / baud); | 2346 | config->wBaudRate = (__u16)((461550L + baud/2) / baud); |
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c index 73956d48a0c5..f9734a96d516 100644 --- a/drivers/usb/serial/ir-usb.c +++ b/drivers/usb/serial/ir-usb.c | |||
@@ -197,6 +197,7 @@ static u8 ir_xbof_change(u8 xbof) | |||
197 | static int ir_startup(struct usb_serial *serial) | 197 | static int ir_startup(struct usb_serial *serial) |
198 | { | 198 | { |
199 | struct usb_irda_cs_descriptor *irda_desc; | 199 | struct usb_irda_cs_descriptor *irda_desc; |
200 | int rates; | ||
200 | 201 | ||
201 | irda_desc = irda_usb_find_class_desc(serial, 0); | 202 | irda_desc = irda_usb_find_class_desc(serial, 0); |
202 | if (!irda_desc) { | 203 | if (!irda_desc) { |
@@ -205,18 +206,20 @@ static int ir_startup(struct usb_serial *serial) | |||
205 | return -ENODEV; | 206 | return -ENODEV; |
206 | } | 207 | } |
207 | 208 | ||
209 | rates = le16_to_cpu(irda_desc->wBaudRate); | ||
210 | |||
208 | dev_dbg(&serial->dev->dev, | 211 | dev_dbg(&serial->dev->dev, |
209 | "%s - Baud rates supported:%s%s%s%s%s%s%s%s%s\n", | 212 | "%s - Baud rates supported:%s%s%s%s%s%s%s%s%s\n", |
210 | __func__, | 213 | __func__, |
211 | (irda_desc->wBaudRate & USB_IRDA_BR_2400) ? " 2400" : "", | 214 | (rates & USB_IRDA_BR_2400) ? " 2400" : "", |
212 | (irda_desc->wBaudRate & USB_IRDA_BR_9600) ? " 9600" : "", | 215 | (rates & USB_IRDA_BR_9600) ? " 9600" : "", |
213 | (irda_desc->wBaudRate & USB_IRDA_BR_19200) ? " 19200" : "", | 216 | (rates & USB_IRDA_BR_19200) ? " 19200" : "", |
214 | (irda_desc->wBaudRate & USB_IRDA_BR_38400) ? " 38400" : "", | 217 | (rates & USB_IRDA_BR_38400) ? " 38400" : "", |
215 | (irda_desc->wBaudRate & USB_IRDA_BR_57600) ? " 57600" : "", | 218 | (rates & USB_IRDA_BR_57600) ? " 57600" : "", |
216 | (irda_desc->wBaudRate & USB_IRDA_BR_115200) ? " 115200" : "", | 219 | (rates & USB_IRDA_BR_115200) ? " 115200" : "", |
217 | (irda_desc->wBaudRate & USB_IRDA_BR_576000) ? " 576000" : "", | 220 | (rates & USB_IRDA_BR_576000) ? " 576000" : "", |
218 | (irda_desc->wBaudRate & USB_IRDA_BR_1152000) ? " 1152000" : "", | 221 | (rates & USB_IRDA_BR_1152000) ? " 1152000" : "", |
219 | (irda_desc->wBaudRate & USB_IRDA_BR_4000000) ? " 4000000" : ""); | 222 | (rates & USB_IRDA_BR_4000000) ? " 4000000" : ""); |
220 | 223 | ||
221 | switch (irda_desc->bmAdditionalBOFs) { | 224 | switch (irda_desc->bmAdditionalBOFs) { |
222 | case USB_IRDA_AB_48: | 225 | case USB_IRDA_AB_48: |
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index edbc81f205c2..70f346f1aa86 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c | |||
@@ -189,7 +189,7 @@ static int mct_u232_set_baud_rate(struct tty_struct *tty, | |||
189 | return -ENOMEM; | 189 | return -ENOMEM; |
190 | 190 | ||
191 | divisor = mct_u232_calculate_baud_rate(serial, value, &speed); | 191 | divisor = mct_u232_calculate_baud_rate(serial, value, &speed); |
192 | put_unaligned_le32(cpu_to_le32(divisor), buf); | 192 | put_unaligned_le32(divisor, buf); |
193 | rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), | 193 | rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), |
194 | MCT_U232_SET_BAUD_RATE_REQUEST, | 194 | MCT_U232_SET_BAUD_RATE_REQUEST, |
195 | MCT_U232_SET_REQUEST_TYPE, | 195 | MCT_U232_SET_REQUEST_TYPE, |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index af67a0de6b5d..3bf61acfc26b 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -281,6 +281,7 @@ static void option_instat_callback(struct urb *urb); | |||
281 | #define TELIT_PRODUCT_LE922_USBCFG0 0x1042 | 281 | #define TELIT_PRODUCT_LE922_USBCFG0 0x1042 |
282 | #define TELIT_PRODUCT_LE922_USBCFG3 0x1043 | 282 | #define TELIT_PRODUCT_LE922_USBCFG3 0x1043 |
283 | #define TELIT_PRODUCT_LE922_USBCFG5 0x1045 | 283 | #define TELIT_PRODUCT_LE922_USBCFG5 0x1045 |
284 | #define TELIT_PRODUCT_ME910 0x1100 | ||
284 | #define TELIT_PRODUCT_LE920 0x1200 | 285 | #define TELIT_PRODUCT_LE920 0x1200 |
285 | #define TELIT_PRODUCT_LE910 0x1201 | 286 | #define TELIT_PRODUCT_LE910 0x1201 |
286 | #define TELIT_PRODUCT_LE910_USBCFG4 0x1206 | 287 | #define TELIT_PRODUCT_LE910_USBCFG4 0x1206 |
@@ -640,6 +641,11 @@ static const struct option_blacklist_info simcom_sim7100e_blacklist = { | |||
640 | .reserved = BIT(5) | BIT(6), | 641 | .reserved = BIT(5) | BIT(6), |
641 | }; | 642 | }; |
642 | 643 | ||
644 | static const struct option_blacklist_info telit_me910_blacklist = { | ||
645 | .sendsetup = BIT(0), | ||
646 | .reserved = BIT(1) | BIT(3), | ||
647 | }; | ||
648 | |||
643 | static const struct option_blacklist_info telit_le910_blacklist = { | 649 | static const struct option_blacklist_info telit_le910_blacklist = { |
644 | .sendsetup = BIT(0), | 650 | .sendsetup = BIT(0), |
645 | .reserved = BIT(1) | BIT(2), | 651 | .reserved = BIT(1) | BIT(2), |
@@ -1235,6 +1241,8 @@ static const struct usb_device_id option_ids[] = { | |||
1235 | .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 }, | 1241 | .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 }, |
1236 | { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG5, 0xff), | 1242 | { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG5, 0xff), |
1237 | .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg0 }, | 1243 | .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg0 }, |
1244 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910), | ||
1245 | .driver_info = (kernel_ulong_t)&telit_me910_blacklist }, | ||
1238 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910), | 1246 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910), |
1239 | .driver_info = (kernel_ulong_t)&telit_le910_blacklist }, | 1247 | .driver_info = (kernel_ulong_t)&telit_le910_blacklist }, |
1240 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4), | 1248 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4), |
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 38b3f0d8cd58..fd509ed6cf70 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c | |||
@@ -162,6 +162,8 @@ static const struct usb_device_id id_table[] = { | |||
162 | {DEVICE_SWI(0x1199, 0x9071)}, /* Sierra Wireless MC74xx */ | 162 | {DEVICE_SWI(0x1199, 0x9071)}, /* Sierra Wireless MC74xx */ |
163 | {DEVICE_SWI(0x1199, 0x9078)}, /* Sierra Wireless EM74xx */ | 163 | {DEVICE_SWI(0x1199, 0x9078)}, /* Sierra Wireless EM74xx */ |
164 | {DEVICE_SWI(0x1199, 0x9079)}, /* Sierra Wireless EM74xx */ | 164 | {DEVICE_SWI(0x1199, 0x9079)}, /* Sierra Wireless EM74xx */ |
165 | {DEVICE_SWI(0x1199, 0x907a)}, /* Sierra Wireless EM74xx QDL */ | ||
166 | {DEVICE_SWI(0x1199, 0x907b)}, /* Sierra Wireless EM74xx */ | ||
165 | {DEVICE_SWI(0x413c, 0x81a2)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */ | 167 | {DEVICE_SWI(0x413c, 0x81a2)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */ |
166 | {DEVICE_SWI(0x413c, 0x81a3)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */ | 168 | {DEVICE_SWI(0x413c, 0x81a3)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */ |
167 | {DEVICE_SWI(0x413c, 0x81a4)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */ | 169 | {DEVICE_SWI(0x413c, 0x81a4)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */ |