Date: Mon, 20 Aug 2007 13:04:05 +0000 (UTC) From: Don Lewis <truckman@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/dev/usb ehci.c Message-ID: <200708201304.l7KD45I5080770@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
truckman 2007-08-20 13:04:05 UTC FreeBSD src repository Modified files: (Branch: RELENG_6) sys/dev/usb ehci.c Log: MFC ehci.c 1.56 Replace three copies of the host controller reset sequence that differ in their details with calls to a new function, ehci_hcreset(), that performs the reset. The original sequences either had no delay or a 1ms delay between telling the controller to stop and asserting the controller reset bit. One instance of the original reset sequence waited for the controller to indicate that its reset was complete before continuing, but the other two immediately let the subsequent code execute. The latter is a problem on some hardware, because a read of the HCCPARAMS register returns an incorrect value while the reset is in progress, which triggers an infinite loop in ehci_pci_givecontroller(), which hangs the system on shutdown. The reset sequence in ehci_hcreset() starts with the most complete instance from the original code, which contains a loop to wait for the controller to indicate that its reset is complete. This appears to be the correct thing to do according to "Enhanced Host Controller Interface Specification for Universal Serial Bus" revision 1.0, section 2.3.1. Add another loop to wait for the controller to indicate that it has stopped before setting the HCRESET bit. This is required by the section 2.3.1 in the specification, which says that setting HCRESET before the controller has halted "will result in undefined behaviour". Revision Changes Path 1.36.2.4 +37 -18 src/sys/dev/usb/ehci.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708201304.l7KD45I5080770>