Banana pi R3 fan with PWM

I only sync’ed the DTS for BPi-R4 (MT7988), BPi-R3 (MT7986) should be unchanged.

I’m referring this commit

Maybe not that recently

Can you make a diff between both versions? I took daniels version for upstreaming trip points so there should be no differences.

That’s weird… you can see a diff on the github commit page I added

The diff removes the previous version completely because the dts exists in upstream,so not usable for compare changes. I want a diff between the previous openwrt version and the new upstream one.

Of course i can do the diff myself,but currently i have less time so you can help here.

There you go

1 Like
-			trips {
-				cpu_trip_crit: crit {
-					temperature = <125000>;
-					hysteresis = <2000>;
-					type = "critical";
-				};
-
-				cpu_trip_hot: hot {
-					temperature = <120000>;
-					hysteresis = <2000>;
-					type = "hot";
-				};
 
+			trips {
 				cpu_trip_active_high: active-high {
 					temperature = <115000>;
 					hysteresis = <2000>;
 					type = "active";
 				};
 
-				cpu_trip_active_med: active-med {
+				cpu_trip_active_low: active-low {
 					temperature = <85000>;
 					hysteresis = <2000>;
 					type = "active";
 				};
 
-				cpu_trip_active_low: active-low {
-					temperature = <60000>;
+				cpu_trip_passive: passive {
+					temperature = <40000>;
 					hysteresis = <2000>;
 					type = "passive";
 				};
 			};

so upstream has no crit and hot trip point and the lowest one is 40°C instead of 60°C, i guess last one is your problem? do you always hit the first trip? of course we can increase this if needed

Personally I don’t use that mechanism, some guy asked me why his fan doesn’t spin so I’ve noticed this difference. The lowest active point is 60 in the previous definition, compared to 85 on the newer one, am I wrong?

the lowest is 40°C (60 in old definition) like i wrote already

But it’s a passive one, without fan. I’m talking about the active points

Sorry, I needed to take a closer look. Yes, I switched to (mostly) use the upstream device tree, and yes, it has less and different thermal trip points.

And now that I look at it, it doesn’t make sense.

passive in the context of cooling usually doesn’t mean the fan would be switched off, but rather throttling the CPU clock or otherwise reducing the system performance in order to reduce the temperature. Usually this should be the last and not the first thing to do.

I know, I should have pointed during the review phase before it got merged…

Thank you for clarifying!

I hope a fix will be merged into the upcoming 23.05 as well

Afair i got pointed to remove the upper 2 trips as they are not used in board dts. The name of lowest trip was also suggested as it is not active. Not sure why i used 40°C here. But order of active+passive is same. I thought r3 does not support cpu trotteling due to missing pmic? All trips are set to fan in board dts,so imho only the lower trip needs to be raised

Hello,

My PWM fan just stopped working on my banana pi r3 for unknown reason. Can you help me to troubleshoot the problem? Current status:

/sys/class/thermal/cooling_device0/cur_state is 1

/sys/devices/platform/pwm-fan/hwmon/hwmon1/pwm1 is 96

I’m on snapshot from the last week. But fan stopped before the upgrade. Thank you in advance.

hi it seems that the fan start to work at 85 due to misconfiguration in beta and nightly build - it will be fixed in next builds. i use a workaround by changing /sys/class/thermal/thermal_zone0/trip_point_1_temp to 32000 i added to startup the line below and its keeping the value after restart

echo 32000 > /sys/class/thermal/thermal_zone0/trip_point_1_temp good luck

Could you try to change the trip points like i did in 2 top commits here?

https://github.com/frank-w/BPI-Router-Linux/commits/6.5-rc/arch/arm64/boot/dts/mediatek

Have not yet tested it…

Hi,

Still not working after trip_point_1_temp set to 32000.

Is this normal:

root@gate:~# lsmod |grep pwm

pwm_fan 16384 0

Zero (at the end) means pwm module is used by ZERO devices. Could it be a hardware problem?

Also I have this in dmesg:

[    0.049374] pwm-mediatek 10048000.pwm: clock: top fail: -517

Could you try this

-		clocks = <&topckgen CLK_TOP_PWM_SEL>,
+		clocks = <&infracfg CLK_INFRA_PWM_HCK>,

In the pwm node (dtsi)?

Hi, Where to set this?

/proc/device-tree/pwm-fan here or should I build an image?

In mt7986a.dtsi the pwm node (code like one of the commits above)