[BPI-R64]Only 10% cpu speed at already 48 degrees celcius, speed not increasing anymore

I don’t have a fan either… but it should work

added fan to my board, but it is on at bootup…afair there was a problem i always have +5v on fan-port (remember that i see this on testing pwm)

@sinovoip, have you an idea why i always get 5V on FAN-port? in documentation this should be connected to pwm3 (2)

so what will be the best trotteling-setting without disabling any trip?

Do you know any per-cpu value for reading temp and freq?

i wonder why my r2 is not throttled…

echo "TEMP:" $(cat /sys/class/thermal/thermal_zone0/temp) "   FREQ:" $(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq)
TEMP: 52713    FREQ: 1040000

so also over the passive trip (47 degrees, and all cpus are defined as cooling device)

mt7623n-bananapi-bpi-r2.dts does not contain any overrides for thermal-zones/cooling-devices

while comparing defconfigs, i guess on r2 i miss

CONFIG_CPU_THERMAL=y

if i enable this, i have same on r2…trottling down on 47 degrees Celsius

root@bpi-r2:~# echo "TEMP:" $(cat /sys/class/thermal/thermal_zone0/temp) "   FREQ:" $(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq)
TEMP: 47085    FREQ: 598000
root@bpi-r2:~# echo "TEMP:" $(cat /sys/class/thermal/thermal_zone0/temp) "   FREQ:" $(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq)
TEMP: 47085    FREQ: 97999
root@bpi-r2:~#

Posted patch to increase passive trip to 57 degrees

https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/

I was about to suggest checking kernel config, seems you found it already.

Too bad we did not hear anything from Mediatek or Bananapi as to which temperature to set these values to .

I have run my mt7622 on 88 degrees for several hours, build a kernel 5 or 6 times now. All builds successful, no problems at this temperature encountered yet…

This issue is reported to openwrt too (for mt7623):

I originally had thought that we could swap the first two trip point types and solve the problem, but looking more closely at the dtsi file I see that the first three trip points (passive, active, and hot) all refer to identical cooling maps which have unlimited CPU scaling as their only recourse.

I now believe the only real solution is to simply delete the first two trip points and cooling maps. There was some discussion of this earlier, I see, and I think it was hoped that Mediatek would weigh in on this issue. I don’t think we should wait. I have proposed a patch on the OpenWrt tracker for the MT7623 boards, and I think the same patch should be proposed upstream.

I considered trying to get fancy and have the first two trip points just be limited in the amount they scale, but the reality is, that neither 47°C or even 67°C are dangerous temperatures, so there is no need to even begin CPU throttling until 87°C. Since the kernel will throttle the CPU speed all the way down to 98MHz if the temperature goes even a degree about the trip point, I believe this is an appropriate trip point.

Maybe a fan can be used in first 2 trips,but my tests with fan on r64 showing that fan was no real pwm…i have only on and off,did not know why as the mapping to pwm was right

Hi guys

can you tell me why i have not file /sys/class/thermal/thermal_zone0/temp ?

root@bpi-r64:/# cat /sys/class/thermal/thermal_zone0/temp
cat: /sys/class/thermal/thermal_zone0/temp: No such file or directory

maybe some kind of kernel module is needed ?

Imho r64 uses

CONFIG_MEDIATEK_MT6577_AUXADC

Which is set in my defconfig in branch 6.6-main

And these common options are needed:

CONFIG_HWMON=y
CONFIG_THERMAL_HWMON=y

Could you check if all 3 are selected in your kernel? tried importing defconfig and all are set…maybe anything in bootlog (dmesg)?

maybe MTK_SOC_THERMAL and/or MTK_THERMAL are needed…

first was introduced in 6.3, so if 6.1 was working and 6.6 not this may because of this

https://cateee.net/lkddb/web-lkddb/MTK_SOC_THERMAL.html

seems i found cause…

fad399ebdd67 thermal/drivers/mediatek: Relocate driver to mediatek folder

moves MTK_THERMAL into the new directory/Kconfig and drops the “default y”

so please try to enable both options above

CONFIG_MTK_THERMAL=y
CONFIG_MTK_SOC_THERMAL=y

and then build/try again

1 Like

yes, its not enabled

image

i`ll try recompile

thank you Frank

Thanks, I also needed to add this again…

i have done as you advised, and driver not loaded. There is no thermal_zone0

root@bpi-r64:/# dmesg | grep -i thermal
[    0.014084] thermal_sys: Registered thermal governor 'fair_share'
[    0.014088] thermal_sys: Registered thermal governor 'bang_bang'
[    0.014092] thermal_sys: Registered thermal governor 'step_wise'
[    0.014096] thermal_sys: Registered thermal governor 'user_space'
[   23.779316] platform 1100b000.thermal: deferred probe pending
root@bpi-r64:/# 
root@bpi-r64:/# lsmod | grep -e 'thermal\|aux'
root@bpi-r64:/# 
root@bpi-r64:/# ls /sys/class/thermal/
cooling_device0
root@bpi-r64:/# 

NVMEM_MTK_EFUSE seems to be missing too…looks like it is renamed

CONFIG_MTK_EFUSE=y to CONFIG_NVMEM_MTK_EFUSE=y

since 6.1 Linux Kernel Driver DataBase: CONFIG_NVMEM_MTK_EFUSE: Mediatek SoCs EFUSE support

by commit

28fc7c986f01 2022-09-16 nvmem: prefix all symbols with NVMEM_

there is no the config line, at all

# CONFIG_NVMEM_MTK_EFUSE is not set

does this need to be enabled?

yes, this also needs to be added / replacing the old option as i’ve wrote above

root@bpi-r64:~# cat /sys/class/thermal/thermal_zone0/temp                                                                                 
41800

upload fixes to 6.6-main branch and updated 6.1-6.8

@dangowrt do you need this fix too (CONFIG_NVMEM_MTK_EFUSE) for r64/mt7622 and r2/mt7623 after switching to 6.1? the other was 6.3+ so it should not affect opwnwrt

@Krantic a bit more information how i found this out:

  • you’ve shown this error: platform 1100b000.thermal: deferred probe pending, that means that a depency is not filled…
  • looking in dts https://github.com/frank-w/BPI-Router-Linux/blob/6.6-main/arch/arm64/boot/dts/mediatek/mt7622.dtsi#L509 you see depency on pericfg, apmixedsys and thermal_calibration
  • as pericfg does manage all peripheral clocks and other systems work, it should be ok
  • thermal_calibration is subnode of the efuse which was likely the first thing i look :slight_smile:
  • have not looked on apmixedsys, but this would be next part if it was not fixed (searching compatible e.g. with grep -Rni 'compatible' drivers, then makefile in same folder of driver-file to get the corresponding CONFIG option)

Hi guys

it all worked

but now i have another problem

works very slowly

root@bpi-r64:/shara/R64# ./loopt.sh
TEMP: 59900   FREQ: 119999
TEMP: 60300   FREQ: 119999
TEMP: 60200   FREQ: 119999
TEMP: 60200   FREQ: 119999
TEMP: 59900   FREQ: 119999
TEMP: 60200   FREQ: 119999
TEMP: 60000   FREQ: 119999

how to increase the processor frequency and keep it around 1,000,000 ?

Raise temp lower thermalzone in dts. When this temp is arrived cpu will be trottled.

Had done this way in 6.1-main: arm64: dts: mediatek: update thermal trips · frank-w/BPI-Router-Linux@674a164 · GitHub

it needs recompile kernel ?

Yes,maybe you can test it before by setting temp via sysfs,seen this here somewhere,but have not tested

You could use a devicetree overlay for it.