mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] ACPI: PRM: Skip the initialization when boot from legacy BIOS
@ 2025-10-13  8:31 Shang song (Lenovo)
  2025-10-27 18:25 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Shang song (Lenovo) @ 2025-10-13  8:31 UTC (permalink / raw)
  To: Rafael J . Wysocki
  Cc: Len Brown, linux-acpi, linux-kernel, shangsong2, Shang song (Lenovo)

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-27 18:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-13  8:31 [PATCH 1/1] ACPI: PRM: Skip the initialization when boot from legacy BIOS Shang song (Lenovo)
2025-10-27 18:25 ` Rafael J. Wysocki

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®