On Sat, 2 Dec 2006 17:08:02 -0500 (EST) Alan Stern wrote: > On Sat, 2 Dec 2006, David Relson wrote:
....[snip].... > Remind me of the context again; it has slipped my mind. You were > getting random disconnects that sometimes (or always?) ended up > hanging the USB subsystem? > > The logs you sent indicate a problem with your EHCI controller; it is > failing to report the completion of an unlink event. Interestingly, > in yours (and almost every other occurrence of this same problem) the > unlink was for an endpoint on a device that had just been > disconnected. > > David Brownell had a patch at one point to try and work around these > errors, but I've lost track of it (and it caused problems on some > Macs so it was rejected, but you might want to try it out anyway). > There's an old version of it as the first attachment to this bug > report: > > http://bugzilla.kernel.org/show_bug.cgi?id=6374 > > I don't know if there are any later versions. > > Alan Stern Hi Alan, Most of the patch applies fine, but there were several rejects. It seems that end_unlink_async () has change from 2 arguments (in 2.6.17) to 1 argument (in 2.6.19). I've made manual changes as best I can. However the patch does cause 1 compiler error message (from gcc 4.1.1 (Gentoo 4.1.1-r1)): CC [M] drivers/usb/host/ehci-hcd.o drivers/usb/host/ehci-hcd.c: In function 'ehci_urb_dequeue': drivers/usb/host/ehci-hcd.c:847: error: label at end of compound statement make[3]: *** [drivers/usb/host/ehci-hcd.o] Error 1 Part of the bug 8020 patch adds the following switch statement. @@ -755,7 +769,19 @@ static int ehci_urb_dequeue (struct usb_ qh = (struct ehci_qh *) urb->hcpriv; if (!qh) break; - unlink_async (ehci, qh); + switch (qh->qh_state) { + case QH_STATE_LINKED: + unlink_async (ehci, qh); + break; + case QH_STATE_UNLINK: + case QH_STATE_UNLINK_WAIT: + /* already started */ + break; + case QH_STATE_IDLE: + WARN_ON(1); + break; + case QH_STATE_COMPLETING: + } break; case PIPE_INTERRUPT: ehci-q.c sets state QH_STATE_COMPLETING, so it seems that the case statement _should_ do something It would seem that something is missing here! To satisfy gcc, I've added a break statement, but suspect something else is needed. I've not yet started using the patched code... In the wee hours of this morning, i.e. 05:02, the following messages were logged: ... hub 1-0:1.0: state 7 ports 6 chg 0000 evt 0004 ... ehci_hcd 0000:00:10.3: GetStatus port 2 status 00180b POWER sig=j PEC CSC CONNECT ... hub 1-0:1.0: port 2, status 0501, change 0003, 480 Mb/s ... usb 1-2: USB disconnect, address 2 ... usb 1-2: unregistering device ... usb 1-2: usb_disable_device nuking all URBs ... ehci_hcd 0000:00:10.3: shutdown urb f57d3860 pipe c0040280 ep8in-bulk ... usb 1-2: usb_sg_cancel, unlink --> -19 and the USB subsystem hung. The dmesg output appears similar to yesterday's. Do you want it? Regards, David ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel