Re: cannot submit urb 0, error -22: internal error followed by USB hung tasks

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

 



On Sun, 30 Sep 2012, Alan Stern wrote:

> To be honest, I could write a fairly simple change to the driver that
> would work around this hardware bug most of the time.  But it wouldn't
> be perfect; occasionally the problem would still show up.

I decided to go ahead and write a quick patch, below.  Let me know if 
you get a chance to try it out.

Alan Stern



Index: usb-3.6/drivers/usb/host/ohci-q.c
===================================================================
--- usb-3.6.orig/drivers/usb/host/ohci-q.c
+++ usb-3.6/drivers/usb/host/ohci-q.c
@@ -1128,6 +1128,25 @@ dl_done_list (struct ohci_hcd *ohci)
 
 	while (td) {
 		struct td	*td_next = td->next_dl_td;
+		struct ed	*ed = td->ed;
+
+		/*
+		 * Some OHCI controllers occasionally forget to add TDs
+		 * to the donelist.  Since TDs for a given endpoint must
+		 * always be processed in order, if we find a TD on the
+		 * donelist then all of its predecessors must be finished
+		 * as well.
+		 */
+		for (;;) {
+			struct td	*td2;
+
+			td2 = list_first_entry(&ed->td_list, struct td,
+					td_list);
+			if (td2 == td)
+				break;
+			takeback_td(ohci, td2);
+		}
+
 		takeback_td(ohci, td);
 		td = td_next;
 	}


--
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