From: "Joshua Peisach" <jpeisach@ubuntu.com>
To: "Yureka Lilian" <yureka@cyberchaos.dev>,
"Jonathan Corbet" <corbet@lwn.net>,
"Shuah Khan" <skhan@linuxfoundation.org>,
"Catalin Marinas" <catalin.marinas@arm.com>,
"Will Deacon" <will@kernel.org>
Cc: <linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <asahi@lists.linux.dev>
Subject: Re: [PATCH] arch: arm64: add early_param idle=<wfi|yield|nop>
Date: Mon, 06 Jul 2026 19:21:09 -0400 [thread overview]
Message-ID: <DJRVH1JI4C7F.3HZUQJ5YXD7BO@ubuntu.com> (raw)
In-Reply-To: <20260705-arm64-idle-param-v1-1-7454249f473f@cyberchaos.dev>
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
prev parent reply other threads:[~2026-07-06 23:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-05 10:02 [PATCH] arch: arm64: add early_param idle=<wfi|yield|nop> Yureka Lilian
2026-07-06 5:23 ` Anshuman Khandual
2026-07-06 23:21 ` Joshua Peisach [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DJRVH1JI4C7F.3HZUQJ5YXD7BO@ubuntu.com \
--to=jpeisach@ubuntu.com \
--cc=asahi@lists.linux.dev \
--cc=catalin.marinas@arm.com \
--cc=corbet@lwn.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=will@kernel.org \
--cc=yureka@cyberchaos.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox