From: ebiederm@xmission.com (Eric W. Biederman)
To: "Greg Kroah-Hartman" <gregkh@suse.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
Johan Hovold <jhovold@gmail.com>,
Michael Trimarchi <trimarchi@gandalf.sssup.it>,
linux-usb@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org,
Alan Stern <stern@rowland.harvard.edu>,
Oliver Neukum <oliver@neukum.org>
Subject: [PATCH] ftdi_sio: Keep going when write errors are encountered.
Date: Tue, 17 Nov 2009 19:10:48 -0800 [thread overview]
Message-ID: <m1fx8co7d3.fsf_-_@fess.ebiederm.org> (raw)
In-Reply-To: <m1lji4od0k.fsf@fess.ebiederm.org> (Eric W. Biederman's message of "Tue\, 17 Nov 2009 17\:08\:43 -0800")
The use of urb->actual_length to update tx_outstanding_bytes
implicitly assumes that the number of bytes actually written is the
same as the number of bytes we tried to write. On error that
assumption is violated so just use transfer_buffer_length the number
of bytes we intended to write to the device.
If an error occurs we need to fall through and call
usb_serial_port_softint to wake up processes waiting in
tty_wait_until_sent.
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
---
drivers/usb/serial/ftdi_sio.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 9c60d6d..ebcc6d0 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1937,7 +1937,7 @@ static void ftdi_write_bulk_callback(struct urb *urb)
return;
}
/* account for transferred data */
- countback = urb->actual_length;
+ countback = urb->transfer_buffer_length;
data_offset = priv->write_offset;
if (data_offset > 0) {
/* Subtract the control bytes */
@@ -1950,7 +1950,6 @@ static void ftdi_write_bulk_callback(struct urb *urb)
if (status) {
dbg("nonzero write bulk status received: %d", status);
- return;
}
usb_serial_port_softint(port);
--
1.6.2.5
next prev parent reply other threads:[~2009-11-18 3:11 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-24 15:40 [PATCH] USB: ftdi_sio: Remove tty->low_latency Johan Hovold
2009-09-24 19:03 ` Oliver Neukum
2009-09-24 19:21 ` Alan Cox
2009-09-24 21:15 ` Johan Hovold
2009-09-25 17:46 ` Michael Trimarchi
2009-09-29 14:55 ` Johan Hovold
2009-09-29 22:52 ` Alan Cox
2009-09-30 6:33 ` Michael Trimarchi
2009-09-30 9:05 ` Johan Hovold
2009-10-02 2:52 ` Eric W. Biederman
2009-10-02 8:47 ` Johan Hovold
2009-10-02 16:33 ` Alan Cox
2009-10-02 22:29 ` Eric W. Biederman
2009-10-03 10:21 ` Johan Hovold
2009-10-02 23:00 ` Eric W. Biederman
2009-10-03 13:09 ` Alan Cox
2009-10-03 23:51 ` Eric W. Biederman
2009-11-17 18:35 ` Eric W. Biederman
2009-11-17 18:41 ` Oliver Neukum
2009-11-17 18:56 ` Eric W. Biederman
2009-11-17 20:05 ` Eric W. Biederman
2009-11-18 1:08 ` Eric W. Biederman
2009-11-18 3:10 ` Eric W. Biederman [this message]
2009-11-18 3:44 ` [PATCH] ftdi_sio: Keep going when write errors are encountered Greg KH
2009-10-03 11:42 ` [PATCH] USB: ftdi_sio: Remove tty->low_latency Johan Hovold
2009-10-03 12:11 ` Oliver Neukum
2009-10-03 12:28 ` Johan Hovold
2009-10-03 13:31 ` Oliver Neukum
2009-10-03 14:41 ` Johan Hovold
2009-10-03 13:18 ` Alan Cox
2009-10-03 13:27 ` Oliver Neukum
2009-10-03 14:05 ` Johan Hovold
2009-10-03 16:33 ` Alan Cox
2009-10-03 16:46 ` Johan Hovold
2009-10-04 19:48 ` Johan Hovold
2009-10-04 23:39 ` Eric W. Biederman
2009-10-05 7:01 ` Johan Hovold
2009-10-02 16:59 ` Greg KH
2009-10-02 9:04 ` Alan Cox
2009-10-02 9:53 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m1fx8co7d3.fsf_-_@fess.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=gregkh@suse.de \
--cc=jhovold@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=oliver@neukum.org \
--cc=stern@rowland.harvard.edu \
--cc=trimarchi@gandalf.sssup.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).