Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernel: idle: introduce idle enter hook #83760

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bjarki-andreasen
Copy link
Collaborator

@bjarki-andreasen bjarki-andreasen commented Jan 9, 2025

To allow for custom SoC idle behavior, introduce hook executed
when idle thread is entered, and add the config
CONFIG_IDLE_DEFAULT_ROUTINE to allow excluding the current
"default" idle routine.

This addition introduces no functional change unless the hook
is explicitly enabled, and the default routine explicitly
disabled.

@bjarki-andreasen bjarki-andreasen force-pushed the kernel-idle-hooks branch 5 times, most recently from 8f8d5e8 to ed7327a Compare January 9, 2025 21:29
@bjarki-andreasen bjarki-andreasen changed the title kernel: idle: introduce idle enter/exit hooks kernel: idle: introduce idle enter hook Jan 9, 2025
To allow for custom SoC idle behavior, introduce hook executed
when idle thread is entered, and add the config
CONFIG_IDLE_DEFAULT_ROUTINE to allow excluding the current
"default" idle routine.

This addition introduces no functional change unless the hook
is explicitly enabled, and the default routine explicitly
disabled.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
* This hook is implemented by the SoC and can be used to perform any
* SoC-specific idle enter logic.
*/
void idle_enter_hook(void);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's SoC specific, maybe clearer and more consistent is

Suggested change
void idle_enter_hook(void);
void soc_idle_enter_hook(void);

Comment on lines +11 to +13
config IDLE_DEFAULT_ROUTINE
bool "Execute idle default routine"
default y
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any options executed by the default routine should depend on this option, right? e.g. policy stuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants