mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Shang song (Lenovo)" <shangsong2@foxmail.com>
To: "Rafael J . Wysocki" <rafael@kernel.org>
Cc: Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	shangsong2@lenovo.com,
	"Shang song (Lenovo)" <shangsong2@foxmail.com>
Subject: [PATCH 1/1] ACPI: PRM: Skip the initialization when boot from legacy BIOS
Date: Mon, 13 Oct 2025 04:31:40 -0400	[thread overview]
Message-ID: <tencent_EAFBEC2D1967D73F4F76B8048D2F59BB1105@qq.com> (raw)

To address the confusion caused by the misleading "Failed to find VA for GUID..."
message during legacy BIOS boot, making 'EFI_RUNTIME_SERVICES's earlier judgment
can prevent this false alert.

Signed-off-by: Shang song (Lenovo) <shangsong2@foxmail.com>
---
 drivers/acpi/prmt.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/acpi/prmt.c b/drivers/acpi/prmt.c
index 6792d4385eee..ec367d322ab2 100644
--- a/drivers/acpi/prmt.c
+++ b/drivers/acpi/prmt.c
@@ -305,11 +305,6 @@ static acpi_status acpi_platformrt_space_handler(u32 function,
 	efi_status_t status;
 	struct prm_context_buffer context;
 
-	if (!efi_enabled(EFI_RUNTIME_SERVICES)) {
-		pr_err_ratelimited("PRM: EFI runtime services no longer available\n");
-		return AE_NO_HANDLER;
-	}
-
 	/*
 	 * The returned acpi_status will always be AE_OK. Error values will be
 	 * saved in the first byte of the PRM message buffer to be used by ASL.
@@ -388,6 +383,14 @@ void __init init_prmt(void)
 	acpi_status status;
 	int mc;
 
+	/*
+	 * Return immediately if EFI_RUNTIME_SERVICES is not enabled.
+	 */
+	if (!efi_enabled(EFI_RUNTIME_SERVICES)) {
+		pr_info("PRM: EFI runtime services unavailable, can not initialize.\n");
+		return;
+	}
+
 	status = acpi_get_table(ACPI_SIG_PRMT, 0, &tbl);
 	if (ACPI_FAILURE(status))
 		return;
@@ -404,11 +407,6 @@ void __init init_prmt(void)
 
 	pr_info("PRM: found %u modules\n", mc);
 
-	if (!efi_enabled(EFI_RUNTIME_SERVICES)) {
-		pr_err("PRM: EFI runtime services unavailable\n");
-		return;
-	}
-
 	status = acpi_install_address_space_handler(ACPI_ROOT_OBJECT,
 						    ACPI_ADR_SPACE_PLATFORM_RT,
 						    &acpi_platformrt_space_handler,
-- 
2.43.7


             reply	other threads:[~2025-10-13  8:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-13  8:31 Shang song (Lenovo) [this message]
2025-10-27 18:25 ` Rafael J. Wysocki

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=tencent_EAFBEC2D1967D73F4F76B8048D2F59BB1105@qq.com \
    --to=shangsong2@foxmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=shangsong2@lenovo.com \
    /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®