On Wed, Jun 13, 2012 at 7:20 AM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: > On Tue, 12 Jun 2012, Austin Schuh wrote: > >> On Tue, Jun 12, 2012 at 12:40 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: >> > If you get rid of the line saying: >> > >> > ehci->need_io_watchdog = 0; >> > >> > under the PCI_VENDOR_ID_INTEL case in >> > drivers/usb/host/ehci-pci.c:ehci_pci_setup(), it may help. >> >> That seems to have fixed it. Hmm... I used to be able to run my code >> anywhere from 3-30 times before it would hang. It is at 470 cycles >> right now and counting without an issue. >> >> Apart from building and deploying custom patched kernels everywhere >> that I need to run my code, is there something that I can do to help >> get this hack packaged up into something that could be submitted? Or, >> is there something else that I should look around for that could be >> the root cause of the problem? > > My first guess would be bad hardware. On the other hand, the fact that > the same thing happened on two computers with different chipsets argues > that it's not a hardware problem. > > A known software bug could also cause interrupts to get lost, although > I have never observed this. A patch (for the 3.4 kernel) to fix this > bug is below; you could try it with ehci->need_io_watchdog set back to > 0. The fix below with ehci->need_io_watchdog set to 0 locks up. > Are the two computers you tried both SMP systems? Both systems are SMP. desktop: 2.6.38.8 #11 SMP Tue Jun 12 18:47:20 PDT 2012 x86_64 GNU/Linux laptop: 2.6.38-15-generic #60~lucid1-Ubuntu SMP Wed May 23 15:04:42 UTC 2012 x86_64 GNU/Linux To add another data point, I ran the code on a machine with USB Controller: nVidia Corporation MCP79 EHCI USB 2.0 Controller (rev b1) and kernel 2.6.32-41-generic #89-Ubuntu SMP Fri Apr 27 22:18:56 UTC 2012 x86_64 GNU/Linux and it worked. I ran it for over 1000 cycles without issue. > Alan Stern > > > > Index: v/drivers/usb/host/ehci.h > =================================================================== > --- v.orig/drivers/usb/host/ehci.h > +++ v/drivers/usb/host/ehci.h > @@ -83,7 +83,8 @@ struct ehci_hcd { /* one per controlle > struct ehci_qh *dummy; /* For AMD quirk use */ > struct ehci_qh *reclaim; > struct ehci_qh *qh_scan_next; > - unsigned scanning : 1; > + bool scanning:1; > + bool need_rescan:1; > > /* periodic schedule support */ > #define DEFAULT_I_TDPS 1024 /* some HCs can do less */ > Index: v/drivers/usb/host/ehci-hcd.c > =================================================================== > --- v.orig/drivers/usb/host/ehci-hcd.c > +++ v/drivers/usb/host/ehci-hcd.c > @@ -535,13 +535,20 @@ static void ehci_work (struct ehci_hcd * > * it reports urb completions. this flag guards against bogus > * attempts at re-entrant schedule scanning. > */ > - if (ehci->scanning) > + if (ehci->scanning) { > + ehci->need_rescan = true; > return; > - ehci->scanning = 1; > + } > + ehci->scanning = true; > + > + rescan: > + ehci->need_rescan = false; > scan_async (ehci); > if (ehci->next_uframe != -1) > scan_periodic (ehci); > - ehci->scanning = 0; > + if (ehci->need_rescan) > + goto rescan; > + ehci->scanning = false; > > /* the IO watchdog guards against hardware or driver bugs that > * misplace IRQs, and should let us run completely without IRQs. > -- 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