Re: [PATCH] arch: arm64: add early_param idle=<wfi|yield|nop>
From: Joshua Peisach
Date: Mon Jul 06 2026 - 19:23:39 EST
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