From owner-svn-src-all@FreeBSD.ORG Sun Mar 15 21:24:12 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50787E56; Sun, 15 Mar 2015 21:24:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C46D9A1; Sun, 15 Mar 2015 21:24:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2FLOCet090328; Sun, 15 Mar 2015 21:24:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2FLOCNi090327; Sun, 15 Mar 2015 21:24:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503152124.t2FLOCNi090327@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 15 Mar 2015 21:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280111 - head/sys/dev/wpi 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.18-1 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: Sun, 15 Mar 2015 21:24:12 -0000 Author: adrian Date: Sun Mar 15 21:24:11 2015 New Revision: 280111 URL: https://svnweb.freebsd.org/changeset/base/280111 Log: Regroup ring state checks in wpi_tx_done(). PR: kern/197143 Submitted by: Andriy Voskoboinyk 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 21:23:45 2015 (r280110) +++ head/sys/dev/wpi/if_wpi.c Sun Mar 15 21:24:11 2015 (r280111) @@ -1971,22 +1971,23 @@ wpi_tx_done(struct wpi_softc *sc, struct WPI_LOCK(sc); ring->queued -= 1; - if (ring->queued > 0) + if (ring->queued > 0) { callout_reset(&sc->tx_timeout, 5*hz, wpi_tx_timeout, sc); - else - callout_stop(&sc->tx_timeout); - if (ring->queued < WPI_TX_RING_LOMARK) { - sc->qfullmsk &= ~(1 << ring->qid); - IF_LOCK(&ifp->if_snd); - if (sc->qfullmsk == 0 && - (ifp->if_drv_flags & IFF_DRV_OACTIVE)) { - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - IF_UNLOCK(&ifp->if_snd); - ieee80211_runtask(ic, &sc->sc_start_task); - } else - IF_UNLOCK(&ifp->if_snd); - } + if (sc->qfullmsk != 0 && + ring->queued < WPI_TX_RING_LOMARK) { + sc->qfullmsk &= ~(1 << ring->qid); + IF_LOCK(&ifp->if_snd); + if (sc->qfullmsk == 0 && + (ifp->if_drv_flags & IFF_DRV_OACTIVE)) { + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); + ieee80211_runtask(ic, &sc->sc_start_task); + } else + IF_UNLOCK(&ifp->if_snd); + } + } else + callout_stop(&sc->tx_timeout); DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); }