summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2003-08-13 21:29:35 +0000
committersam <sam@FreeBSD.org>2003-08-13 21:29:35 +0000
commit238d3298f59d2e9e66d6fd5c859854349c58fdae (patch)
treeed26ae54275bdb5b2e09d4a732cee00c573e7cab /sys/dev
parent87156e6b9c7d5f3508533dfa673defcbe846c814 (diff)
downloadFreeBSD-src-238d3298f59d2e9e66d6fd5c859854349c58fdae.zip
FreeBSD-src-238d3298f59d2e9e66d6fd5c859854349c58fdae.tar.gz
Close a race where ath_intr is installed and may be called before
the HAL is setup: use sc_invalid to discard such entries into ath_intr. This can easily happen if the device is assigned a shared IRQ.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ath/if_ath.c5
-rw-r--r--sys/dev/ath/if_ath_pci.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 3c1c76b..598f66c 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -199,6 +199,7 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
goto bad;
}
sc->sc_ah = ah;
+ sc->sc_invalid = 0; /* ready to go, enable interrupt handling */
/*
* Collect the channel list using the default country
@@ -372,8 +373,8 @@ ath_intr(void *arg)
if (sc->sc_invalid) {
/*
- * The hardware is gone, don't touch anything.
- * XXX can this happen?
+ * The hardware is not ready/present, don't touch anything.
+ * Note this can happen early on if the IRQ is shared.
*/
DPRINTF(("ath_intr: invalid; ignored\n"));
return;
diff --git a/sys/dev/ath/if_ath_pci.c b/sys/dev/ath/if_ath_pci.c
index 34459de..ddf602d 100644
--- a/sys/dev/ath/if_ath_pci.c
+++ b/sys/dev/ath/if_ath_pci.c
@@ -152,6 +152,11 @@ ath_pci_attach(device_t dev)
}
sc->sc_st = rman_get_bustag(psc->sc_sr);
sc->sc_sh = rman_get_bushandle(psc->sc_sr);
+ /*
+ * Mark device invalid so any interrupts (shared or otherwise)
+ * that arrive before the HAL is setup are discarded.
+ */
+ sc->sc_invalid = 1;
/*
* Arrange interrupt line.
OpenPOWER on IntegriCloud