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

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.

Kernel recompile is imho easier for him :slight_smile: my current contruct uses fit with builtin overlays,not sure if it is possible to add an external overlay to it

thank you gentlemen

i have recompile and this worked

    cpu_passive: cpu-passive {
  /*      temperature = <47000>; */
          temperature = <77000>;
          hysteresis = <2000>;
          type = "passive";
          };

it seems(imho) this variable should be placed in uEnv.txt

I cannot place dts parts in uEnv.txt

Hello guys

# cat /proc/sys/kernel/printk
# 10   7   1   15

i can reassign it by sysctl.conf, but is this ok?