diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2019-09-05 17:59:13 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2019-09-05 17:59:13 +0000 |
commit | 4604f9277a8529dfa1fe1e854d097bfdafa3beac (patch) | |
tree | b7f3eb16d7ae6a665f241d7e66acf4e462713cc6 | |
parent | 75f4986c2aa036b6d2541a0d8cbfb1e814b4dd2e (diff) |
Supermicro X8DTH-i/6/iF/6F fails to attach uhci(4) via PCI and AHCI.
Result is a crash at power down. Skip the activate function if
attach has failed. Solution taken from ehci(4).
OK deraadt@ kettenis@
-rw-r--r-- | sys/dev/pci/uhci_pci.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/pci/uhci_pci.c b/sys/dev/pci/uhci_pci.c index ecf629cbfa2..eef57159447 100644 --- a/sys/dev/pci/uhci_pci.c +++ b/sys/dev/pci/uhci_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhci_pci.c,v 1.33 2014/05/16 18:17:03 mpi Exp $ */ +/* $OpenBSD: uhci_pci.c,v 1.34 2019/09/05 17:59:12 bluhm Exp $ */ /* $NetBSD: uhci_pci.c,v 1.24 2002/10/02 16:51:58 thorpej Exp $ */ /* @@ -86,6 +86,9 @@ uhci_pci_activate(struct device *self, int act) { struct uhci_pci_softc *sc = (struct uhci_pci_softc *)self; + if (sc->sc.sc_size == 0) + return 0; + /* On resume, set legacy support attribute and enable intrs */ switch (act) { case DVACT_RESUME: @@ -190,6 +193,7 @@ uhci_pci_attach(struct device *parent, struct device *self, void *aux) unmap_ret: bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc.sc_size); + sc->sc.sc_size = 0; splx(s); } @@ -218,6 +222,7 @@ uhci_pci_attach_deferred(struct device *self) unmap_ret: bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc.sc_size); pci_intr_disestablish(sc->sc_pc, sc->sc_ih); + sc->sc.sc_size = 0; splx(s); } |