wcn36xx: don't process 'valid' descriptors
authorBob Copeland <me@bobcopeland.com>
Fri, 9 Jan 2015 19:15:48 +0000 (14:15 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 23 Jan 2015 17:12:01 +0000 (19:12 +0200)
The DMA engine will reset the valid bit after a descriptor is
complete; any with the valid bit still set may still be in
use by the hardware, so check that before freeing the descriptor.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/wcn36xx/dxe.c

index 73f12f196f14ec6ee14368dee20673f67b8045a3..3d6bc9b8717677d359767f2a5e258e2c7c8ec4f2 100644 (file)
@@ -354,6 +354,8 @@ static void reap_tx_dxes(struct wcn36xx *wcn, struct wcn36xx_dxe_ch *ch)
         * and while-do will not make any cycles.
         */
        do {
+               if (ctl->desc->ctrl & WCN36XX_DXE_CTRL_VALID_MASK)
+                       break;
                if (ctl->skb) {
                        dma_unmap_single(NULL, ctl->desc->src_addr_l,
                                         ctl->skb->len, DMA_TO_DEVICE);