diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2020-07-07 23:23:11 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2020-07-21 19:01:17 +0200 |
commit | e9eb59c60d21ba3433868c89eb2460e70a2101fd (patch) | |
tree | 7b657185f4d40e57b6d673f4b55dc08a10cd2fed /drivers/net/wireless/mediatek | |
parent | 4bb586bc33b9845d76fc8d4efc2910e37876c399 (diff) |
mt76: mt7615: avoid scheduling runtime-pm during hw scan
Do not schedule ps_work during hw scanning or hw scheduled frequency
scan
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c index af5716797475..1c440ed183ee 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c @@ -1908,12 +1908,21 @@ void mt7615_pm_power_save_sched(struct mt7615_dev *dev) { struct mt76_phy *mphy = dev->phy.mt76; - if (!mt7615_firmware_offload(dev) || - !dev->pm.enable || !mt76_is_mmio(mphy->dev) || - !test_bit(MT76_STATE_RUNNING, &mphy->state)) + if (!mt7615_firmware_offload(dev)) + return; + + if (!mt76_is_mmio(mphy->dev)) + return; + + if (!dev->pm.enable || !test_bit(MT76_STATE_RUNNING, &mphy->state)) return; dev->pm.last_activity = jiffies; + + if (test_bit(MT76_HW_SCANNING, &mphy->state) || + test_bit(MT76_HW_SCHED_SCANNING, &mphy->state)) + return; + if (!test_bit(MT76_STATE_PM, &mphy->state)) queue_delayed_work(dev->mt76.wq, &dev->pm.ps_work, dev->pm.idle_timeout); |