summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/function/u_serial.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-05-17 07:58:08 +0200
committerIngo Molnar <mingo@kernel.org>2015-05-17 07:58:08 +0200
commitcffc32975da7df2ef909299c47ff644e1357e0ac (patch)
tree04cfa6276b890f49f686d65be7397c4232ac44af /drivers/usb/gadget/function/u_serial.c
parent6dc178760553605c58d78bd403dfcb4e042c5b72 (diff)
parentadeb5537849d9db428fe0ddc3562e5a765a347e2 (diff)
downloadop-kernel-dev-cffc32975da7df2ef909299c47ff644e1357e0ac.zip
op-kernel-dev-cffc32975da7df2ef909299c47ff644e1357e0ac.tar.gz
Merge branch 'x86/asm' into x86/apic, to resolve conflicts
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/usb/gadget/function/u_serial.c')
-rw-r--r--drivers/usb/gadget/function/u_serial.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c
index 89179ab..7ee0579 100644
--- a/drivers/usb/gadget/function/u_serial.c
+++ b/drivers/usb/gadget/function/u_serial.c
@@ -113,6 +113,7 @@ struct gs_port {
int write_allocated;
struct gs_buf port_write_buf;
wait_queue_head_t drain_wait; /* wait while writes drain */
+ bool write_busy;
/* REVISIT this state ... */
struct usb_cdc_line_coding port_line_coding; /* 8-N-1 etc */
@@ -363,7 +364,7 @@ __acquires(&port->port_lock)
int status = 0;
bool do_tty_wake = false;
- while (!list_empty(pool)) {
+ while (!port->write_busy && !list_empty(pool)) {
struct usb_request *req;
int len;
@@ -393,9 +394,11 @@ __acquires(&port->port_lock)
* NOTE that we may keep sending data for a while after
* the TTY closed (dev->ioport->port_tty is NULL).
*/
+ port->write_busy = true;
spin_unlock(&port->port_lock);
status = usb_ep_queue(in, req, GFP_ATOMIC);
spin_lock(&port->port_lock);
+ port->write_busy = false;
if (status) {
pr_debug("%s: %s %s err %d\n",
OpenPOWER on IntegriCloud