]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
wifi: mt76: mt7915: call mt7915_mcu_set_thermal_throttling() only after init_work
authorHoward Hsu <howard-yh.hsu@mediatek.com>
Wed, 14 Dec 2022 02:28:06 +0000 (10:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:32:58 +0000 (09:32 +0100)
[ Upstream commit 7d12b38ab6f6b77198cd3a66db19587bbdd3308c ]

Enable thermal management by default shall not be executed during mcu
init. This causes thermal configuration being reset to the firmware
default settings.

Fixes: 0063b86c9120 ("mt76: mt7915e: Enable thermal management by default")
Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/mediatek/mt76/mt7915/init.c
drivers/net/wireless/mediatek/mt76/mt7915/main.c

index cc2aac86bcfb6ad69f38b6f5b8bdee55e57464bf..38e94187d5eda861150dd5974f06d90b97bb71b9 100644 (file)
@@ -200,8 +200,7 @@ static int mt7915_thermal_init(struct mt7915_phy *phy)
        phy->throttle_temp[0] = 110;
        phy->throttle_temp[1] = 120;
 
-       return mt7915_mcu_set_thermal_throttling(phy,
-                                                MT7915_THERMAL_THROTTLE_MAX);
+       return 0;
 }
 
 static void mt7915_led_set_config(struct led_classdev *led_cdev,
index 89b519cfd14c3bb272c8f977ba00542a0975c2f3..060cb88e82e30416feee212ddd5ebb567824002d 100644 (file)
@@ -57,6 +57,12 @@ static int mt7915_start(struct ieee80211_hw *hw)
                mt7915_mac_enable_nf(dev, 1);
        }
 
+       ret = mt7915_mcu_set_thermal_throttling(phy,
+                                               MT7915_THERMAL_THROTTLE_MAX);
+
+       if (ret)
+               goto out;
+
        ret = mt76_connac_mcu_set_rts_thresh(&dev->mt76, 0x92b,
                                             phy != &dev->phy);
        if (ret)