Skip to content

Commit

Permalink
mt76: connac: alaways wake the device before scanning
Browse files Browse the repository at this point in the history
[ Upstream commit a618262 ]

move scanning check from mt76_connac_power_save_sched routine
to mt7921_pm_power_save_work/mt7615_pm_power_save_work ones

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
LorenzoBianconi authored and gregkh committed Jul 14, 2021
1 parent 911c989 commit 46dc583
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 4 additions & 0 deletions drivers/net/wireless/mediatek/mt76/mt7615/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1890,6 +1890,10 @@ void mt7615_pm_power_save_work(struct work_struct *work)
pm.ps_work.work);

delta = dev->pm.idle_timeout;
if (test_bit(MT76_HW_SCANNING, &dev->mphy.state) ||
test_bit(MT76_HW_SCHED_SCANNING, &dev->mphy.state))
goto out;

if (time_is_after_jiffies(dev->pm.last_activity + delta)) {
delta = dev->pm.last_activity + delta - jiffies;
goto out;
Expand Down
8 changes: 0 additions & 8 deletions drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ int mt76_connac_pm_wake(struct mt76_phy *phy, struct mt76_connac_pm *pm)
if (!test_bit(MT76_STATE_PM, &phy->state))
return 0;

if (test_bit(MT76_HW_SCANNING, &phy->state) ||
test_bit(MT76_HW_SCHED_SCANNING, &phy->state))
return 0;

if (queue_work(dev->wq, &pm->wake_work))
reinit_completion(&pm->wake_cmpl);

Expand All @@ -45,10 +41,6 @@ void mt76_connac_power_save_sched(struct mt76_phy *phy,

pm->last_activity = jiffies;

if (test_bit(MT76_HW_SCANNING, &phy->state) ||
test_bit(MT76_HW_SCHED_SCANNING, &phy->state))
return;

if (!test_bit(MT76_STATE_PM, &phy->state))
queue_delayed_work(dev->wq, &pm->ps_work, pm->idle_timeout);
}
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/wireless/mediatek/mt76/mt7921/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,10 @@ void mt7921_pm_power_save_work(struct work_struct *work)
pm.ps_work.work);

delta = dev->pm.idle_timeout;
if (test_bit(MT76_HW_SCANNING, &dev->mphy.state) ||
test_bit(MT76_HW_SCHED_SCANNING, &dev->mphy.state))
goto out;

if (time_is_after_jiffies(dev->pm.last_activity + delta)) {
delta = dev->pm.last_activity + delta - jiffies;
goto out;
Expand Down

0 comments on commit 46dc583

Please sign in to comment.