Linux EFI development
 help / color / mirror / Atom feed
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 2/2] riscv: Restart via EFI runtime services when available
Date: Mon, 15 Jun 2026 16:28:22 -0700	[thread overview]
Message-ID: <20260615-efi_reset_shutdown-v1-2-9414edcbbab0@meta.com> (raw)
In-Reply-To: <20260615-efi_reset_shutdown-v1-0-9414edcbbab0@meta.com>

From: Atish Patra <atishp@meta.com>

Firmware-preferred reset and EFI capsule update support requires reset
via EFI runtime services rather than direction M-mode firmware invocation
via SBI. Unlike poweroff, restart mechanism is directly controlled from
machine_restart function though.

Prefer the EFI runtime ResetSystem() service for restart when UEFI
runtime services are available.

Signed-off-by: Atish Patra <atishp@meta.com>
---
 arch/riscv/kernel/reset.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/riscv/kernel/reset.c b/arch/riscv/kernel/reset.c
index 912288572226..541e2162c85a 100644
--- a/arch/riscv/kernel/reset.c
+++ b/arch/riscv/kernel/reset.c
@@ -3,6 +3,7 @@
  * Copyright (C) 2012 Regents of the University of California
  */
 
+#include <linux/efi.h>
 #include <linux/reboot.h>
 #include <linux/pm.h>
 
@@ -17,6 +18,12 @@ EXPORT_SYMBOL(pm_power_off);
 
 void machine_restart(char *cmd)
 {
+	/*
+	 * UpdateCapsule() depends on the system being reset via ResetSystem().
+	 */
+	if (efi_enabled(EFI_RUNTIME_SERVICES))
+		efi_reboot(reboot_mode, NULL);
+
 	do_kernel_restart(cmd);
 	while (1);
 }

-- 
2.53.0-Meta


  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 ` [PATCH 1/2] riscv: efi: Power off via EFI runtime services when available Atish Patra
2026-06-16  4:29   ` Sunil V L
2026-06-15 23:28 ` Atish Patra [this message]
2026-06-16  4:29   ` [PATCH 2/2] riscv: Restart " 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-2-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