Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38e2bfc9 authored by Pete Zaitcev's avatar Pete Zaitcev Committed by Greg Kroah-Hartman
Browse files

USB: Dealias -110 code (more complete)



The purpose of this patch is to split off the case when a device does
not reply on the lower level (which is reported by HC hardware), and
a case when the device accepted the request, but does not reply at
upper level. This redefinition allows to diagnose issues easier,
without asking the user if the -110 happened "immediately".

The usbmon splits such cases already thanks to its timestamp, but
it's not always available.

I adjusted all drivers which I found affected (by searching for "urb").
Out of tree drivers may suffer a little bit, but I do not expect much
breakage. At worst they may print a few messages.

Signed-off-by: default avatarPete Zaitcev <zaitcev@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ec17cf1c
Loading
Loading
Loading
Loading
+4 −7
Original line number Original line Diff line number Diff line
@@ -98,13 +98,13 @@ one or more packets could finish before an error stops further endpoint I/O.
			error, a failure to respond (often caused by
			error, a failure to respond (often caused by
			device disconnect), or some other fault.
			device disconnect), or some other fault.


-ETIMEDOUT (**)		No response packet received within the prescribed
-ETIME (**)		No response packet received within the prescribed
			bus turn-around time.  This error may instead be
			bus turn-around time.  This error may instead be
			reported as -EPROTO or -EILSEQ.
			reported as -EPROTO or -EILSEQ.


			Note that the synchronous USB message functions
-ETIMEDOUT		Synchronous USB message functions use this code
			also use this code to indicate timeout expired
			to indicate timeout expired before the transfer
			before the transfer completed.
			completed, and no other error was reported by HC.


-EPIPE (**)		Endpoint stalled.  For non-control endpoints,
-EPIPE (**)		Endpoint stalled.  For non-control endpoints,
			reset this status with usb_clear_halt().
			reset this status with usb_clear_halt().
@@ -163,6 +163,3 @@ usb_get_*/usb_set_*():
usb_control_msg():
usb_control_msg():
usb_bulk_msg():
usb_bulk_msg():
-ETIMEDOUT		Timeout expired before the transfer completed.
-ETIMEDOUT		Timeout expired before the transfer completed.
			In the future this code may change to -ETIME,
			whose definition is a closer match to this sort
			of error.
+1 −1
Original line number Original line Diff line number Diff line
@@ -192,7 +192,7 @@ static char *get_usb_statmsg(int status)
		return "bit stuffing error, timeout, or unknown USB error";
		return "bit stuffing error, timeout, or unknown USB error";
	case -EILSEQ:
	case -EILSEQ:
		return "CRC mismatch, timeout, or unknown USB error";
		return "CRC mismatch, timeout, or unknown USB error";
	case -ETIMEDOUT:
	case -ETIME:
		return "timed out";
		return "timed out";
	case -EPIPE:
	case -EPIPE:
		return "endpoint stalled";
		return "endpoint stalled";
+3 −3
Original line number Original line Diff line number Diff line
@@ -137,11 +137,11 @@ static struct hfcusb_symbolic_list urb_errlist[] = {
	{-ENXIO, "URB already queued"},
	{-ENXIO, "URB already queued"},
	{-EFBIG, "Too much ISO frames requested"},
	{-EFBIG, "Too much ISO frames requested"},
	{-ENOSR, "Buffer error (overrun)"},
	{-ENOSR, "Buffer error (overrun)"},
	{-EPIPE, "Specified endpoint is stalled (device not responding)"},
	{-EPIPE, "Specified endpoint is stalled"},
	{-EOVERFLOW, "Babble (bad cable?)"},
	{-EOVERFLOW, "Babble (bad cable?)"},
	{-EPROTO, "Bit-stuff error (bad cable?)"},
	{-EPROTO, "Bit-stuff error (bad cable?)"},
	{-EILSEQ, "CRC/Timeout"},
	{-EILSEQ, "CRC or missing token"},
	{-ETIMEDOUT, "NAK (device does not respond)"},
	{-ETIME, "Device did not respond"},
	{-ESHUTDOWN, "Device unplugged"},
	{-ESHUTDOWN, "Device unplugged"},
	{-1, NULL}
	{-1, NULL}
};
};
+0 −1
Original line number Original line Diff line number Diff line
@@ -80,7 +80,6 @@ static void dvb_usb_urb_complete(struct urb *urb, struct pt_regs *ptregs)


	switch (urb->status) {
	switch (urb->status) {
		case 0:         /* success */
		case 0:         /* success */
		case -ETIMEDOUT:    /* NAK */
			break;
			break;
		case -ECONNRESET:   /* kill */
		case -ECONNRESET:   /* kill */
		case -ENOENT:
		case -ENOENT:
+1 −1
Original line number Original line Diff line number Diff line
@@ -215,7 +215,7 @@ static void ttusb_dec_handle_irq( struct urb *urb, struct pt_regs *regs)
		case -ECONNRESET:
		case -ECONNRESET:
		case -ENOENT:
		case -ENOENT:
		case -ESHUTDOWN:
		case -ESHUTDOWN:
		case -ETIMEDOUT:
		case -ETIME:
			/* this urb is dead, cleanup */
			/* this urb is dead, cleanup */
			dprintk("%s:urb shutting down with status: %d\n",
			dprintk("%s:urb shutting down with status: %d\n",
					__FUNCTION__, urb->status);
					__FUNCTION__, urb->status);
Loading