]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
mt76: mt7615: reschedule runtime-pm receiving a tx interrupt
authorLorenzo Bianconi <lorenzo@kernel.org>
Thu, 30 Jul 2020 09:34:43 +0000 (11:34 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 24 Sep 2020 16:10:12 +0000 (18:10 +0200)
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>
drivers/net/wireless/mediatek/mt76/mt7615/dma.c
drivers/net/wireless/mediatek/mt76/mt7615/mac.c
drivers/net/wireless/mediatek/mt76/mt7615/main.c

index 1231a5ddf9ea32888cfe6299b03a59bfe18eb226..c876eb1e1681f8b5de29a677a5d20d9b0b6eed5a 100644 (file)
@@ -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;
index 5d2261d2e79ebef2bd8a17ac252d3f07f96dd9f8..e3663c7c374f18755d4ac4ae22cc0f9005788d11 100644 (file)
@@ -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);
 }
 
index bafe2bdeb5eb47ad4a8d5419accb32d955e2c23b..9972853f4a2904447c1d3a661ae65a60a5516114 100644 (file)
@@ -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;
        }