svn commit: r226792 - user/adrian/if_ath_tx/sys/dev/ath

Adrian Chadd adrian at FreeBSD.org
Wed Oct 26 15:01:04 UTC 2011


Author: adrian
Date: Wed Oct 26 15:01:04 2011
New Revision: 226792
URL: http://svn.freebsd.org/changeset/base/226792

Log:
  When returning a cloned/busy buffer, a failed DMA setup should
  stuff the buffer on the front of the list, not the tail. That
  way it won't interfere with busy buffer logic.

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c	Wed Oct 26 14:56:09 2011	(r226791)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c	Wed Oct 26 15:01:04 2011	(r226792)
@@ -2645,8 +2645,15 @@ ath_tx_retry_clone(struct ath_softc *sc,
 		device_printf(sc->sc_dev,
 		    "%s: failed to setup dma for clone\n",
 		    __func__);
-		/* XXX this frees the dmasetup that failed above? */
-		ath_freebuf(sc, nbf);
+		/*
+		 * Put this at the head of the list, not tail;
+		 * that way it doesn't interfere with the
+		 * busy buffer logic (which uses the tail of
+		 * the list.)
+		 */
+		ATH_TXBUF_LOCK(sc);
+		TAILQ_INSERT_HEAD(&sc->sc_txbuf, nbf, bf_list);
+		ATH_TXBUF_UNLOCK(sc);
 		return NULL;
 	}
 


More information about the svn-src-user mailing list