From owner-freebsd-bugs@FreeBSD.ORG Fri Feb 17 03:50:11 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 965D5106564A for ; Fri, 17 Feb 2012 03:50:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 85B568FC15 for ; Fri, 17 Feb 2012 03:50:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q1H3oB1l059023 for ; Fri, 17 Feb 2012 03:50:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q1H3oBKj059019; Fri, 17 Feb 2012 03:50:11 GMT (envelope-from gnats) Date: Fri, 17 Feb 2012 03:50:11 GMT Message-Id: <201202170350.q1H3oBKj059019@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: kern/165220: commit references a PR X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 03:50:11 -0000 The following reply was made to PR kern/165220; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/165220: commit references a PR Date: Fri, 17 Feb 2012 03:46:48 +0000 (UTC) Author: adrian Date: Fri Feb 17 03:46:38 2012 New Revision: 231857 URL: http://svn.freebsd.org/changeset/base/231857 Log: Enforce some consistent ordering and handling of interrupt disable/enable with RX/TX halting. * Always disable/enable interrupts during a channel change, just to simply things. * Ensure that the ath taskqueue has completed and is paused before continuing. This dramatically reduces the instances of overlapping RX and reset conditions. PR: kern/165220 Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Feb 17 03:39:06 2012 (r231856) +++ head/sys/dev/ath/if_ath.c Fri Feb 17 03:46:38 2012 (r231857) @@ -1934,6 +1934,7 @@ ath_txrx_stop_locked(struct ath_softc *s } #undef MAX_TXRX_ITERATIONS +#if 0 static void ath_txrx_stop(struct ath_softc *sc) { @@ -1944,6 +1945,7 @@ ath_txrx_stop(struct ath_softc *sc) ath_txrx_stop_locked(sc); ATH_PCU_UNLOCK(sc); } +#endif static void ath_txrx_start(struct ath_softc *sc) @@ -2049,11 +2051,12 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T ATH_UNLOCK_ASSERT(sc); ATH_PCU_LOCK(sc); + ath_hal_intrset(ah, 0); /* disable interrupts */ + ath_txrx_stop_locked(sc); /* Ensure TX/RX is stopped */ if (ath_reset_grablock(sc, 1) == 0) { device_printf(sc->sc_dev, "%s: concurrent reset! Danger!\n", __func__); } - ath_hal_intrset(ah, 0); /* disable interrupts */ ATH_PCU_UNLOCK(sc); /* @@ -2061,7 +2064,6 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T * and block future ones from occuring. This needs to be * done before the TX queue is drained. */ - ath_txrx_stop(sc); ath_draintxq(sc, reset_type); /* stop xmit side */ /* @@ -5383,21 +5385,16 @@ ath_chan_set(struct ath_softc *sc, struc struct ieee80211com *ic = ifp->if_l2com; struct ath_hal *ah = sc->sc_ah; int ret = 0; - int dointr = 0; /* Treat this as an interface reset */ ATH_PCU_LOCK(sc); + ath_hal_intrset(ah, 0); /* Stop new RX/TX completion */ + ath_txrx_stop_locked(sc); /* Stop pending RX/TX completion */ if (ath_reset_grablock(sc, 1) == 0) { device_printf(sc->sc_dev, "%s: concurrent reset! Danger!\n", __func__); } - if (chan != sc->sc_curchan) { - dointr = 1; - /* XXX only do this if inreset_cnt is 1? */ - ath_hal_intrset(ah, 0); - } ATH_PCU_UNLOCK(sc); - ath_txrx_stop(sc); DPRINTF(sc, ATH_DEBUG_RESET, "%s: %u (%u MHz, flags 0x%x)\n", __func__, ieee80211_chan2ieee(ic, chan), @@ -5466,10 +5463,10 @@ ath_chan_set(struct ath_softc *sc, struc ath_beacon_config(sc, NULL); } -#if 0 /* * Re-enable interrupts. */ +#if 0 ath_hal_intrset(ah, sc->sc_imask); #endif } @@ -5478,8 +5475,7 @@ finish: ATH_PCU_LOCK(sc); sc->sc_inreset_cnt--; /* XXX only do this if sc_inreset_cnt == 0? */ - if (dointr) - ath_hal_intrset(ah, sc->sc_imask); + ath_hal_intrset(ah, sc->sc_imask); ATH_PCU_UNLOCK(sc); /* XXX do this inside of IF_LOCK? */ _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"