Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Feb 2013 19:11:58 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r246879 - head/sys/dev/ath
Message-ID:  <201302161911.r1GJBwm9003580@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302161911.r1GJBwm9003580>