From d50c198afa1c3b4d17a02f0f0e13e046422a278a Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sun, 28 Dec 2008 23:08:07 +0000 Subject: Ignore hotploug events while still in autoconf. Fixes problems with some machines that get a spurious hotplug reove event when resetting their onboard re(4). --- sys/dev/pci/ppb.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/ppb.c b/sys/dev/pci/ppb.c index 47d47bf75e3..f5d98e8cbbe 100644 --- a/sys/dev/pci/ppb.c +++ b/sys/dev/pci/ppb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ppb.c,v 1.27 2008/09/10 14:01:23 blambert Exp $ */ +/* $OpenBSD: ppb.c,v 1.28 2008/12/28 23:08:06 kettenis Exp $ */ /* $NetBSD: ppb.c,v 1.16 1997/06/06 23:48:05 thorpej Exp $ */ /* @@ -202,6 +202,16 @@ ppb_intr(void *arg) struct ppb_softc *sc = arg; pcireg_t reg; + /* + * XXX ignore hotplug events while in autoconf. On some + * machines with onboard re(4), we gat a bogus hotplug remove + * event when we reset that device. Ignoring that event makes + * sure we will not try to forcibly detach re(4) when it isn't + * ready to deal with that. + */ + if (cold) + return (0); + reg = pci_conf_read(sc->sc_pc, sc->sc_tag, sc->sc_cap_off + PCI_PCIE_SLCSR); if (reg & PCI_PCIE_SLCSR_PDC) { -- cgit v1.2.3