next_valid_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– next_valid_state(9) πŸ’–

okay bestie, welcome to the Kernel API Manual entry for next_valid_state(9) β€” this one's all about finding the next valid C-state, and it's lowkey important so listen up πŸ’…

🌸 NAME 🌸

next_valid_state β€” Find next valid C-state ✨

πŸ¦‹ SYNOPSIS πŸ¦‹

       int next_valid_state (struct cpuidle_device *dev , struct cpuidle_driver
       *drv , int index );

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the cpuidle device πŸ‘‘
  • drv β€” the cpuidle driver πŸ’«
  • index β€” the index of the currently selected c-state 🎯

✨ DESCRIPTION ✨

so here's the tea β˜•: if the state that matches index is valid, then index is returned right back to the caller β€” no extra drama, no cap.

but if that state isn't valid, this function goes looking for a lower c-state that's still valid (as defined in omap3_power_states[]) and returns that one's index instead. it's giving "we'll find you a backup plan" energy 🫢

and just so we're clear, a state counts as valid when the 'valid' field is enabled and it satisfies the enable_off_mode condition. both boxes, bestie βœ…βœ…

🌈 SEE ALSO 🌈

go peek at the kernel file ./arch/arm/mach-omap2/cpuidle34xx.c, plus these iconic functions: omap3_enter_idle(9), omap3_enter_idle_bm(9), and omap3_idle_init(9) 🌟


mwah πŸ’‹ this page came from ./arch/arm/mach-omap2, dated October 2026, and it's literally next_valid_state(9) β€” bye bestie πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from