diff options
author | Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> | 2013-07-11 11:03:41 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-07-22 16:54:38 -0400 |
commit | 6cdadd4dc7621e47739a84548e70713e157fa850 (patch) | |
tree | 87a61bc13d0ccaad77fe2a21d6a25fbfe142de59 /drivers/net/wireless/ath/wil6210 | |
parent | f88f113a54f02df62608ec263e8a3ff7e81cfce2 (diff) |
wil6210: fix subtle race in wil_tx_vring
Finish all SW context modifications prior to notifying hardware
It used to be race condition: if HW finish Tx and issue Tx completion IRQ very fast,
prior to SW context update in wil_tx_vring, Tx completion will mis-handle descriptor, as
SW part will have no skb pointer stored.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210')
-rw-r--r-- | drivers/net/wireless/ath/wil6210/txrx.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c index 44cdd2a3dff3..2a9d56a5fd0c 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.c +++ b/drivers/net/wireless/ath/wil6210/txrx.c | |||
@@ -712,6 +712,12 @@ static int wil_tx_vring(struct wil6210_priv *wil, struct vring *vring, | |||
712 | d->dma.d0 |= BIT(DMA_CFG_DESC_TX_0_CMD_DMA_IT_POS); | 712 | d->dma.d0 |= BIT(DMA_CFG_DESC_TX_0_CMD_DMA_IT_POS); |
713 | *_d = *d; | 713 | *_d = *d; |
714 | 714 | ||
715 | /* hold reference to skb | ||
716 | * to prevent skb release before accounting | ||
717 | * in case of immediate "tx done" | ||
718 | */ | ||
719 | vring->ctx[i].skb = skb_get(skb); | ||
720 | |||
715 | wil_hex_dump_txrx("Tx ", DUMP_PREFIX_NONE, 32, 4, | 721 | wil_hex_dump_txrx("Tx ", DUMP_PREFIX_NONE, 32, 4, |
716 | (const void *)d, sizeof(*d), false); | 722 | (const void *)d, sizeof(*d), false); |
717 | 723 | ||
@@ -720,11 +726,6 @@ static int wil_tx_vring(struct wil6210_priv *wil, struct vring *vring, | |||
720 | wil_dbg_txrx(wil, "Tx swhead %d -> %d\n", swhead, vring->swhead); | 726 | wil_dbg_txrx(wil, "Tx swhead %d -> %d\n", swhead, vring->swhead); |
721 | trace_wil6210_tx(vring_index, swhead, skb->len, nr_frags); | 727 | trace_wil6210_tx(vring_index, swhead, skb->len, nr_frags); |
722 | iowrite32(vring->swhead, wil->csr + HOSTADDR(vring->hwtail)); | 728 | iowrite32(vring->swhead, wil->csr + HOSTADDR(vring->hwtail)); |
723 | /* hold reference to skb | ||
724 | * to prevent skb release before accounting | ||
725 | * in case of immediate "tx done" | ||
726 | */ | ||
727 | vring->ctx[i].skb = skb_get(skb); | ||
728 | 729 | ||
729 | return 0; | 730 | return 0; |
730 | dma_error: | 731 | dma_error: |