From: adrian Date: Sun, 11 Oct 2015 01:56:46 +0000 (+0000) Subject: wpi(4): fix possible race between TX/RX threads. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=dc894aa451b0893efb5295226fa6ffe55eaf3ed9;p=people%2Fjulieng%2Ffreebsd.git wpi(4): fix possible race between TX/RX threads. Tested: * Tested with Intel 3945BG, STA mode Submitted by: Differential Revision: https://reviews.freebsd.org/D3766 --- diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c index 44077f06a576..716b62d36ddf 100644 --- a/sys/dev/wpi/if_wpi.c +++ b/sys/dev/wpi/if_wpi.c @@ -1093,6 +1093,7 @@ wpi_update_rx_ring_ps(struct wpi_softc *sc) return; } + WPI_TXQ_LOCK(sc); WPI_SETBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); if (WPI_READ(sc, WPI_GP_CNTRL) & WPI_GP_CNTRL_SLEEP) { DPRINTF(sc, WPI_DEBUG_PWRSAVE, "%s: wakeup request\n", @@ -1102,6 +1103,7 @@ wpi_update_rx_ring_ps(struct wpi_softc *sc) wpi_update_rx_ring(sc); WPI_CLRBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); } + WPI_TXQ_UNLOCK(sc); } static void