summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76
diff options
context:
space:
mode:
authorSean Wang <sean.wang@mediatek.com>2022-07-22 00:39:36 +0200
committerFelix Fietkau <nbd@nbd.name>2022-09-15 12:53:58 +0200
commita323e5f041dd11af5e3de19ed7ea95a97d588c11 (patch)
treeb36229a34903c6779ca8079943d8055b012a07e9 /drivers/net/wireless/mediatek/mt76
parentwifi: mt76: sdio: fix the deadlock caused by sdio->stat_work (diff)
downloadlinux-a323e5f041dd11af5e3de19ed7ea95a97d588c11.tar.xz
linux-a323e5f041dd11af5e3de19ed7ea95a97d588c11.zip
wifi: mt76: sdio: poll sta stat when device transmits data
It is not meaningful to poll sta stat when there is no data traffic. So polling sta stat when the device has transmitted data instead to save CPU power. That implies that it is unallowed the stat_work to work while MCU is being initialized in the really early stage to fix the possible time to time MCU initialization failure. Fixes: d39b52e31aa6 ("mt76: introduce mt76_sdio module") Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76')
-rw-r--r--drivers/net/wireless/mediatek/mt76/sdio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/sdio.c b/drivers/net/wireless/mediatek/mt76/sdio.c
index fb2caeae6dba..ece4e4bb94a1 100644
--- a/drivers/net/wireless/mediatek/mt76/sdio.c
+++ b/drivers/net/wireless/mediatek/mt76/sdio.c
@@ -478,7 +478,7 @@ static void mt76s_status_worker(struct mt76_worker *w)
if (ndata_frames > 0)
resched = true;
- if (dev->drv->tx_status_data &&
+ if (dev->drv->tx_status_data && ndata_frames > 0 &&
!test_and_set_bit(MT76_READING_STATS, &dev->phy.state) &&
!test_bit(MT76_STATE_SUSPEND, &dev->phy.state))
ieee80211_queue_work(dev->hw, &dev->sdio.stat_work);