diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2021-06-02 23:25:28 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-06-19 09:22:48 +0200 |
commit | 6ab079e2aba283e3e356cc60dd3d0648adc15b1d (patch) | |
tree | 27614a59d7a8b3f99a5fa93704629d50e4aab787 /drivers/net/wireless/mediatek/mt76/mt76_connac.h | |
parent | 82453b1cbf9ef166364c12b5464251f16bac5f51 (diff) |
mt76: connac: add mt76_connac_power_save_sched in mt76_connac_pm_unref
Schedule power_save work running mt76_connac_pm_unref in order to reduce
power consumption
Tested-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76_connac.h')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76_connac.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac.h b/drivers/net/wireless/mediatek/mt76/mt76_connac.h index 63c1d1a68a70..0dfa09902ffd 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac.h +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac.h @@ -117,11 +117,15 @@ out: } static inline void -mt76_connac_pm_unref(struct mt76_connac_pm *pm) +mt76_connac_pm_unref(struct mt76_phy *phy, struct mt76_connac_pm *pm) { spin_lock_bh(&pm->wake.lock); - pm->wake.count--; + pm->last_activity = jiffies; + if (--pm->wake.count == 0 && + test_bit(MT76_STATE_MCU_RUNNING, &phy->state)) + mt76_connac_power_save_sched(phy, pm); + spin_unlock_bh(&pm->wake.lock); } |