Re: [PATCH 1/1] ACPI: PRM: Skip the initialization when boot from legacy BIOS

From: Rafael J. Wysocki
Date: Mon Oct 27 2025 - 14:26:25 EST


On Mon, Oct 13, 2025 at 10:38 AM Shang song (Lenovo)
<shangsong2@xxxxxxxxxxx> wrote:
>
> 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@xxxxxxxxxxx>
> ---
> 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 check removed by this change addresses a different case than the
similar check in init_prmt(), so removing it when relocating the other
check is questionable.

Please limit this patch to the init_prmt() changes.

> /*
> * 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.
> + */

One-line comment would be sufficient here.

> + 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,
> --