diff options
Diffstat (limited to 'drivers/usb/serial/ftdi_sio.c')
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 6af0dfa5f5ac..1d7c4fac02e8 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -91,7 +91,7 @@ struct ftdi_private { | |||
91 | unsigned long tx_outstanding_bytes; | 91 | unsigned long tx_outstanding_bytes; |
92 | unsigned long tx_outstanding_urbs; | 92 | unsigned long tx_outstanding_urbs; |
93 | unsigned short max_packet_size; | 93 | unsigned short max_packet_size; |
94 | struct mutex cfg_lock; /* Avoid mess by parallel calls of config ioctl() */ | 94 | struct mutex cfg_lock; /* Avoid mess by parallel calls of config ioctl() and change_speed() */ |
95 | }; | 95 | }; |
96 | 96 | ||
97 | /* struct ftdi_sio_quirk is used by devices requiring special attention. */ | 97 | /* struct ftdi_sio_quirk is used by devices requiring special attention. */ |
@@ -658,6 +658,7 @@ static struct usb_device_id id_table_combined [] = { | |||
658 | { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, | 658 | { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, |
659 | { USB_DEVICE(EVOLUTION_VID, EVO_HYBRID_PID) }, | 659 | { USB_DEVICE(EVOLUTION_VID, EVO_HYBRID_PID) }, |
660 | { USB_DEVICE(EVOLUTION_VID, EVO_RCM4_PID) }, | 660 | { USB_DEVICE(EVOLUTION_VID, EVO_RCM4_PID) }, |
661 | { USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) }, | ||
661 | { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) }, | 662 | { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) }, |
662 | { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) }, | 663 | { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) }, |
663 | { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16C_PID) }, | 664 | { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16C_PID) }, |
@@ -1272,8 +1273,8 @@ check_and_exit: | |||
1272 | (priv->flags & ASYNC_SPD_MASK)) || | 1273 | (priv->flags & ASYNC_SPD_MASK)) || |
1273 | (((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) && | 1274 | (((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) && |
1274 | (old_priv.custom_divisor != priv->custom_divisor))) { | 1275 | (old_priv.custom_divisor != priv->custom_divisor))) { |
1275 | mutex_unlock(&priv->cfg_lock); | ||
1276 | change_speed(tty, port); | 1276 | change_speed(tty, port); |
1277 | mutex_unlock(&priv->cfg_lock); | ||
1277 | } | 1278 | } |
1278 | else | 1279 | else |
1279 | mutex_unlock(&priv->cfg_lock); | 1280 | mutex_unlock(&priv->cfg_lock); |
@@ -2264,9 +2265,11 @@ static void ftdi_set_termios(struct tty_struct *tty, | |||
2264 | clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); | 2265 | clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); |
2265 | } else { | 2266 | } else { |
2266 | /* set the baudrate determined before */ | 2267 | /* set the baudrate determined before */ |
2268 | mutex_lock(&priv->cfg_lock); | ||
2267 | if (change_speed(tty, port)) | 2269 | if (change_speed(tty, port)) |
2268 | dev_err(&port->dev, "%s urb failed to set baudrate\n", | 2270 | dev_err(&port->dev, "%s urb failed to set baudrate\n", |
2269 | __func__); | 2271 | __func__); |
2272 | mutex_unlock(&priv->cfg_lock); | ||
2270 | /* Ensure RTS and DTR are raised when baudrate changed from 0 */ | 2273 | /* Ensure RTS and DTR are raised when baudrate changed from 0 */ |
2271 | if (!old_termios || (old_termios->c_cflag & CBAUD) == B0) | 2274 | if (!old_termios || (old_termios->c_cflag & CBAUD) == B0) |
2272 | set_mctrl(port, TIOCM_DTR | TIOCM_RTS); | 2275 | set_mctrl(port, TIOCM_DTR | TIOCM_RTS); |