rtw88: Fix potential unrecoverable tx queue stop
authorYu-Yen Ting <steventing@realtek.com>
Thu, 15 Apr 2021 08:47:02 +0000 (16:47 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 21 Apr 2021 09:37:42 +0000 (12:37 +0300)
commita548909d7ad7e334c6c923a71f0b694d60980232
tree7f6e254e8995482ae4a1ae60ec32691d0468c3a1
parent559f6cb318375e9deb01d7d0e957d0d90a2db63d
rtw88: Fix potential unrecoverable tx queue stop

If there are lots of packets to be transmitted, the driver would check
whether the available descriptors are sufficient according the read/write
point of tx queue. Once the available descriptor is not enough,
ieee80211_stop_queue is called.

TX ISR, meanwhile, is releasing the tx resources after the packets are
transmitted. This routine may call ieee80211_wake_queue by checking the
available descriptor.

The potential queue stop problem would occur when the tx queue is
stopped due to the heavy traffic. Then thare is no chance to wake the
queue up because the read point is not updated immediately, as a result,
no more packets coulde be transmitted in this queue.

This patch makes sure the ieee80211_wake_queue could be called properly
and avoids the race condition when ring->r.rp, ring->queue_stopped are
updated.

Signed-off-by: Yu-Yen Ting <steventing@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210415084703.27255-3-pkshih@realtek.com
drivers/net/wireless/realtek/rtw88/pci.c