build/patch/kernel/sunxi-dev/wifi-brcmfmac-fix-txctl-credits.patch
5kft 730e649bf6
[ sunxi-dev ] reinstate the v5.9-rc1 brcmfmac changes; add fix for the performance regression
introduced with the Cypress "0048-brcmfmac-reserve-2-credits-for-host-tx-control-path" patch

(Reference: https://www.spinics.net/lists/linux-wireless/msg201592.html)
2020-09-01 18:35:26 -07:00

22 lines
924 B
Diff

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index e8712ad3a..50c81078a 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -664,9 +664,14 @@ static void pkt_align(struct sk_buff *p, int len, int align)
/* To check if there's window offered */
static bool data_ok(struct brcmf_sdio *bus)
{
- /* Reserve TXCTL_CREDITS credits for txctl */
- return (bus->tx_max - bus->tx_seq) > TXCTL_CREDITS &&
- ((bus->tx_max - bus->tx_seq) & 0x80) == 0;
+ u8 tx_rsv = 0;
+
+ /* Reserve TXCTL_CREDITS credits for txctl when it is ready to send */
+ if (bus->ctrl_frame_stat)
+ tx_rsv = TXCTL_CREDITS;
+
+ return (bus->tx_max - bus->tx_seq - tx_rsv) != 0 &&
+ ((bus->tx_max - bus->tx_seq - tx_rsv) & 0x80) == 0;
}
/* To check if there's window offered */