[PATCH] arch: arm64: add early_param idle=<wfi|yield|nop>
Joshua Peisach
jpeisach at ubuntu.com
Mon Jul 6 16:21:09 PDT 2026
On Sun Jul 5, 2026 at 6:02 AM EDT, Yureka Lilian wrote:
> +
> +enum idle_mode idle = WFI;
> +
> +/* User can over-ride above with "idle=<wfi|yield|nop>" in cmdline */
> +static int __init setup_idle(char *s)
> +{
> + if (!s)
> + return -1;
> + else if (!strcmp(s, "wfi"))
> + idle = WFI;
> + else if (!strcmp(s, "yield"))
> + idle = YIELD;
> + else if (!strcmp(s, "nop"))
> + idle = NOP;
> + else
> + return -1;
> +
> + return 0;
> +}
> +early_param("idle", setup_idle);
> +
> /*
> * cpu_do_idle()
> *
> @@ -26,8 +48,13 @@ void __cpuidle cpu_do_idle(void)
>
> arm_cpuidle_save_irq_context(&context);
>
> - dsb(sy);
> - wfi();
> + if (likely(idle == WFI)) {
> + dsb(sy);
> + wfi();
> + } else if (idle == YIELD) {
> + dsb(sy);
> + asm volatile("yield" ::: "memory");
> + }
>
And otherwise...........?
I guess it would be NOP, so do nothing - is this expected behavior?
-Josh
More information about the linux-arm-kernel
mailing list