* [PATCH] wifi: mt76: mt7915: rework init flow in mt7915_thermal_init()
@ 2023-02-21 2:43 Howard Hsu
2023-02-21 6:30 ` Kalle Valo
0 siblings, 1 reply; 3+ messages in thread
From: Howard Hsu @ 2023-02-21 2:43 UTC (permalink / raw)
To: Felix Fietkau
Cc: Lorenzo Bianconi, Ryder Lee, Shayne Chen, Evelyn Tsai,
linux-wireless, linux-mediatek, Howard Hsu
If kernel do not enable CONFIG_HWMON, it may cause thermal
initialization to be done with temperature value 0 and then can not
transmit. This commit fixes it by setting trigger/restore temperature
before checking CONFIG_HWMON.
Fixes: 7d12b38 ("wifi: mt76: mt7915: call mt7915_mcu_set_thermal_throttling() only after init_work")
Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
---
drivers/net/wireless/mediatek/mt76/mt7915/init.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
index 1ab768feccaa..c48dcb928649 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
@@ -202,6 +202,10 @@ static int mt7915_thermal_init(struct mt7915_phy *phy)
phy->cdev = cdev;
}
+ /* initialize critical/maximum high temperature */
+ phy->throttle_temp[MT7915_CRIT_TEMP_IDX] = MT7915_CRIT_TEMP;
+ phy->throttle_temp[MT7915_MAX_TEMP_IDX] = MT7915_MAX_TEMP;
+
if (!IS_REACHABLE(CONFIG_HWMON))
return 0;
@@ -210,10 +214,6 @@ static int mt7915_thermal_init(struct mt7915_phy *phy)
if (IS_ERR(hwmon))
return PTR_ERR(hwmon);
- /* initialize critical/maximum high temperature */
- phy->throttle_temp[MT7915_CRIT_TEMP_IDX] = MT7915_CRIT_TEMP;
- phy->throttle_temp[MT7915_MAX_TEMP_IDX] = MT7915_MAX_TEMP;
-
return 0;
}
--
2.18.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] wifi: mt76: mt7915: rework init flow in mt7915_thermal_init()
2023-02-21 2:43 [PATCH] wifi: mt76: mt7915: rework init flow in mt7915_thermal_init() Howard Hsu
@ 2023-02-21 6:30 ` Kalle Valo
2023-02-23 6:15 ` Howard-YH Hsu (許育豪)
0 siblings, 1 reply; 3+ messages in thread
From: Kalle Valo @ 2023-02-21 6:30 UTC (permalink / raw)
To: Howard Hsu
Cc: Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
Evelyn Tsai, linux-wireless, linux-mediatek
Howard Hsu <howard-yh.hsu@mediatek.com> writes:
> If kernel do not enable CONFIG_HWMON, it may cause thermal
> initialization to be done with temperature value 0 and then can not
> transmit. This commit fixes it by setting trigger/restore temperature
> before checking CONFIG_HWMON.
>
> Fixes: 7d12b38 ("wifi: mt76: mt7915: call mt7915_mcu_set_thermal_throttling() only after init_work")
> Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
Should this go to v6.3?
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] wifi: mt76: mt7915: rework init flow in mt7915_thermal_init()
2023-02-21 6:30 ` Kalle Valo
@ 2023-02-23 6:15 ` Howard-YH Hsu (許育豪)
0 siblings, 0 replies; 3+ messages in thread
From: Howard-YH Hsu (許育豪) @ 2023-02-23 6:15 UTC (permalink / raw)
To: kvalo@kernel.org
Cc: lorenzo.bianconi@redhat.com,
Shayne Chen (陳軒丞), nbd@nbd.name,
Evelyn Tsai (蔡珊鈺), Ryder Lee,
linux-mediatek@lists.infradead.org,
linux-wireless@vger.kernel.org
On Tue, 2023-02-21 at 08:30 +0200, Kalle Valo wrote:
> Howard Hsu <howard-yh.hsu@mediatek.com> writes:
>
> > If kernel do not enable CONFIG_HWMON, it may cause thermal
> > initialization to be done with temperature value 0 and then can not
> > transmit. This commit fixes it by setting trigger/restore
> > temperature
> > before checking CONFIG_HWMON.
> >
> > Fixes: 7d12b38 ("wifi: mt76: mt7915: call
> > mt7915_mcu_set_thermal_throttling() only after init_work")
> > Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
>
> Should this go to v6.3?
>
I will send the v2 patch to fix this patch. Please help to put v2 patch
into the queue of v6.3.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-02-23 6:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-21 2:43 [PATCH] wifi: mt76: mt7915: rework init flow in mt7915_thermal_init() Howard Hsu
2023-02-21 6:30 ` Kalle Valo
2023-02-23 6:15 ` Howard-YH Hsu (許育豪)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).