From cc0e8fdd1df89901b790e59581d777acdcdbef2d Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Mon, 14 Jan 2013 16:52:54 +0100 Subject: [PATCH] --- yaml --- r: 354567 b: refs/heads/master c: 77de2518e854501c1542199449354fab4b2377ac h: refs/heads/master i: 354565: ae1fc1c96c7938f3ade70c3f736c30c78a684475 354563: 1377b8b8f74f083611bf185da75485db04b361b5 354559: 9c74971874c8c6b438a25c0116caaf8fe091f2bb v: v3 --- [refs] | 2 +- trunk/drivers/usb/serial/io_ti.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 4c52703af415..fdc38c1e1f5d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cbf50a4125f5242dd70b1f2342dbba2d94c6d94e +refs/heads/master: 77de2518e854501c1542199449354fab4b2377ac diff --git a/trunk/drivers/usb/serial/io_ti.c b/trunk/drivers/usb/serial/io_ti.c index 58184f3de686..596f8c9474b4 100644 --- a/trunk/drivers/usb/serial/io_ti.c +++ b/trunk/drivers/usb/serial/io_ti.c @@ -521,8 +521,7 @@ static int tx_active(struct edgeport_port *port) return bytes_left; } -static void chase_port(struct edgeport_port *port, unsigned long timeout, - int flush) +static void chase_port(struct edgeport_port *port, unsigned long timeout) { int baud_rate; struct tty_struct *tty = tty_port_tty_get(&port->port->port); @@ -550,8 +549,6 @@ static void chase_port(struct edgeport_port *port, unsigned long timeout, } set_current_state(TASK_RUNNING); remove_wait_queue(&tty->write_wait, &wait); - if (flush) - kfifo_reset_out(&port->write_fifo); spin_unlock_irqrestore(&port->ep_lock, flags); tty_kref_put(tty); @@ -1956,6 +1953,7 @@ static void edge_close(struct usb_serial_port *port) struct edgeport_serial *edge_serial; struct edgeport_port *edge_port; struct usb_serial *serial = port->serial; + unsigned long flags; int port_number; edge_serial = usb_get_serial_data(port->serial); @@ -1967,12 +1965,14 @@ static void edge_close(struct usb_serial_port *port) * this flag and dump add read data */ edge_port->close_pending = 1; - /* chase the port close and flush */ - chase_port(edge_port, (HZ * closing_wait) / 100, 1); + chase_port(edge_port, (HZ * closing_wait) / 100); usb_kill_urb(port->read_urb); usb_kill_urb(port->write_urb); edge_port->ep_write_urb_in_use = 0; + spin_lock_irqsave(&edge_port->ep_lock, flags); + kfifo_reset_out(&edge_port->write_fifo); + spin_unlock_irqrestore(&edge_port->ep_lock, flags); /* assuming we can still talk to the device, * send a close port command to it */ @@ -2515,7 +2515,7 @@ static void edge_break(struct tty_struct *tty, int break_state) int bv = 0; /* Off */ /* chase the port close */ - chase_port(edge_port, 0, 0); + chase_port(edge_port, 0); if (break_state == -1) bv = 1; /* On */