developer | 30d39c2 | 2022-12-16 10:29:49 +0800 | [diff] [blame] | 1 | From 1e4726b5d439d80c76bc0c2c4a87b241c2a40713 Mon Sep 17 00:00:00 2001 |
developer | 51f6fcf | 2022-12-14 17:08:01 +0800 | [diff] [blame] | 2 | From: Howard Hsu <howard-yh.hsu@mediatek.com> |
| 3 | Date: Fri, 2 Dec 2022 10:16:49 +0800 |
developer | 30d39c2 | 2022-12-16 10:29:49 +0800 | [diff] [blame] | 4 | Subject: [PATCH 1/6] wifi: mt76: mt7915: call |
developer | 51f6fcf | 2022-12-14 17:08:01 +0800 | [diff] [blame] | 5 | mt7915_mcu_set_thermal_throttling() only after init_work |
| 6 | |
| 7 | Enable thermal management by default shall not be executed during mcu |
| 8 | init. This causes thermal configuration being reset to the firmware |
| 9 | default settings. |
| 10 | |
| 11 | Fixes: 0063b86c9120 ("mt76: mt7915e: Enable thermal management by default") |
| 12 | Reviewed-by: Ryder Lee <ryder.lee@mediatek.com> |
| 13 | Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com> |
| 14 | --- |
| 15 | mt7915/init.c | 3 +-- |
| 16 | mt7915/main.c | 6 ++++++ |
| 17 | 2 files changed, 7 insertions(+), 2 deletions(-) |
| 18 | |
| 19 | diff --git a/mt7915/init.c b/mt7915/init.c |
| 20 | index 6fd5c63e..a03d0b3b 100644 |
| 21 | --- a/mt7915/init.c |
| 22 | +++ b/mt7915/init.c |
| 23 | @@ -201,8 +201,7 @@ static int mt7915_thermal_init(struct mt7915_phy *phy) |
| 24 | phy->throttle_temp[0] = 110; |
| 25 | phy->throttle_temp[1] = 120; |
| 26 | |
| 27 | - return mt7915_mcu_set_thermal_throttling(phy, |
| 28 | - MT7915_THERMAL_THROTTLE_MAX); |
| 29 | + return 0; |
| 30 | } |
| 31 | |
| 32 | static void mt7915_led_set_config(struct led_classdev *led_cdev, |
| 33 | diff --git a/mt7915/main.c b/mt7915/main.c |
| 34 | index 0511d6a5..98af032e 100644 |
| 35 | --- a/mt7915/main.c |
| 36 | +++ b/mt7915/main.c |
| 37 | @@ -57,6 +57,12 @@ int mt7915_run(struct ieee80211_hw *hw) |
| 38 | mt7915_mac_enable_nf(dev, phy->mt76->band_idx); |
| 39 | } |
| 40 | |
| 41 | + ret = mt7915_mcu_set_thermal_throttling(phy, |
| 42 | + MT7915_THERMAL_THROTTLE_MAX); |
| 43 | + |
| 44 | + if (ret) |
| 45 | + goto out; |
| 46 | + |
| 47 | ret = mt76_connac_mcu_set_rts_thresh(&dev->mt76, 0x92b, |
| 48 | phy->mt76->band_idx); |
| 49 | if (ret) |
| 50 | -- |
developer | 30d39c2 | 2022-12-16 10:29:49 +0800 | [diff] [blame] | 51 | 2.25.1 |
developer | 51f6fcf | 2022-12-14 17:08:01 +0800 | [diff] [blame] | 52 | |