int err;
err = bus_generic_shutdown(self);
- if (err)
- return (err);
- ehci_shutdown(sc);
- ehci_pci_givecontroller(self);
+ if (sc->sc_flags & EHCI_SCFLG_DONEINIT) {
+ ehci_shutdown(sc);
+ ehci_pci_givecontroller(self);
+ }
- return 0;
+ return err;
}
static const char *
}
}
+/*
+ * Return the controller to the BIOS. Do we really need to do this?
+ *
+ * One thing we do need to do is give the chip reset (from the shutdown)
+ * time to finish before handing anything back. This fixes a machine
+ * lockup.
+ */
static void
ehci_pci_givecontroller(device_t self)
{
u_int32_t cparams, eec, legsup;
int eecp;
+ DELAY(1000);
cparams = EREAD4(sc, EHCI_HCCPARAMS);
for (eecp = EHCI_HCC_EECP(cparams); eecp != 0;
eecp = EHCI_EECP_NEXT(eec)) {