Cooling CPU in software S905X2/S922?

SOLVED!!

I put sleep to 60, and passed to 100.

Thank you very much!

1 Like

60 :slight_smile:

I don’t know yet why value can’t be set without delay.

I suspect that the files from policy0 / ondemand are created a little later, and the command

echo 100> /sys/devices/system/cpu/cpufreq/policy0/ondemand/up_threshold

without delay has nothing to change, the up_threshold file does not exist at the time autostart.sh is read and executed.

No, the file is there. But cat-ing it’s value just shows nothing. No value, not even 50 set from initramfs. Looks like the value is used sometime later. In my case I have to use delay of 5 seconds (4 is not enough).

Aha. I will try later on vim3 with sleep 5. Probably this value should be adjusted according to the performance of the device. CPU, sd / usb, emmc, etc.
Since I have not played yet with sleep time for X96, but this is no longer so important.

Hi Peter,
Now, after I solved with s905x3, I wanted to do the setting for vim3 (4 + 2 cores), but on my vim3 I did not have in policy0 the ondemand section. How could I activate it?
I saw that initially you had two lines, policy0 and policy2.
Thanks.

Yes, on vim3 there are two policies 0 and 2. So you need to write same settings to both. Like

echo 100 >/sys/devices/system/cpu/cpufreq/policy0/ondemand/up_threshold
echo 100 >/sys/devices/system/cpu/cpufreq/policy2/ondemand/up_threshold

There is nothing need to be done to see ondemand files.

In policy2 you can see, in policy0 you don’t see. Is that normal? It is not the ondemand folder in policy0.

It is not normal according to me. I see both:

vim3:~ # cat /sys/devices/system/cpu/cpufreq/policy*/ondemand/up_threshold
50
50

Yes, so in the putty I see the values, I was referring to the structure of directories and files here

/sys/devices/system/cpu/cpufreq/policy0

vim3:~ # ls -l /sys/devices/system/cpu/cpufreq/policy0/
total 0
-r--r--r--    1 root     root          4096 Mar  1 19:50 affected_cpus
-r--------    1 root     root          4096 Mar  1 13:26 cpuinfo_cur_freq
-r--r--r--    1 root     root          4096 Mar  1 19:50 cpuinfo_max_freq
-r--r--r--    1 root     root          4096 Mar  1 19:50 cpuinfo_min_freq
-r--r--r--    1 root     root          4096 Mar  1 19:50 cpuinfo_transition_latency
drwxr-xr-x    2 root     root             0 Mar  1 14:29 ondemand
-r--r--r--    1 root     root          4096 Mar  1 19:50 related_cpus
-r--r--r--    1 root     root          4096 Mar  1 19:50 scaling_available_frequencies
-r--r--r--    1 root     root          4096 Mar  1 11:18 scaling_available_governors
-r--r--r--    1 root     root          4096 Mar  1 11:18 scaling_cur_freq
-r--r--r--    1 root     root          4096 Mar  1 19:50 scaling_driver
-rw-r--r--    1 root     root          4096 Mar  1 11:18 scaling_governor
-rw-r--r--    1 root     root          4096 Mar  1 11:18 scaling_max_freq
-rw-r--r--    1 root     root          4096 Mar  1 11:18 scaling_min_freq
-rw-r--r--    1 root     root          4096 Mar  1 19:50 scaling_setspeed
drwxr-xr-x    2 root     root             0 Mar  1 19:50 stats
vim3:~ #
vim3:~ # ls -l /sys/devices/system/cpu/cpufreq/policy2/
total 0
-r--r--r--    1 root     root          4096 Mar  1 19:50 affected_cpus
-r--------    1 root     root          4096 Mar  1 13:26 cpuinfo_cur_freq
-r--r--r--    1 root     root          4096 Mar  1 19:50 cpuinfo_max_freq
-r--r--r--    1 root     root          4096 Mar  1 19:50 cpuinfo_min_freq
-r--r--r--    1 root     root          4096 Mar  1 19:50 cpuinfo_transition_latency
drwxr-xr-x    2 root     root             0 Mar  1 19:50 ondemand
-r--r--r--    1 root     root          4096 Mar  1 19:50 related_cpus
-r--r--r--    1 root     root          4096 Mar  1 19:50 scaling_available_frequencies
-r--r--r--    1 root     root          4096 Mar  1 19:50 scaling_available_governors
-r--r--r--    1 root     root          4096 Mar  1 19:50 scaling_cur_freq
-r--r--r--    1 root     root          4096 Mar  1 19:50 scaling_driver
-rw-r--r--    1 root     root          4096 Mar  1 11:18 scaling_governor
-rw-r--r--    1 root     root          4096 Mar  1 19:50 scaling_max_freq
-rw-r--r--    1 root     root          4096 Mar  1 19:50 scaling_min_freq
-rw-r--r--    1 root     root          4096 Mar  1 19:50 scaling_setspeed
drwxr-xr-x    2 root     root             0 Mar  1 19:50 stats

Okay, so it appears to me in the terminal, not seen in sftp (I use WinSCP). It doesn’t matter, it is important that it works.
Thanks.

1 Like

Just curious why everyone uses the ECHO method instead of TEE as I wrote near the very top?

Because echo run as root it can write directly to specified file.
Tee is usually used when echo-ing something as regular user and in this case echo doesn’t work.
Read bash - sudo echo "something" >> /etc/privilegedFile doesn't work - Stack Overflow

I use ‘tee’ only when I require the input to be sent to more than one file, otherwise I use ‘echo’.

tee - read from standard input and write to standard output and files

This will set the value just as soon as the ondemand governor is ready:

while [ $(cat /sys/devices/system/cpu/cpufreq/policy0/ondemand/up_threshold) != 100 ]
  do echo 100 > /sys/devices/system/cpu/cpufreq/policy0/ondemand/up_threshold
done
1 Like

Hi,

In the frequency settings in the policy I noticed that we have this:
scaling_min_freq - 667000
and
scaling_available_frequencies - 100000 250000 500000 667000 1000000 1200000 1404000 1500000 1608000 1704000 1800000 1908000
This means that the frequencies 100000, 250000, 500000 cannot be used. It wouldn’t help either.
In time_in_state I saw that most are used 1000000 and 1200000.
Would it be wrong to eliminate 100000, 250000, 500000 and introduce something like 880000, 1100000 and 1300000?
scaling_available_frequencies - 667000 880000 1000000 1100000 1200000 1300000 1404000 1500000 1608000 1704000 1800000 1908000

Thanks.

Hi Guys what temps do you have on GT King?

The available frequencies are read only. They come from the dtb, which in turn comes from the manufacturers specifications for the chip. You can’t choose an arbitrary (unsupported) frequency. I expect the low rates are blocked because the OS does not perform properly at those rates.

I understand what you are saying, but those values do not seem to be chosen according to a precise mathematical calculation. I thought it wasn’t that complicated. However, it is not too important, ondemand governor is working well as he is now and I do not think it is worth the effort to make changes.
Thanks.