aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Bianconi2020-07-30 11:34:43 +0200
committerFelix Fietkau2020-09-24 18:10:12 +0200
commit0825af2d3307f2e2930f1070c0128e2485732b80 (patch)
tree301e55100df7f006dc0c81ca12b075dfe3205af6
parent763d750c38484cb1fbe389a5cf45b391b9eaa056 (diff)
mt76: mt7615: reschedule runtime-pm receiving a tx interrupt
Reschedule runtime-pm after receiving a tx interrupt. Update runtime-pm last activity before injecting packets Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7615/dma.c1
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7615/mac.c4
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7615/main.c2
3 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/dma.c b/drivers/net/wireless/mediatek/mt76/mt7615/dma.c
index 1231a5ddf9ea..c876eb1e1681 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/dma.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/dma.c
@@ -122,6 +122,7 @@ static int mt7615_poll_tx(struct napi_struct *napi, int budget)
mt7615_tx_cleanup(dev);
+ mt7615_pm_power_save_sched(dev);
tasklet_schedule(&dev->mt76.tx_tasklet);
return 0;
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
index 5d2261d2e79e..e3663c7c374f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
@@ -1439,10 +1439,14 @@ static void mt7615_mac_tx_free(struct mt7615_dev *dev, struct sk_buff *skb)
dev_kfree_skb(skb);
+ if (test_bit(MT76_STATE_PM, &dev->phy.mt76->state))
+ return;
+
rcu_read_lock();
mt7615_mac_sta_poll(dev);
rcu_read_unlock();
+ mt7615_pm_power_save_sched(dev);
tasklet_schedule(&dev->mt76.tx_tasklet);
}
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
index bafe2bdeb5eb..9972853f4a29 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
@@ -706,6 +706,7 @@ mt7615_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
return;
}
+ dev->pm.last_activity = jiffies;
tasklet_schedule(&dev->mt76.tx_tasklet);
}
@@ -735,6 +736,7 @@ static void mt7615_tx(struct ieee80211_hw *hw,
}
if (!test_bit(MT76_STATE_PM, &mphy->state)) {
+ dev->pm.last_activity = jiffies;
mt76_tx(mphy, control->sta, wcid, skb);
return;
}