[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0idDF5b5WsQz-fSNxe0-nR+2zX1_DRnCo9uu2jLkv2Q9Q@mail.gmail.com>
Date: Thu, 4 Sep 2025 17:20:12 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: "Shang song (Lenovo)" <shangsong2@...mail.com>
Cc: "Rafael J . Wysocki" <rafael@...nel.org>, Len Brown <lenb@...nel.org>, linux-acpi@...r.kernel.org,
linux-kernel@...r.kernel.org, shangsong2@...ovo.com
Subject: Re: [PATCH v2 1/1] ACPI: PRM: Optimize the judgment logic for the PRM handler_address
On Tue, Aug 26, 2025 at 5:02 AM Shang song (Lenovo)
<shangsong2@...mail.com> wrote:
>
> If the handler_address or mapped VA is NULL, the related buffer
> address and VA can be ignored.
>
> Signed-off-by: Shang song (Lenovo) <shangsong2@...mail.com>
>
> Changes in v2: Demote pr_err to pr_info for incorrect handler_address.
> ---
> drivers/acpi/prmt.c | 19 ++++++++++++++++---
> 1 file changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/prmt.c b/drivers/acpi/prmt.c
> index be033bbb126a..6792d4385eee 100644
> --- a/drivers/acpi/prmt.c
> +++ b/drivers/acpi/prmt.c
> @@ -150,15 +150,28 @@ acpi_parse_prmt(union acpi_subtable_headers *header, const unsigned long end)
> th = &tm->handlers[cur_handler];
>
> guid_copy(&th->guid, (guid_t *)handler_info->handler_guid);
> +
> + /*
> + * Print an error message if handler_address is NULL, the parse of VA also
> + * can be skipped.
> + */
> + if (unlikely(!handler_info->handler_address)) {
> + pr_info("Skipping handler with NULL address for GUID: %pUL",
> + (guid_t *)handler_info->handler_guid);
> + continue;
> + }
> +
> th->handler_addr =
> (void *)efi_pa_va_lookup(&th->guid, handler_info->handler_address);
> /*
> - * Print a warning message if handler_addr is zero which is not expected to
> - * ever happen.
> + * Print a warning message and skip the parse of VA if handler_addr is zero
> + * which is not expected to ever happen.
> */
> - if (unlikely(!th->handler_addr))
> + if (unlikely(!th->handler_addr)) {
> pr_warn("Failed to find VA of handler for GUID: %pUL, PA: 0x%llx",
> &th->guid, handler_info->handler_address);
> + continue;
> + }
>
> th->static_data_buffer_addr =
> efi_pa_va_lookup(&th->guid, handler_info->static_data_buffer_address);
> --
Applied as 6.18 material with edited subject and changelog, thanks!
Powered by blists - more mailing lists