From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-170.mta1.migadu.com (out-170.mta1.migadu.com [95.215.58.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71BD02FF147 for ; Mon, 15 Jun 2026 23:28:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781566125; cv=none; b=XJRtu8LZef51lUjc7n9tDXZWBYUmnppEei4mR4ptC5xD6b24AJYxjC4WdDdkUPdDrlejAq8Y1seOyHefmp2bqY0/CMPla+UCUv+/iU9Lk2lOKRTDs62yhdbysue8ThOm8ugF1QI6jy+/tRDBJc0XvIDcRYjgJyUqejEiVFZoyxM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781566125; c=relaxed/simple; bh=NNiG4rqPFC8BQrRXjhTqiLRidsNkTGaUd2xAU0lkm1M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tPURHDOPBMR9HnZV19NYJAzXkY9BFumgikf8NHw69DF/63rWt8vhzhO3W1dfx7A6HDoEGMRpVjp9OoGC04ntfQl0s83rLVK3EmhQVW3k3eyVzM5dsw8QlNtr8V5fom/2de0BpEVRL7M+9cgIATtN60CJ4dUmd+woUQC8C/5Lp9c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=cVG44EW3; arc=none smtp.client-ip=95.215.58.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="cVG44EW3" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1781566121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bFD7PCYKgMNlQ0jJPMmBIf9JeT90Xg327A7enHcLmAQ=; b=cVG44EW3QUCRCgsq2RqyhOsSP+ar7IZtxISVDRqexoye3m3MkwCuL4VwCJZ0tbO9jJUnfL sK6MpkXMKSuGR3NQorsVjOFspqTCHgR5OWb9dQobANunc+yi6tch6aA6sL59rHbfm7Vl4J OmKN5Y+VsweLxuoBzW/kEX6II7uKs5o= From: Atish Patra Date: Mon, 15 Jun 2026 16:28:21 -0700 Subject: [PATCH 1/2] riscv: efi: Power off via EFI runtime services when available Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260615-efi_reset_shutdown-v1-1-9414edcbbab0@meta.com> References: <20260615-efi_reset_shutdown-v1-0-9414edcbbab0@meta.com> In-Reply-To: <20260615-efi_reset_shutdown-v1-0-9414edcbbab0@meta.com> To: Ard Biesheuvel , Ilias Apalodimas , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Atish Patra Cc: linux-efi@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Atish Patra X-Migadu-Flow: FLOW_OUT From: Atish Patra 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 --- 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