arm_cpuidle_read_ops(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ arm_cpuidle_read_ops ✨

okay bestie, welcome to the Kernel API Manual 🫢 this one's a little function with a big job: it's your lil matchmaker between a device tree cpu node and the cpuidle ops that go with it. let's get into it πŸ’…


🌸 NAME 🌸

arm_cpuidle_read_ops β€” literally initialize the cpuidle ops using the device tree πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int arm_cpuidle_read_ops (struct device_node *dn , int cpu );

πŸ’– ARGUMENTS πŸ’–

  • dn β€” a pointer to a struct device node that corresponds to a cpu node. yes, that kind of node, the device-tree kind, not the node.js kind 😭
  • cpu β€” the cpu identifier. which cpu are we talking about? this number. periodt.

πŸ”₯ DESCRIPTION πŸ”₯

So here's the vibe: it grabs the method name that's defined in the 'enable-method' property, retrieves the cpuidle_ops that go with it, and then does a struct copy. πŸ’«

And why the copy, you ask? because literally all cpuidle_ops are tagged __initconst, which means they get unloaded after the init process wraps up. so if you don't copy it, you're holding a pointer to something that's about to ghost you πŸ’€ that's the whole reason, no cap.

It returns 0 on success πŸŽ‰ and here's the fail squad:

  • -ENOENT β€” there's no 'enable-method' defined at all πŸ™ˆ
  • -EOPNOTSUPP β€” no cpuidle_ops is registered for that 'enable-method', or either the init or suspend callback isn't defined 😀
bestie pls note: if either callback is missing, it's a -EOPNOTSUPP situation. both of them have to show up to the party or nobody gets in πŸšͺ

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./arch/arm/kernel/cpuidle.c, plus the whole friend group:


🌈 that's the whole page, bestie, go forth and initialize 🌈

mwah πŸ’‹ this came from the source tree at <code>./arch/arm/kernel</code>, dated October 2026, and it lives in the Kernel API Manual β€” see u never, love u always πŸŽ€βœ¨

πŸ“¦ where this page comes from