From owner-freebsd-bugs@FreeBSD.ORG Fri May 10 10:10:01 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 859B0CF for ; Fri, 10 May 2013 10:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 67204EDB for ; Fri, 10 May 2013 10:10:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r4AAA1CS091431 for ; Fri, 10 May 2013 10:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r4AAA1wh091430; Fri, 10 May 2013 10:10:01 GMT (envelope-from gnats) Date: Fri, 10 May 2013 10:10:01 GMT Message-Id: <201305101010.r4AAA1wh091430@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: dfilter@FreeBSD.ORG (dfilter service) Subject: Re: kern/178477: commit references a PR X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 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, 10 May 2013 10:10:01 -0000 The following reply was made to PR kern/178477; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/178477: commit references a PR Date: Fri, 10 May 2013 10:06:53 +0000 (UTC) Author: adrian Date: Fri May 10 10:06:45 2013 New Revision: 250444 URL: http://svnweb.freebsd.org/changeset/base/250444 Log: Make sure the holding descriptor and link pointer are both freed during a non-loss reset. When the drain functions are called, the holding descriptor and link pointers are NULLed out. But when the processq function is called during a non-loss reset, this doesn't occur. So the next time a DMA occurs, it's chained to a descriptor that no longer exists and the hardware gets angry. Tested: * AR5416, STA mode; use sysctl dev.ath.X.forcebstuck=1 to force a non-loss reset. TODO: * Further AR9380 testing just to check that the behaviour for the EDMA chips is sane. PR: kern/178477 Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri May 10 09:58:32 2013 (r250443) +++ head/sys/dev/ath/if_ath.c Fri May 10 10:06:45 2013 (r250444) @@ -4668,9 +4668,21 @@ ath_legacy_tx_drain(struct ath_softc *sc if (sc->sc_debug & ATH_DEBUG_RESET) ath_tx_dump(sc, &sc->sc_txq[i]); #endif /* ATH_DEBUG */ - if (reset_type == ATH_RESET_NOLOSS) + if (reset_type == ATH_RESET_NOLOSS) { ath_tx_processq(sc, &sc->sc_txq[i], 0); - else + ATH_TXQ_LOCK(&sc->sc_txq[i]); + /* + * Free the holding buffer; DMA is now + * stopped. + */ + ath_txq_freeholdingbuf(sc, &sc->sc_txq[i]); + /* + * Reset the link pointer to NULL; there's + * no frames to chain DMA to. + */ + sc->sc_txq[i].axq_link = NULL; + ATH_TXQ_UNLOCK(&sc->sc_txq[i]); + } else ath_tx_draintxq(sc, &sc->sc_txq[i]); } } Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Fri May 10 09:58:32 2013 (r250443) +++ head/sys/dev/ath/if_ath_tx_edma.c Fri May 10 10:06:45 2013 (r250444) @@ -551,6 +551,22 @@ ath_edma_tx_drain(struct ath_softc *sc, */ if (reset_type == ATH_RESET_NOLOSS) { ath_edma_tx_processq(sc, 0); + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { + if (ATH_TXQ_SETUP(sc, i)) { + ATH_TXQ_LOCK(&sc->sc_txq[i]); + /* + * Free the holding buffer; DMA is now + * stopped. + */ + ath_txq_freeholdingbuf(sc, &sc->sc_txq[i]); + /* + * Reset the link pointer to NULL; there's + * no frames to chain DMA to. + */ + sc->sc_txq[i].axq_link = NULL; + ATH_TXQ_UNLOCK(&sc->sc_txq[i]); + } + } } else { for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { if (ATH_TXQ_SETUP(sc, i)) _______________________________________________ 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"