From: Atish Patra <atish.patra@linux.dev>
To: Ard Biesheuvel <ardb@kernel.org>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
Atish Patra <atish.patra@linux.dev>
Cc: linux-efi@vger.kernel.org, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org, Atish Patra <atishp@meta.com>
Subject: [PATCH 1/2] riscv: efi: Power off via EFI runtime services when available
Date: Mon, 15 Jun 2026 16:28:21 -0700 [thread overview]
Message-ID: <20260615-efi_reset_shutdown-v1-1-9414edcbbab0@meta.com> (raw)
In-Reply-To: <20260615-efi_reset_shutdown-v1-0-9414edcbbab0@meta.com>
From: Atish Patra <atishp@meta.com>
When booted via UEFI with runtime services enabled, EFI Reset Shutdown is
the firmware-preferred shutdown path: it lets firmware run its own
shutdown hooks which may invoke SBI SRST extension internally. However,
RISC-V always powers off via the SBI SRST extension today and EFI runtime
path is never used even when firmware provides it.
Enable the poweroff via EFI by overriding efi_poweroff_required()
Signed-off-by: Atish Patra <atishp@meta.com>
---
arch/riscv/kernel/efi.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/riscv/kernel/efi.c b/arch/riscv/kernel/efi.c
index b64bf1624a05..2d3cc57b4535 100644
--- a/arch/riscv/kernel/efi.c
+++ b/arch/riscv/kernel/efi.c
@@ -95,3 +95,8 @@ int __init efi_set_mapping_permissions(struct mm_struct *mm,
md->num_pages << EFI_PAGE_SHIFT,
set_permissions, md);
}
+
+bool efi_poweroff_required(void)
+{
+ return efi_enabled(EFI_RUNTIME_SERVICES);
+}
--
2.53.0-Meta
next prev parent reply other threads:[~2026-06-15 23:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-15 23:28 [PATCH 0/2] riscv: Use EFI runtime services for poweroff and restart Atish Patra
2026-06-15 23:28 ` Atish Patra [this message]
2026-06-16 4:29 ` [PATCH 1/2] riscv: efi: Power off via EFI runtime services when available Sunil V L
2026-06-15 23:28 ` [PATCH 2/2] riscv: Restart " Atish Patra
2026-06-16 4:29 ` Sunil V L
2026-06-25 20:14 ` [PATCH 0/2] riscv: Use EFI runtime services for poweroff and restart Paul Walmsley
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=20260615-efi_reset_shutdown-v1-1-9414edcbbab0@meta.com \
--to=atish.patra@linux.dev \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=ardb@kernel.org \
--cc=atishp@meta.com \
--cc=ilias.apalodimas@linaro.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=pjw@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
all inboxes | Powered by JetHome®