Skip to content

Commit 2916275

Browse files
mkshevetskiyrobimarko
authored andcommitted
mediatek: fix pwn fan settings for sinovoip bpi-r3 (v3)
backport upstream commit 095151b (mediatek: fix pwn fan settings for sinovoip bpi-r3 (v3)) Popular cheap PWM fans for this machine, like the ones coming in heatsink+fan combos will not work properly at the currently defined medium speed. Trying different pwm setting using a command echo $value > /sys/devices/platform/pwm-fan/hwmon/hwmon1/pwm1 I found: pwm1 value fan rotation speed cpu temperature notes ----------------------------------------------------------------- 0 maximal 31.5 Celsius too noisy 40 optimal 35.2 Celsius no noise hearable 95 minimal above 95 does not rotate 55.5 Celsius ----------------------------------------------------------------- Current cooling levels are: cooling-levels = <255 96 0>; Thus only cpu-active-high and cpu-active-low modes are usable. This patch fixes cpu-active-medium settings for bpi-r3 board. This patch may not be enough. Users may wants to tweak their thermal_zone0 trip points, thus tuning fan rotation speed depending on cpu temperature. That can be done on the base of the following example: === example ========= # cpu temperature below 25 Celsius degrees, no rotation echo 25000 > /sys/class/thermal/thermal_zone0/trip_point_4_temp # cpu temperature in [25..32] Celsius degrees, normal rotation speed echo 32000 > /sys/class/thermal/thermal_zone0/trip_point_3_temp # cpu temperature above 50 Celsius degrees, max rotation speed echo 50000 > /sys/class/thermal/thermal_zone0/trip_point_2_temp ===================== Changes v2: * put patch to a proper directory * updated patch description * tested with latest openwrt based on linux-6.6 Changes v3: * use upstream linux patch * update patch description Signed-off-by: Mikhail Kshevetskiy <[email protected]> Link: openwrt/openwrt#21252 Signed-off-by: Robert Marko <[email protected]>
1 parent 4919ffd commit 2916275

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
From 5f271fe1365b63f67fc384ca8d50d473d09de0d1 Mon Sep 17 00:00:00 2001
2+
From: Mikhail Kshevetskiy <[email protected]>
3+
Date: Tue, 3 Dec 2024 07:33:55 +0300
4+
Subject: [PATCH] arm64: dts: mediatek: mt7986-bpi-r3: Change fan PWM value for
5+
mid speed
6+
7+
Popular cheap PWM fans for this machine, like the ones coming in
8+
heatsink+fan combos will not work properly at the currently defined
9+
medium speed. Trying different pwm setting using a command
10+
11+
echo $value > /sys/devices/platform/pwm-fan/hwmon/hwmon1/pwm1
12+
13+
I found:
14+
15+
pwm1 value fan rotation speed cpu temperature notes
16+
-----------------------------------------------------------------
17+
0 maximal 31.5 Celsius too noisy
18+
40 optimal 35.2 Celsius no noise hearable
19+
95 minimal
20+
above 95 does not rotate 55.5 Celsius
21+
-----------------------------------------------------------------
22+
23+
Thus only cpu-active-high and cpu-active-low modes are usable.
24+
I think this is wrong.
25+
26+
This patch fixes cpu-active-medium settings for bpi-r3 board.
27+
28+
I know, the patch is not ideal as it can break pwm fan for some users.
29+
Likely this is the only official mt7986-bpi-r3 heatsink+fan solution
30+
available on the market.
31+
32+
This patch may not be enough. Users may wants to tweak their thermal_zone0
33+
trip points, thus tuning fan rotation speed depending on cpu temperature.
34+
That can be done on the base of the following example:
35+
36+
=== example =========
37+
# cpu temperature below 25 Celsius degrees, no rotation
38+
echo 25000 > /sys/class/thermal/thermal_zone0/trip_point_4_temp
39+
# cpu temperature in [25..32] Celsius degrees, normal rotation speed
40+
echo 32000 > /sys/class/thermal/thermal_zone0/trip_point_3_temp
41+
# cpu temperature above 50 Celsius degrees, max rotation speed
42+
echo 50000 > /sys/class/thermal/thermal_zone0/trip_point_2_temp
43+
=====================
44+
45+
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
46+
Acked-by: Frank Wunderlich <[email protected]>
47+
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
48+
49+
---
50+
Changes from v1 to v2:
51+
* improve patch description
52+
53+
Changes from v2 to v3:
54+
* added question to Frank Wunderlich
55+
56+
Changes from v3 to v4:
57+
* Acked by Frank Wunderlich
58+
---
59+
arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 2 +-
60+
1 file changed, 1 insertion(+), 1 deletion(-)
61+
62+
--- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
63+
+++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
64+
@@ -46,7 +46,7 @@
65+
compatible = "pwm-fan";
66+
#cooling-cells = <2>;
67+
/* cooling level (0, 1, 2) - pwm inverted */
68+
- cooling-levels = <255 96 0>;
69+
+ cooling-levels = <255 40 0>;
70+
pwms = <&pwm 0 10000>;
71+
status = "okay";
72+
};

0 commit comments

Comments
 (0)