Skip to content

Commit

Permalink
mt76: mt7615: do not update pm stats in case of error
Browse files Browse the repository at this point in the history
[ Upstream commit 79717c4 ]

Do not update pm stats if mt7615_mcu_fw_pmctrl returns an error.

Fixes: abe912a ("mt76: mt7663: add awake and doze time accounting")
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 Aug 17, 2022
1 parent f1609c4 commit 67cd626
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,11 @@ static int mt7615_mcu_fw_pmctrl(struct mt7615_dev *dev)
}

mt7622_trigger_hif_int(dev, false);

pm->stats.last_doze_event = jiffies;
pm->stats.awake_time += pm->stats.last_doze_event -
pm->stats.last_wake_event;
if (!err) {
pm->stats.last_doze_event = jiffies;
pm->stats.awake_time += pm->stats.last_doze_event -
pm->stats.last_wake_event;
}
out:
mutex_unlock(&pm->mutex);

Expand Down

0 comments on commit 67cd626

Please sign in to comment.