1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

mt76: connac: unschedule mac_work before going to sleep

In order to wake the device less frequently and so reduce power
consumpation, unschedule mac_work before going to sleep

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Lorenzo Bianconi 2021-04-21 12:43:50 +02:00 committed by Felix Fietkau
parent abe912ae3c
commit b1bd7bb812
3 changed files with 7 additions and 1 deletions

View file

@ -1912,6 +1912,8 @@ void mt7615_pm_wake_work(struct work_struct *work)
napi_schedule(&dev->mt76.napi[i]); napi_schedule(&dev->mt76.napi[i]);
mt76_connac_pm_dequeue_skbs(mphy, &dev->pm); mt76_connac_pm_dequeue_skbs(mphy, &dev->pm);
mt76_queue_tx_cleanup(dev, dev->mt76.q_mcu[MT_MCUQ_WM], false); mt76_queue_tx_cleanup(dev, dev->mt76.q_mcu[MT_MCUQ_WM], false);
ieee80211_queue_delayed_work(mphy->hw, &mphy->mac_work,
MT7615_WATCHDOG_TIME);
} }
ieee80211_wake_queues(mphy->hw); ieee80211_wake_queues(mphy->hw);

View file

@ -42,9 +42,11 @@ void mt76_connac_power_save_sched(struct mt76_phy *phy,
pm->last_activity = jiffies; pm->last_activity = jiffies;
if (!test_bit(MT76_STATE_PM, &phy->state)) if (!test_bit(MT76_STATE_PM, &phy->state)) {
cancel_delayed_work(&phy->mac_work);
queue_delayed_work(dev->wq, &pm->ps_work, pm->idle_timeout); queue_delayed_work(dev->wq, &pm->ps_work, pm->idle_timeout);
} }
}
EXPORT_SYMBOL_GPL(mt76_connac_power_save_sched); EXPORT_SYMBOL_GPL(mt76_connac_power_save_sched);
void mt76_connac_free_pending_tx_skbs(struct mt76_connac_pm *pm, void mt76_connac_free_pending_tx_skbs(struct mt76_connac_pm *pm,

View file

@ -1404,6 +1404,8 @@ void mt7921_pm_wake_work(struct work_struct *work)
napi_schedule(&dev->mt76.napi[i]); napi_schedule(&dev->mt76.napi[i]);
mt76_connac_pm_dequeue_skbs(mphy, &dev->pm); mt76_connac_pm_dequeue_skbs(mphy, &dev->pm);
mt7921_tx_cleanup(dev); mt7921_tx_cleanup(dev);
ieee80211_queue_delayed_work(mphy->hw, &mphy->mac_work,
MT7921_WATCHDOG_TIME);
} }
ieee80211_wake_queues(mphy->hw); ieee80211_wake_queues(mphy->hw);