Re: [PATCH] USB: serial: ti_usb_3410_5052: Avoid goto in bulk in callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 13, 2017 at 12:32:47PM +0100, Ladislav Michl wrote:
> On Wed, Dec 13, 2017 at 12:16:05PM +0100, Johan Hovold wrote:
> > On Mon, Dec 11, 2017 at 01:44:57PM +0100, Ladislav Michl wrote:
> > > 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 :)
> > 
> > No, we do not provide any error notification besides logging an error
> > when an endpoint has been stalled (i.e. in case of a read, you would not
> > receive any more data before the halt condition has been cleared).
> 
> Hmm, could we make 1aba579f3cf5 a bit more generic then?

I'm not sure this is worth the complexity it adds, or that it really
solves anything as the fundamental problem remains; simply clearing the
Halt is not sufficient unless the underlying reason for the condition
triggering the stall has first been removed (and that is going to be
device specific).

> > Given that there's been no reports about this being an issue (for the
> > past ten years and that I can recall), this crude handling appears to
> > suffice.
> 
> Because embedded people tend to power cycle stuck device on timeout.
> That involves project specific hacks in userspace, which could be
> probably handled better.

I haven't seen any reports of this being an issue (and your stalled CDC
device was really due to a hardware/power issue IIRC) so again, I'm not
convinced this gives us anything.

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



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux