Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

/sys/class/devfreq

FieldValue
Subsystemdevfreq framework (generic device frequency scaling), PM subsystem; implementation file not in cached tree
Config gatenot verifiable from the cached sources (cached tree has no Kconfig or driver files); class absent on the live host
ABI documentationDocumentation/ABI/testing/sysfs-class-devfreq (14 What entries)
Sincedirectory September 2011; name November 2019; timer July 2020; related_cpus June 2025
Live (5.10.134 host)class absent: not in live-sys/class-list.txt, no /sys/class/devfreq
Ledger IDSYSC-devfreq

What it represents

One directory per devfreq object, named after the device doing frequency scaling (memory controllers, GPUs, buses). devfreq is the counterpart of cpufreq for non-CPU devices: a governor samples device load and picks an operating frequency from the device’s available frequencies. The class exposes the governor choice, the frequency bounds, statistics and the polling machinery.

Relationship to the device model

Each devfreq object wraps a registered struct device; the class directory is a view of that device and its name is the device name. A governor periodically samples load (via devfreq-event counters on some platforms) and re-programs the frequency within the min/max window userspace can narrow; the sysfs files are the observation and policy layer over that loop. Files appear conditionally: polling_interval and timer exist only for polling governors (the ABI names simple_ondemand and tegra_actmon), userspace/set_freq only for the userspace governor, and related_cpus only when a devfreq domain is closely associated with a CPU subset. trans_stat requires the driver to supply a frequency table.

Attributes

AttributeR/WUnit/formatConditional?Source
.../nameROdevice name of the devfreq objectalwaysABI, November 2019
.../governorRWgovernor name; show or setalwaysABI, September 2011
.../cur_freqROHz; equals target_freq if driver has no get_cur_freqalwaysABI, September 2011
.../target_freqROHz; governor-predicted next frequencyalwaysABI, September 2012
.../trans_statRWtransition table (time per state, counts); write 0 resets; -EFBIG if bigger than PAGE_SIZEneeds profile freq tableABI, October 2012
.../available_frequenciesROHz list, snapshot not limited by min/maxalwaysABI, October 2012
.../available_governorsROgovernor name listalwaysABI, October 2012
.../min_freqRWHz lower bound; 0 = don’t care; overrides governorsalwaysABI, January 2013
.../max_freqRWHz upper bound; overrides governors and min_freqalwaysABI, January 2013
.../polling_intervalRWms; < 1 jiffy means no pollingpolling governorsABI, September 2011
.../userspace/set_freqRWHz; requested frequencyuserspace governorABI, September 2011
.../timerRWdeferrable or delayed work timersimple_ondemandABI, July 2020
.../related_cpusROCPU list related to this devfreq domainCPU-coupled devicesABI, June 2025

Safety and writes

Reads are safe. Writing governor, min_freq/max_freq, polling_interval or timer changes live scaling behavior of a hardware block; the ABI notes max_freq is the thermal throttle knob because it overrides min_freq. trans_stat accepts only 0 (statistics reset); a frequency table larger than PAGE_SIZE makes reads fail with -EFBIG. As with cpufreq, writes are policy changes and belong to system daemons, not ad hoc shell use.

References

  • Documentation/ABI/testing/sysfs-class-devfreq (cached copy; 14 What entries)
  • Sibling pages: devfreq-event, powercap; coverage: ledger
  • Live check: /sys/class/devfreq absent (kernel 5.10.134, read-only enumeration)