Banana pi R3 fan with PWM

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)

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)

https://git.openwrt.org/?p=openwrt/openwrt.git;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