Re: BUG: remove ASS/PSS polling timeout

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

 



On Wed, 20 Feb 2013, Ronald wrote:

> Paul Hartman pointed me at the kernel cmdline option log_buf_len=16M.
> It's kind of confusing that the compile time option is mentioning a
> limit while the kernel cmdline option is limit free. I forgot about
> those differences. Attached is a complete log without wrapping (thanks
> Paul!). I have annotated the events with markers such as '::::::'.
> 
> If this message fails to make it to the list, then I will post another
> scribd link.

The output is all too clear.  Both of you are using EHCI controllers
made by VIA, and they both exhibit this same problem -- which is
clearly caused by a silicon bug.

It's entirely possible that the NVIDIA controller for which I wrote
this commit has a related bug (though not exactly the same one, because 
that controller worked okay with it).  At any rate, it seemed that the 
NVIDIA problem was actually fixed by commit 6e0c3339a6f1 rather than by 
the problem-causing commit 55bcdce8a822.

It does look like the only way to work around this hardware bug is to
revert that commit.  Below is a patch that does that, and it also
lowers the timeout period from 20 ms to about 4 ms.  This won't affect
non-broken systems, because they update the schedule status bits in
well under 1 ms.  And it appears that broken systems _never_ update the
status bits, so using a long timeout is pointless.

Let me know how this works.

Alan Stern



Index: usb-3.8/drivers/usb/host/ehci-timer.c
===================================================================
--- usb-3.8.orig/drivers/usb/host/ehci-timer.c
+++ usb-3.8/drivers/usb/host/ehci-timer.c
@@ -113,15 +113,14 @@ static void ehci_poll_ASS(struct ehci_hc
 
 	if (want != actual) {
 
-		/* Poll again later */
-		ehci_enable_event(ehci, EHCI_HRTIMER_POLL_ASS, true);
-		++ehci->ASS_poll_count;
-		return;
+		/* Poll again later, but give up after about 2-4 ms */
+		if (ehci->ASS_poll_count++ < 2) {
+			ehci_enable_event(ehci, EHCI_HRTIMER_POLL_ASS, true);
+			return;
+		}
+		ehci_dbg(ehci, "Waited too long for the async schedule status (%x/%x), giving up\n",
+				want, actual);
 	}
-
-	if (ehci->ASS_poll_count > 20)
-		ehci_dbg(ehci, "ASS poll count reached %d\n",
-				ehci->ASS_poll_count);
 	ehci->ASS_poll_count = 0;
 
 	/* The status is up-to-date; restart or stop the schedule as needed */
@@ -160,14 +159,14 @@ static void ehci_poll_PSS(struct ehci_hc
 
 	if (want != actual) {
 
-		/* Poll again later */
-		ehci_enable_event(ehci, EHCI_HRTIMER_POLL_PSS, true);
-		return;
+		/* Poll again later, but give up after about 2-4 ms */
+		if (ehci->PSS_poll_count++ < 2) {
+			ehci_enable_event(ehci, EHCI_HRTIMER_POLL_PSS, true);
+			return;
+		}
+		ehci_dbg(ehci, "Waited too long for the periodic schedule status (%x/%x), giving up\n",
+				want, actual);
 	}
-
-	if (ehci->PSS_poll_count > 20)
-		ehci_dbg(ehci, "PSS poll count reached %d\n",
-				ehci->PSS_poll_count);
 	ehci->PSS_poll_count = 0;
 
 	/* The status is up-to-date; restart or stop the schedule as needed */

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