mt7996_thermal_temp_store() sends the disable and enable pair of the thermal protection without dev->mt76.mutex. The pair can thus interleave with another hwmon write or with mt7996_run(). The firmware refuses an enable of an active protection entry. A temp1_crit or temp1_max write can thus leave the thresholds of an earlier write in force. Send the pair under the mutex, as mt7915_thermal_temp_store() does. mt7996_run() already sends it under the mutex. Fixes: 6879b2e94172 ("wifi: mt76: mt7996: add thermal sensor device support") Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7996/init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/init.c b/drivers/net/wireless/mediatek/mt76/mt7996/init.c index e82bc9cbc59e..f05231ce81ff 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/init.c @@ -156,9 +156,8 @@ static ssize_t mt7996_thermal_temp_store(struct device *dev, } phy->throttle_temp[i - 1] = val; - mutex_unlock(&phy->dev->mt76.mutex); - ret = mt7996_mcu_set_thermal_protect(phy, true); + mutex_unlock(&phy->dev->mt76.mutex); if (ret) return ret; -- 2.47.3