arm_cpuidle_read_ops(9)
β¨ 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 astruct device nodethat 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β nocpuidle_opsis registered for that'enable-method', or either theinitorsuspendcallback 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms