mt76: connac: unschedule ps_work in mt76_connac_pm_wake
authorLorenzo Bianconi <lorenzo@kernel.org>
Sun, 18 Apr 2021 16:45:35 +0000 (18:45 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 21 Apr 2021 18:55:52 +0000 (20:55 +0200)
In order to avoid synchronization issues between wake and ps works,
cancel ps_work in mt76_connac_pm_wake routine

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c

index 7081bb4..5890fee 100644 (file)
@@ -345,7 +345,6 @@ static int mt7615_mcu_lp_drv_pmctrl(struct mt7615_dev *dev)
        clear_bit(MT76_STATE_PM, &mphy->state);
 
 out:
-       dev->pm.last_activity = jiffies;
        mutex_unlock(&dev->pm.mutex);
 
        return err;
index c5f5037..32d664a 100644 (file)
@@ -13,6 +13,7 @@ int mt76_connac_pm_wake(struct mt76_phy *phy, struct mt76_connac_pm *pm)
        if (!mt76_is_mmio(dev))
                return 0;
 
+       cancel_delayed_work_sync(&pm->ps_work);
        if (!test_bit(MT76_STATE_PM, &phy->state))
                return 0;
 
index ea00f6b..44f02cb 100644 (file)
@@ -1289,7 +1289,6 @@ int mt7921_mcu_drv_pmctrl(struct mt7921_dev *dev)
        clear_bit(MT76_STATE_PM, &mphy->state);
 
 out:
-       dev->pm.last_activity = jiffies;
        mutex_unlock(&dev->pm.mutex);
 
        if (err)