"/sys/devices/platform/soc/soc:firmware/get_throttled" not working

According to firmware/raspberrypi: Add a get_throttled sysfs file by notro · Pull Request #2397 · raspberrypi/linux · GitHub , we can use “/sys/devices/platform/soc/soc:firmware/get_throttled” to get easier access to information provided by “vcgencmd get_throttled” command line.

Nevertheless, in my fully updated OSMC (kernel 4.19.122-1-osmc), the file exists but always returns “0”:

root@osmcpi:~# vcgencmd get_throttled
throttled=0x80008
root@osmcpi:~# cat "/sys/devices/platform/soc/soc:firmware/get_throttled" 
0

Can you upload some full logs so we can check config.txt and firmware version?

Cheers

Sam

This is OSMC 2020.6

root@osmcpi:~# cat /boot/config.txt
gpu_mem_1024=256  
hdmi_ignore_cec_init=1  
disable_overscan=1
start_x=1  
disable_splash=1
gpu_mem_256=112  
sdtv_aspect=1  
gpu_mem_512=144  
dtoverlay=gpio-ir,gpio_pin=18

root@osmcpi:~# uname -a
Linux osmcpi 4.19.122-1-osmc #1 SMP PREEMPT Wed May 27 07:09:59 UTC 2020 armv7l GNU/Linux

root@osmcpi:~# head /home/osmc/.kodi/temp/kodi.log                             
2020-08-11 04:17:10.386 T:1915213360  NOTICE: -----------------------------------------------------------------------
2020-08-11 04:17:10.387 T:1915213360  NOTICE: Starting Kodi (18.7). Platform: Linux ARM (Thumb) 32-bit
2020-08-11 04:17:10.387 T:1915213360  NOTICE: Using Release Kodi x32 build (version for Raspberry Pi)
2020-08-11 04:17:10.387 T:1915213360  NOTICE: Kodi compiled 2020-06-03 by GCC 6.3.0 for Linux ARM (Thumb) 32-bit version 4.9.110 (264558)
2020-08-11 04:17:10.387 T:1915213360  NOTICE: Running on Open Source Media Center 2020.06-1, kernel: Linux ARM 32-bit version 4.19.122-1-osmc
2020-08-11 04:27:31.021 T:1915213360  NOTICE: FFmpeg version/source: 4.0.4-Kodi
2020-08-11 04:27:31.021 T:1915213360  NOTICE: Host CPU: ARMv7 Processor rev 4 (v7l), 4 cores available
2020-08-11 04:27:31.021 T:1915213360  NOTICE: ARM Features: Neon disabled

This is a Raspberry PI 3B+ Rev 1.3.

Unfortunately I can’t advise from those logs.

Sam

What logs do you need?

Has anybody else have good readings from that driver?

so 0 in this case means that everything is fine

get a shitty phone charger then the value will change

anything else then 0 is bad if there has been past bad values they will get logged in dmesg

Can you tel us what you expect to see, with a link to the relevant documentation?

Looking around, the first 16 bits should show the current state and the last 16 bits are historical data. The current value can clearly change at any time, and the historical data will probably have some kind of ageing applied to it – and might even be reset by running the vcgencmd command. I expect the documentation will explain all of this.

@Toast What is the relevance of the code you linked to? It’s reading from this file:

SYSFILE = '/sys/class/hwmon/hwmon0/in0_lcrit_alarm'

thats for upcoming kernel changes from what @popcornmix said on github on an opened issue then submitted on a pr on github for the kernel

Rpi 4.19.y RFC Enable Raspberry Pi voltage monitor by lategoodbye · Pull Request #2706 · raspberrypi/linux · GitHub

should be able to use that as a booleen, hope that clears it up

I would expect “/sys/devices/platform/soc/soc:firmware/get_throttled” and “vcgencmd get_throttled” to agree.

The aging factor could be relevant, so I did this:

  1. Push the CPU usage to get thermally throttled:

  2. Verify it:

    root@osmcpi:~# vcgencmd get_throttled
    throttled=0xd0008

  3. Verify the file:

    root@osmcpi:~# cat “/sys/devices/platform/soc/soc:firmware/get_throttled”
    0

so what does the cpu temp say at that moment since thermal kicked in ?

root@osmcpi:~# vcgencmd measure_temp
temp=68.2’C

You can possibly try yourself with a couple of infinite loops. In Python: “while True: pass”