diff options
author | Johan Hovold <jhovold@gmail.com> | 2013-03-21 07:37:01 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-25 16:50:52 -0400 |
commit | 3f550431925891d2ea4338d298aceeceb1c6cbf1 (patch) | |
tree | 45b84306a3c25816bbbe249f69e1911834480ccc /drivers/usb/serial/ch341.c | |
parent | 7bb98f0edd1df8687ca9c8ce9492f8ac6b8ec448 (diff) |
USB: ch341: fix TIOCMIWAIT and disconnect
Use tty-port modem-status-change wait queue on which processes are woken
up at hangup and disconnect.
Currently a process waiting on modem-status changes will not be woken on
device disconnect as wake up was only done in dtr_rts which isn't
guaranteed to be called (e.g. if HUPCL is not set).
Also remove the redundant wake-up call from dtr_rts.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/ch341.c')
-rw-r--r-- | drivers/usb/serial/ch341.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c index 1a97985df782..c2a4171ab9cb 100644 --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c | |||
@@ -296,7 +296,6 @@ static void ch341_dtr_rts(struct usb_serial_port *port, int on) | |||
296 | priv->line_control &= ~(CH341_BIT_RTS | CH341_BIT_DTR); | 296 | priv->line_control &= ~(CH341_BIT_RTS | CH341_BIT_DTR); |
297 | spin_unlock_irqrestore(&priv->lock, flags); | 297 | spin_unlock_irqrestore(&priv->lock, flags); |
298 | ch341_set_handshake(port->serial->dev, priv->line_control); | 298 | ch341_set_handshake(port->serial->dev, priv->line_control); |
299 | wake_up_interruptible(&port->delta_msr_wait); | ||
300 | } | 299 | } |
301 | 300 | ||
302 | static void ch341_close(struct usb_serial_port *port) | 301 | static void ch341_close(struct usb_serial_port *port) |
@@ -489,7 +488,7 @@ static void ch341_read_int_callback(struct urb *urb) | |||
489 | tty_kref_put(tty); | 488 | tty_kref_put(tty); |
490 | } | 489 | } |
491 | 490 | ||
492 | wake_up_interruptible(&port->delta_msr_wait); | 491 | wake_up_interruptible(&port->port.delta_msr_wait); |
493 | } | 492 | } |
494 | 493 | ||
495 | exit: | 494 | exit: |
@@ -516,7 +515,7 @@ static int ch341_tiocmiwait(struct tty_struct *tty, unsigned long arg) | |||
516 | spin_unlock_irqrestore(&priv->lock, flags); | 515 | spin_unlock_irqrestore(&priv->lock, flags); |
517 | 516 | ||
518 | while (!multi_change) { | 517 | while (!multi_change) { |
519 | interruptible_sleep_on(&port->delta_msr_wait); | 518 | interruptible_sleep_on(&port->port.delta_msr_wait); |
520 | /* see if a signal did it */ | 519 | /* see if a signal did it */ |
521 | if (signal_pending(current)) | 520 | if (signal_pending(current)) |
522 | return -ERESTARTSYS; | 521 | return -ERESTARTSYS; |