From owner-svn-src-all@FreeBSD.ORG Sat Feb 16 19:11:58 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 CE2EABFC; Sat, 16 Feb 2013 19:11:58 +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 8F69B93B; Sat, 16 Feb 2013 19:11:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1GJBwM5003581; Sat, 16 Feb 2013 19:11:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1GJBwm9003580; Sat, 16 Feb 2013 19:11:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302161911.r1GJBwm9003580@svn.freebsd.org> From: Adrian Chadd Date: Sat, 16 Feb 2013 19:11:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246879 - 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: Sat, 16 Feb 2013 19:11:58 -0000 Author: adrian Date: Sat Feb 16 19:11:57 2013 New Revision: 246879 URL: http://svnweb.freebsd.org/changeset/base/246879 Log: * Reduce the PCU lock overhead a little by only re-acquiring it if we actually do have to reinitialise the RX side of things after an RX descriptor EOL error. * Revert a change of mine from quite a while ago - don't shortcut the RX initialisation path. There's a RX FIFO bug in the earlier chips (I'm not sure when it was fixed in this series, but it's fixed with the AR9380 and later) which causes the same RX descriptor to be written to over and over. This causes the descriptor to be marked as "done", and this ends up causing the whole RX path to go very strange. This should fixed the "kickpcu; handled X packets" message spam where "X" is consistently small. Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Sat Feb 16 17:47:47 2013 (r246878) +++ head/sys/dev/ath/if_ath_rx.c Sat Feb 16 19:11:57 2013 (r246879) @@ -954,17 +954,32 @@ rx_proc_next: * need to be handled, kick the PCU if there's * been an RXEOL condition. */ - ATH_PCU_LOCK(sc); - if (resched && sc->sc_kickpcu) { + if (resched && kickpcu) { + ATH_PCU_LOCK(sc); ATH_KTR(sc, ATH_KTR_ERROR, 0, "ath_rx_proc: kickpcu"); device_printf(sc->sc_dev, "%s: kickpcu; handled %d packets\n", __func__, npkts); - /* XXX rxslink? */ -#if 0 + /* + * Go through the process of fully tearing down + * the RX buffers and reinitialising them. + * + * There's a hardware bug that causes the RX FIFO + * to get confused under certain conditions and + * constantly write over the same frame, leading + * the RX driver code here to get heavily confused. + */ +#if 1 ath_startrecv(sc); #else /* + * Disabled for now - it'd be nice to be able to do + * this in order to limit the amount of CPU time spent + * reinitialising the RX side (and thus minimise RX + * drops) however there's a hardware issue that + * causes things to get too far out of whack. + */ + /* * XXX can we hold the PCU lock here? * Are there any net80211 buffer calls involved? */ @@ -977,8 +992,8 @@ rx_proc_next: ath_hal_intrset(ah, sc->sc_imask); sc->sc_kickpcu = 0; + ATH_PCU_UNLOCK(sc); } - ATH_PCU_UNLOCK(sc); /* XXX check this inside of IF_LOCK? */ if (resched && (ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) {