mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: mt7615: fix a leftover race in runtime-pm
Fix a possible race in mt7615_pm_power_save_work() if rx/tx napi
schedules ps_work and we are currently accessing device register
on a different cpu.
Fixes: db928f1ab9789 ("mt76: mt7663: rely on mt76_connac_pm_ref/mt76_connac_pm_unref in tx/rx napi")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
7063127f85
commit
f78f4334b0
@@ -2131,6 +2131,14 @@ void mt7615_pm_power_save_work(struct work_struct *work)
|
||||
test_bit(MT76_HW_SCHED_SCANNING, &dev->mphy.state))
|
||||
goto out;
|
||||
|
||||
if (mutex_is_locked(&dev->mt76.mutex))
|
||||
/* if mt76 mutex is held we should not put the device
|
||||
* to sleep since we are currently accessing device
|
||||
* register map. We need to wait for the next power_save
|
||||
* trigger.
|
||||
*/
|
||||
goto out;
|
||||
|
||||
if (time_is_after_jiffies(dev->pm.last_activity + delta)) {
|
||||
delta = dev->pm.last_activity + delta - jiffies;
|
||||
goto out;
|
||||
|
||||
Reference in New Issue
Block a user