From owner-svn-src-all@FreeBSD.ORG Wed May 8 07:30:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C0E43478; Wed, 8 May 2013 07:30:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 99F96AE1; Wed, 8 May 2013 07:30:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r487UYNH093674; Wed, 8 May 2013 07:30:34 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r487UXMc093672; Wed, 8 May 2013 07:30:33 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305080730.r487UXMc093672@svn.freebsd.org> From: Adrian Chadd Date: Wed, 8 May 2013 07:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250355 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 07:30:34 -0000 Author: adrian Date: Wed May 8 07:30:33 2013 New Revision: 250355 URL: http://svnweb.freebsd.org/changeset/base/250355 Log: Revert a previous commit - this is causing hardware errors. I'm not sure why this is failing. The holding descriptor should be being re-read when starting DMA of the next frame. Obviously something here isn't totally correct. I'll review the TX queue handling and see if I can figure out why this is failing. I'll then re-revert this patch out and use the holding descriptor again. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed May 8 07:14:07 2013 (r250354) +++ head/sys/dev/ath/if_ath.c Wed May 8 07:30:33 2013 (r250355) @@ -4000,20 +4000,19 @@ ath_tx_processq(struct ath_softc *sc, st break; } ATH_TXQ_REMOVE(txq, bf, bf_list); - - /* - * Always mark the last buffer in this list as busy. - * - * The hardware may re-read the holding descriptor - * even if we hit the end of the list and try writing - * a new TxDP. - * - * If there's no holding descriptor then this is the - * last buffer in the list of buffers after a fresh - * reset; it'll soon become the holding buffer. - */ - bf->bf_last->bf_flags |= ATH_BUF_BUSY; - + if (txq->axq_depth > 0) { + /* + * More frames follow. Mark the buffer busy + * so it's not re-used while the hardware may + * still re-read the link field in the descriptor. + * + * Use the last buffer in an aggregate as that + * is where the hardware may be - intermediate + * descriptors won't be "busy". + */ + bf->bf_last->bf_flags |= ATH_BUF_BUSY; + } else + txq->axq_link = NULL; if (bf->bf_state.bfs_aggr) txq->axq_aggr_depth--; Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Wed May 8 07:14:07 2013 (r250354) +++ head/sys/dev/ath/if_ath_misc.h Wed May 8 07:30:33 2013 (r250355) @@ -131,10 +131,16 @@ extern void ath_start_task(void *arg, in static inline void ath_tx_kick(struct ath_softc *sc) { + struct ieee80211com *ic = sc->sc_ifp->if_l2com; + IEEE80211_TX_UNLOCK_ASSERT(ic); + ATH_TX_UNLOCK_ASSERT(sc); + + IEEE80211_TX_LOCK(ic); ATH_TX_LOCK(sc); ath_start(sc->sc_ifp); ATH_TX_UNLOCK(sc); + IEEE80211_TX_UNLOCK(ic); } /*