Date: Wed, 6 Aug 2003 10:37:35 -0700 (PDT) From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 35635 for review Message-ID: <200308061737.h76HbZvf061568@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=35635 Change 35635 by sam@sam_ebb on 2003/08/06 10:37:15 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. Affected files ... .. //depot/projects/netperf/sys/dev/ath/if_ath.c#4 edit .. //depot/projects/netperf/sys/dev/ath/if_ath_pci.c#2 edit Differences ... ==== //depot/projects/netperf/sys/dev/ath/if_ath.c#4 (text+ko) ==== @@ -199,6 +199,7 @@ 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 @@ 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; ==== //depot/projects/netperf/sys/dev/ath/if_ath_pci.c#2 (text+ko) ==== @@ -152,6 +152,11 @@ } 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200308061737.h76HbZvf061568>