From: Usama Arif <usama.arif@linux.dev>
To: Kiryl Shutsemau <kirill@shutemov.name>
Cc: Usama Arif <usama.arif@linux.dev>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>, James Morse <james.morse@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Marc Zyngier <maz@kernel.org>,
Doug Anderson <dianders@chromium.org>,
Petr Mladek <pmladek@suse.com>,
Thomas Gleixner <tglx@linutronix.de>,
Andrew Morton <akpm@linux-foundation.org>,
Baoquan He <bhe@redhat.com>, Puranjay Mohan <puranjay@kernel.org>,
Breno Leitao <leitao@debian.org>,
Julien Thierry <julien.thierry.kdev@gmail.com>,
Lecopzer Chen <lecopzer@gmail.com>,
Sumit Garg <sumit.garg@kernel.org>,
kernel-team@meta.com, kexec@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
"Kiryl Shutsemau (Meta)" <kas@kernel.org>
Subject: Re: [PATCH v5 1/4] firmware: arm_sdei: add sdei_is_present()
Date: Tue, 30 Jun 2026 03:47:11 -0700 [thread overview]
Message-ID: <20260630104713.3847805-1-usama.arif@linux.dev> (raw)
In-Reply-To: <dcf564152da8fc599cbfbe8b8d254fe837262ed3.1782744912.git.kas@kernel.org>
On Mon, 29 Jun 2026 16:07:15 +0100 Kiryl Shutsemau <kirill@shutemov.name> wrote:
> From: "Kiryl Shutsemau (Meta)" <kas@kernel.org>
>
> invoke_sdei_fn() returns -EIO when no SDEI conduit was probed, and the
> core warns ("Failed to create event ...") on any registration that hits
> that. An optional consumer that registers an event from an unconditional
> initcall would therefore make every boot on a non-SDEI system emit that
> warning for what is simply absent firmware.
>
> Expose whether SDEI firmware is present so such a consumer can skip
> registration -- and the warning -- when there is nothing to talk to.
>
> Signed-off-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
> ---
Can this be merged in patch 3 where this function is actually used?
> drivers/firmware/arm_sdei.c | 10 ++++++++++
> include/linux/arm_sdei.h | 3 +++
> 2 files changed, 13 insertions(+)
>
> diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c
> index f39ed7ba3a38..c161cf263547 100644
> --- a/drivers/firmware/arm_sdei.c
> +++ b/drivers/firmware/arm_sdei.c
> @@ -339,6 +339,16 @@ static void _ipi_unmask_cpu(void *ignored)
> sdei_unmask_local_cpu();
> }
>
> +/*
> + * Was SDEI firmware probed and is it usable? Lets optional consumers skip
> + * registering an event -- and the warning a failed registration emits -- on
> + * systems with no SDEI.
> + */
> +bool sdei_is_present(void)
> +{
> + return sdei_firmware_call;
sdei_firmware_call is a function pointer. The above is correct, but
can we make it sdei_firmware_call != NULL? I think that looks a lot better.
> +}
> +
> static void _ipi_private_reset(void *ignored)
> {
> int err;
> diff --git a/include/linux/arm_sdei.h b/include/linux/arm_sdei.h
> index f652a5028b59..b07113eeeff7 100644
> --- a/include/linux/arm_sdei.h
> +++ b/include/linux/arm_sdei.h
> @@ -37,6 +37,9 @@ int sdei_event_unregister(u32 event_num);
> int sdei_event_enable(u32 event_num);
> int sdei_event_disable(u32 event_num);
>
> +/* Was SDEI firmware probed and usable? */
> +bool sdei_is_present(void);
> +
> /* GHES register/unregister helpers */
> int sdei_register_ghes(struct ghes *ghes, sdei_event_callback *normal_cb,
> sdei_event_callback *critical_cb);
> --
> 2.54.0
>
>
next prev parent reply other threads:[~2026-06-30 10:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 15:07 [PATCH v5 0/4] arm64: cross-CPU NMI via SDEI Kiryl Shutsemau
2026-06-29 15:07 ` [PATCH v5 1/4] firmware: arm_sdei: add sdei_is_present() Kiryl Shutsemau
2026-06-30 10:47 ` Usama Arif [this message]
2026-06-30 10:57 ` Kiryl Shutsemau
2026-06-29 15:07 ` [PATCH v5 2/4] firmware: arm_sdei: add SDEI_EVENT_SIGNAL support Kiryl Shutsemau
2026-06-30 10:51 ` Usama Arif
2026-06-30 10:58 ` Kiryl Shutsemau
2026-06-29 15:07 ` [PATCH v5 3/4] drivers/firmware: add SDEI cross-CPU NMI service for arm64 Kiryl Shutsemau
2026-06-29 15:07 ` [PATCH v5 4/4] arm64: escalate smp_send_stop() to an SDEI NMI as a last resort Kiryl Shutsemau
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=20260630104713.3847805-1-usama.arif@linux.dev \
--to=usama.arif@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=catalin.marinas@arm.com \
--cc=dianders@chromium.org \
--cc=james.morse@arm.com \
--cc=julien.thierry.kdev@gmail.com \
--cc=kas@kernel.org \
--cc=kernel-team@meta.com \
--cc=kexec@lists.infradead.org \
--cc=kirill@shutemov.name \
--cc=lecopzer@gmail.com \
--cc=leitao@debian.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=pmladek@suse.com \
--cc=puranjay@kernel.org \
--cc=sumit.garg@kernel.org \
--cc=tglx@linutronix.de \
--cc=will@kernel.org \
/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