Banana pi R3 fan with PWM

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


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?

Have not yet tested it…


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)

hi maybe we r not using the same fan. im using the official fan Banana Pi BPI-R3 Fan Heat Sink for BPI-R3 im also using open wrt 23.05.0-rc2 (r23228-cd17d8df2a)

hi i use this as temporary fix since i don’t quite understand the mechanism in the file or how to change it permanently. as i can see for some reason it didn’t work for groms . maybe the snapshot configured differently. i download .SNAPSHOT (r23728-813ef01a27) 2023-08-14T081843.000000Z and it activates the fan.

Do you use kernel 6.1? This seems to use my configuration. (I guess problems are in 5.15 because of any difference in clock driver)

See my pwm and thermal patches (12,13,16-18);a=tree;f=target/linux/mediatek/patches-6.1;h=5ecebfe1356fa68197243b007fcf60152a065166;hb=813ef01a27

OpenWrt 23.05.0-rc2 r23228-cd17d8df2a Kernel Version 5.15.118 that’s an impressive work u do in there

master patcher is a better username for u

Most of the work is based on patches from other people like @dangowrt

But strange that other people have issues with pwm here.

I only changed some things as the original pwm patches not worked for me. I guessed because openwrt was based on 5.15 and i work on mainline…

I will update later today and will report the result here.

Upgraded yesterday with SNAPHOST from 15.08. PWM still doesn’t work. I mean the fan is stopped.

I only did this:

echo 1 > /sys/class/thermal/cooling_device0/cur_state

kmod-hwmon-pwmfan is installed

pwm module is not used by any device:

root@gate:~# lsmod |grep pwm

pwm_fan 16384 0

Also I have this in dmesg:

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

If I remove the PWM pin from the fan connector the fan starts working at max RPM. And when PWM pin is connected the fan stops.

1 Like

Have you tried the patch i suggested (using different top clock)? Which kernel (5.15 vs. 6.1).

I thought this patch was included in the last snapshot. Should I build an image with the patch? Otherwise the kernel is 5.15.126.

No, we have to know first if it solves your issue…have you tried kernel 6.1?

How to try kernel 6.1? master is 5.15.

Same problem here with the RC3 And i don’t know how to build a firmware, so even less how to apply a patch :rofl: