Re: [PATCH v2] arch: arm64: add early_param idle=<wfi|yield|nop>

From: Will Deacon

Date: Wed Jul 22 2026 - 17:48:33 EST


On Sat, Jul 11, 2026 at 09:35:25AM +0200, Yureka Lilian wrote:
> diff --git a/arch/arm64/lib/delay.c b/arch/arm64/lib/delay.c
> index e278e060e78a..2452990ed37a 100644
> --- a/arch/arm64/lib/delay.c
> +++ b/arch/arm64/lib/delay.c
> @@ -15,6 +15,8 @@
>
> #include <clocksource/arm_arch_timer.h>
>
> +#include "../kernel/idle.h"
> +
> #define USECS_TO_CYCLES(time_usecs) \
> xloops_to_cycles((time_usecs) * 0x10C7UL)
>
> @@ -49,7 +51,8 @@ void __delay(unsigned long cycles)
> * Start with WFIT. If an interrupt makes us resume
> * early, use a WFET loop to complete the delay.
> */
> - wfit(end);
> + if (likely(idle == ARM64_IDLE_WFI))
> + wfit(end);

Rather than scatter the idle implementation check across all users of
WFI*, why not move this into the macro itself? That way, the callers can
all stay like they are but the macro behaves as specified.

Will