All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ladislav Michl <ladis@linux-mips.org>
To: Johan Hovold <johan@kernel.org>
Cc: linux-usb@vger.kernel.org
Subject: USB: serial: ti_usb_3410_5052: Avoid goto in bulk in callback
Date: Mon, 11 Dec 2017 13:44:57 +0100	[thread overview]
Message-ID: <20171211124457.GA22603@lenoch> (raw)

On Mon, Dec 11, 2017 at 12:52:46PM +0100, Johan Hovold wrote:
> On Mon, Dec 11, 2017 at 12:32:49PM +0100, Ladislav Michl wrote:
> > On Mon, Dec 11, 2017 at 11:10:35AM +0100, Johan Hovold wrote:
[snip]
> > > I'm afraid I don't consider this an improvement. I prefer using gotos
> > > for error paths, while keeping the success path out of the status
> > > switch.
> > > 
> > > Furthermore, this isn't functionally equivalent as we'd not longer log
> > > an error for -EPIPE.
> > 
> > Yes, you are right... Now, shouldn't we react somehow to stalled endpoint?
> > Tty side seems to be unaware of it.
> 
> Recovering from a stalled endpoint is a bit involved, so for now we
> typically just log an error an bail out (forcing the user to reopen the
> port). This seems to work well enough as this condition should be rare.

I just do not see this in code. I would expect pending tty I/O operation
would fail once USB device errors out with -EPIPE, so tty side consumer gets
notified about error. Either it is not there or I did not look hard enough :)

> > > In fact, that -EPIPE is already on my TODO list as we really should not
> > > be resubmitting URBs for a stalled endpoint in the first place. That in
> > > turn should allow for some clean up of this callback.
> > 
> > Out of curiosity, how would be stalled endpoint reported?
> 
> Simply logging that the urb has been stopped along with the URB status
> (-EPIPE) should be enough.

See above.

> Johan

Best regards,
	ladis
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2017-12-11 12:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 12:44 Ladislav Michl [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-12-13 11:50 USB: serial: ti_usb_3410_5052: Avoid goto in bulk in callback Johan Hovold
2017-12-13 11:32 Ladislav Michl
2017-12-13 11:16 Johan Hovold
2017-12-11 11:52 Johan Hovold
2017-12-11 11:32 Ladislav Michl
2017-12-11 10:10 Johan Hovold
2017-12-10 23:09 Ladislav Michl

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=20171211124457.GA22603@lenoch \
    --to=ladis@linux-mips.org \
    --cc=johan@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.