diff options
author | jhb <jhb@FreeBSD.org> | 2008-03-12 20:57:17 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2008-03-12 20:57:17 +0000 |
commit | 3bce78576c979c347173af624aba96b8cd85b98f (patch) | |
tree | 8cac8c919015b82b3e0aa386afae2dd647a45103 /sys/dev/usb/ehci_pci.c | |
parent | b888c162a39382d7fc22eda8352fb1bf9028d438 (diff) | |
download | FreeBSD-src-3bce78576c979c347173af624aba96b8cd85b98f.zip FreeBSD-src-3bce78576c979c347173af624aba96b8cd85b98f.tar.gz |
Relax the BIOS/OS sempahore handoff code to workaround different hard
hangs (one at boot, one at shutdown) in recent machines. First, only try
to take ownership of the EHCI controller if the BIOS currently owns the
controller. On a HP DL160 G5, the machine hangs when we try to take
ownership. Second, don't bother trying to give up ownership of the
controller during shutdown. It's not strictly required and a Dell DCS S29
hangs on shutdown after the config write.
Both of these changes match the behavior of the Linux EHCI driver. I also
think both of these hangs are caused by bugs in the BIOS' SMM handler
causing it to get stuck in an infinite loop in SMM.
MFC after: 1 week
Diffstat (limited to 'sys/dev/usb/ehci_pci.c')
-rw-r--r-- | sys/dev/usb/ehci_pci.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/usb/ehci_pci.c b/sys/dev/usb/ehci_pci.c index d64dd5c..e8e3540 100644 --- a/sys/dev/usb/ehci_pci.c +++ b/sys/dev/usb/ehci_pci.c @@ -538,8 +538,9 @@ ehci_pci_takecontroller(device_t self) if (EHCI_EECP_ID(eec) != EHCI_EC_LEGSUP) continue; legsup = eec; - pci_write_config(self, eecp, legsup | EHCI_LEGSUP_OSOWNED, 4); if (legsup & EHCI_LEGSUP_BIOSOWNED) { + pci_write_config(self, eecp, + legsup | EHCI_LEGSUP_OSOWNED, 4); printf("%s: waiting for BIOS to give up control\n", device_get_nameunit(sc->sc_bus.bdev)); for (i = 0; i < 5000; i++) { @@ -558,6 +559,7 @@ ehci_pci_takecontroller(device_t self) static void ehci_pci_givecontroller(device_t self) { +#if 0 ehci_softc_t *sc = device_get_softc(self); u_int32_t cparams, eec, legsup; int eecp; @@ -571,6 +573,7 @@ ehci_pci_givecontroller(device_t self) legsup = eec; pci_write_config(self, eecp, legsup & ~EHCI_LEGSUP_OSOWNED, 4); } +#endif } static device_method_t ehci_methods[] = { |