0

I was trying to look into the device temperature. What I found has puzzled me. When I go to /sys/class/thermal/thermal_zone1/subsystem it has endless loop.

It would be clear from the output of pwd as follows:

/sys/class/thermal/thermal_zone1/subsystem/thermal_zone1/subsystem/thermal_zone1/subsystem/thermal_zone1/subsystem/thermal_zone1/subsystem/thermal_zone1

Output of ls in pwd:

/sys/class/thermal/thermal_zone1/subsystem/thermal_zone1/subsystem/thermal_zone1/subsystem/thermal_zone1/subsystem/thermal_zone1/subsystem/thermal_zone1$ 
ls
available_policies  k_d  k_po  mode    passive  power  subsystem          temp  uevent
integral_cutoff

And it does not end here, I can keep doing cd into subsystem folder and so on and so forth.

So, my question is why it has so many subsystem inside thermal_zone1? Is it normal?

Device info:

$uname -a
Linux chips 4.4.154-1124-rockchip-ayufan-*** #1 SMP Mon Oct 22 20:59:41 UTC 2018 aarch64 aarch64 aarch64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.2 LTS
Release:    18.04
Codename:   bionic

I have seen this answer but I do not think it addresses my question.

1 Answer 1

1

This is normal.

The subsystem links under /sys/class aren’t subsystems of their containing directory, but rather links to the subsystem containing them. So /sys/class/thermal/*/subsystem links back to /sys/class/thermal, and you get the loop you’ve run into.

Put another way, /sys/class/thermal/thermal_zone1/subsystem isn’t a subsystem of /sys/class/thermal/thermal_zone1; it points to /sys/class/thermal, the subsystem of which /sys/class/thermal/thermal_zone1 is a part.

This setup makes a little more sense when considered that /sys/class/thermal/* are themselves symlinks which point to entries under /sys/devices, i.e. outside the /sys/class tree...

1
  • Thank you. I see 9032 lrwxrwxrwx 1 root root 0 Jan 18 2013 subsystem -> ../../../../class/thermal
    – Rakib Fiha
    Commented Dec 14, 2019 at 11:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .