diff options
author | Franky Lin <frankyl@broadcom.com> | 2015-08-20 22:06:06 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-08-25 15:32:29 +0300 |
commit | b02bf1932a4855dc860ed20cdab94f1ea9b1c56f (patch) | |
tree | de8cd6fb44bc9fac7218c754a5f785c5e16e1ab1 /drivers/net/wireless | |
parent | 39504a2d21adde4748b5ce8c057e09edf3fe17bb (diff) | |
download | linux-stable-b02bf1932a4855dc860ed20cdab94f1ea9b1c56f.tar.gz linux-stable-b02bf1932a4855dc860ed20cdab94f1ea9b1c56f.tar.bz2 linux-stable-b02bf1932a4855dc860ed20cdab94f1ea9b1c56f.zip |
brcmfmac: block the correct flowring when backup queue overflow
brcmf_flowring_block blocks the last active flowring under the same
interface instead of the one provided by caller. This could lead to a
dead lock of netif stop if there are more than one flowring under the
interface and the traffic is high enough so brcmf_flowring_enqueue can
not unblock the ring right away.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/flowring.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/flowring.c b/drivers/net/wireless/brcm80211/brcmfmac/flowring.c index 59440631fec5..8d1ab4ab5be8 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/flowring.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/flowring.c @@ -194,11 +194,15 @@ static void brcmf_flowring_block(struct brcmf_flowring *flow, u8 flowid, spin_lock_irqsave(&flow->block_lock, flags); ring = flow->rings[flowid]; + if (ring->blocked == blocked) { + spin_unlock_irqrestore(&flow->block_lock, flags); + return; + } ifidx = brcmf_flowring_ifidx_get(flow, flowid); currently_blocked = false; for (i = 0; i < flow->nrofrings; i++) { - if (flow->rings[i]) { + if ((flow->rings[i]) && (i != flowid)) { ring = flow->rings[i]; if ((ring->status == RING_OPEN) && (brcmf_flowring_ifidx_get(flow, i) == ifidx)) { @@ -209,8 +213,8 @@ static void brcmf_flowring_block(struct brcmf_flowring *flow, u8 flowid, } } } - ring->blocked = blocked; - if (currently_blocked == blocked) { + flow->rings[flowid]->blocked = blocked; + if (currently_blocked) { spin_unlock_irqrestore(&flow->block_lock, flags); return; } |