linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Johan Hovold <jhovold@gmail.com>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	Michael Trimarchi <trimarchi@gandalf.sssup.it>,
	Oliver Neukum <oliver@neukum.org>,
	linux-usb@vger.kernel.org, Alan Cox <alan@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	Alan Stern <stern@rowland.harvard.edu>
Subject: Re: [PATCH] USB: ftdi_sio: Remove tty->low_latency.
Date: Tue, 17 Nov 2009 10:35:07 -0800	[thread overview]
Message-ID: <m13a4df19g.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <20091003140902.38628d8a@lxorguk.ukuu.org.uk> (Alan Cox's message of "Sat\, 3 Oct 2009 14\:09\:02 +0100")

Alan Cox <alan@lxorguk.ukuu.org.uk> writes:

> On Fri, 02 Oct 2009 16:00:41 -0700
> ebiederm@xmission.com (Eric W. Biederman) wrote:
>
>>
>>
>> I have seen a hang in:
>>   /bin/stty (changing the baud rate)
>>     set_termios
>>       tty_wait_until_sent
>>         tty_chars_in_buffer
>>           ftdi_chars_in_buffer
>>
>> Where the driver wedged for a serial port and no progress
>> was made.
>>
>> This happened to me several times with 2.6.31.  My initial
>> hypothesis was this was a hardware error (as it only happened
>> on single piece of hardware).  With all of the driver problems
>> I suspect it could be a driver bug.
>
> Driver bug I would think - or setup. If you've genuinely got the port
> flow controlled then a request to set the termios after the I/O will wait
> until a signal or carrier change (or indeed forever) quite correctly.

I have finally tracked this one down.  But I'm not certain if there is
anything we can do in software to make things better.

Boiled down.  ftdi_chars_in_buffer is essentially priv->tx_outstanding_bytes.
tx_outstanding_bytes is incremented when an urb request is sent and
tx_outstanding_bytes is decremented when an urb request completes.

It turns out I have a moderately noisy usb line, and so I occasionally
get messages like:

ehci_hcd 0000:00:0a.1: detected XactErr len 0/7 retry 31

Which as best as I can tell result in the urb getting abandoned and
neither completed nor canceled (because we have hit the maximum
retry count and they still don't succeed).

Which appears to result in tx_outstanding_bytes getting stuck at
some positive number.


Is it possible to handle this more gracefully in software?
Is it possible to handle this in a way that makes it clear there
was a hardware error that we could not recover from.  A little
debug level error doesn't usually even make it to the log.

Eric

  parent reply	other threads:[~2009-11-17 18:35 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 [this message]
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                             ` [PATCH] ftdi_sio: Keep going when write errors are encountered Eric W. Biederman
2009-11-18  3:44                               ` 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=m13a4df19g.fsf@fess.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=alan@redhat.com \
    --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).