Skip to content

Commit

Permalink
wifi: mt76: sdio: poll sta stat when device transmits data
Browse files Browse the repository at this point in the history
[ Upstream commit a323e5f ]

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: d39b52e ("mt76: introduce mt76_sdio module")
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
moore-bros authored and gregkh committed Oct 21, 2022
1 parent 86827c1 commit 8cdaeb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/mediatek/mt76/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8cdaeb4

Please sign in to comment.