wifi: rtw89: pci: fix PCI doesn't reclaim TX BD properly
authorPing-Ke Shih <pkshih@realtek.com>
Fri, 10 Jun 2022 07:26:09 +0000 (15:26 +0800)
committerKalle Valo <kvalo@kernel.org>
Tue, 21 Jun 2022 06:15:48 +0000 (09:15 +0300)
commit37c6abc374d1f1e0dd2e9fcc5a789886a63c894a
treec36671e4d7e1af0611d2e3c6ff78c78ac8f262a4
parentc4756d5de72e549fdaa32a1fab12ae776fca5be7
wifi: rtw89: pci: fix PCI doesn't reclaim TX BD properly

TX BD (TX ring index) and TX WD (WiFi descriptor buffer) are freed
asynchronously. With burst packets, we free TX WD, but the corresponding
TX BD couldn't be freed yet. Then, TX can possibly get stuck due to no
more TX BD.

To avoid this, ignore reclaiming TX BD only if TX WD is no free space,
because at this moment TX BD must have some spaces. Otherwise, we reclaim
TX BD to resolve TX stuck issue.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220610072610.27095-11-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/pci.c