aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2014-01-02 16:49:22 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-03 15:42:23 -0500
commitdbfd2866ac36bab52a4f37384e935eb5df76ad60 (patch)
tree50773ae33e25b196fae42530fd0afc8db908423f /drivers/usb
parent6020c3bec359873c1e4081785f220db99694c4e4 (diff)
USB: pl2303: only wake up MSR queue on changes
Only wake up MSR wait queue on actual modem-status changes. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/pl2303.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 11de1f169308..64f093f16981 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -118,6 +118,7 @@ MODULE_DEVICE_TABLE(usb, id_table);
118#define VENDOR_READ_REQUEST 0x01 118#define VENDOR_READ_REQUEST 0x01
119 119
120#define UART_STATE_INDEX 8 120#define UART_STATE_INDEX 8
121#define UART_STATE_MSR_MASK 0x8b
121#define UART_STATE_TRANSIENT_MASK 0x74 122#define UART_STATE_TRANSIENT_MASK 0x74
122#define UART_DCD 0x01 123#define UART_DCD 0x01
123#define UART_DSR 0x02 124#define UART_DSR 0x02
@@ -828,15 +829,17 @@ static void pl2303_update_line_status(struct usb_serial_port *port,
828 if (status & UART_BREAK_ERROR) 829 if (status & UART_BREAK_ERROR)
829 usb_serial_handle_break(port); 830 usb_serial_handle_break(port);
830 831
831 wake_up_interruptible(&port->port.delta_msr_wait); 832 if (delta & UART_STATE_MSR_MASK) {
832 833 if (delta & UART_DCD) {
833 if (delta & UART_DCD) { 834 tty = tty_port_tty_get(&port->port);
834 tty = tty_port_tty_get(&port->port); 835 if (tty) {
835 if (tty) { 836 usb_serial_handle_dcd_change(port, tty,
836 usb_serial_handle_dcd_change(port, tty,
837 status & UART_DCD); 837 status & UART_DCD);
838 tty_kref_put(tty); 838 tty_kref_put(tty);
839 }
839 } 840 }
841
842 wake_up_interruptible(&port->port.delta_msr_wait);
840 } 843 }
841} 844}
842 845