Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Mar 2015 20:43:22 +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: r280075 - head/sys/dev/wpi
Message-ID:  <201503152043.t2FKhM2I068948@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Sun Mar 15 20:43:22 2015
New Revision: 280075
URL: https://svnweb.freebsd.org/changeset/base/280075

Log:
  Use ring->queued for WPI_CMD_TX_DATA only.
  
  PR:		kern/197143
  Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>

Modified:
  head/sys/dev/wpi/if_wpi.c

Modified: head/sys/dev/wpi/if_wpi.c
==============================================================================
--- head/sys/dev/wpi/if_wpi.c	Sun Mar 15 20:42:41 2015	(r280074)
+++ head/sys/dev/wpi/if_wpi.c	Sun Mar 15 20:43:22 2015	(r280075)
@@ -1965,6 +1965,8 @@ wpi_cmd_done(struct wpi_softc *sc, struc
 	if ((desc->qid & WPI_RX_DESC_QID_MSK) != WPI_CMD_QUEUE_NUM)
 		return;	/* Not a command ack. */
 
+	KASSERT(ring->queued == 0, ("ring->queued must be 0"));
+
 	data = &ring->data[desc->idx];
 
 	/* If the command was mapped in an mbuf, free it. */
@@ -2404,12 +2406,13 @@ wpi_cmd2(struct wpi_softc *sc, struct wp
 	ring->cur = (ring->cur + 1) % WPI_TX_RING_COUNT;
 	wpi_update_tx_ring(sc, ring);
 
-	/* Mark TX ring as full if we reach a certain threshold. */
-	if (++ring->queued > WPI_TX_RING_HIMARK)
-		sc->qfullmsk |= 1 << ring->qid;
+	if (ring->qid < WPI_CMD_QUEUE_NUM) {
+		/* Mark TX ring as full if we reach a certain threshold. */
+		if (++ring->queued > WPI_TX_RING_HIMARK)
+			sc->qfullmsk |= 1 << ring->qid;
 
-	if (ring->qid < WPI_CMD_QUEUE_NUM)
 		sc->sc_tx_timer = 5;
+	}
 
 	DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__);
 



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