ACPI:PRM: Reduce unnecessary printing to avoid the worries of regular users
PATCH v4 1/1 ACPI:PRM: Reduce unnecessary printing to avoid the worries of regular users
Commit 088984c8d54c ("ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM handler and context") introduces non-essential printing "Failed to find VA for GUID: xxxx, PA: 0x0" which causes unnecessary worry for regular users.
Refer to PRM Spec Section 4.1.2[1], both static data buffer address and ACPI parameter buffer address may be NULL if they are not needed. So there is no need to print out "Failed to find VA ... " to intimidate regular users.
---
Previous versions can be found at:
v1: https://lore.kernel.org/linux-acpi/CAJZ5v0hv0WKd-SXFhUgYs-Zpc+-PsSNOBu0r7L5TzJWgddtsKA@mail.gmail.com/t/#u
v2: https://lore.kernel.org/linux-acpi/[email protected]/#r
v3: https://lore.kernel.org/linux-acpi/[email protected]/t/#u
Changes in v2:
- Reduce the code changes.
Changes in v3:
- Fixed title letters not showing.
Changes in v4:
- Only print the necessary warnings.
drivers/acpi/prmt.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/acpi/prmt.c +9 -2
@@ -85,8 +85,6 @@ static u64 efi_pa_va_lookup(efi_guid_t *guid, u64 pa) } } -pr_warn ("Failed to find VA for GUID: %pUL, PA: 0x%llx" , guid, pa); -return 0 ; }
@@ -154,6 +152,15 @@ acpi_parse_prmt(union acpi_subtable_headers *header, const unsigned long end)guid_copy (&th->guid, (guid_t *)handler_info->handler_guid); th->handler_addr = (void *)efi_pa_va_lookup (&th->guid, handler_info->handler_address); +/* +* Refer to PRM Spec, both static data buffer address and +* ACPI parameter buffer address may be NULL if they are not +* needed. So there only print out warning if handler address +* is zero. +*/ +if (!th->handler_addr) +pr_warn ("Failed to find VA for GUID: %pUL, PA: 0x%llx" , + &th->guid, handler_info->handler_address); th->static_data_buffer_addr =efi_pa_va_lookup (&th->guid, handler_info->static_data_buffer_address);
base-commit: 82f2b0b97b36ee3fcddf0f0780a9a0825d52fec3
Signature · 1 line
2.43.0
Rafael J. Wysocki
maintainerQuoted 47 lines · Zhu Qiyu
Commit
088984c8d54c("ACPI: PRM: FindEFI_MEMORY_RUNTIMEblock for PRM handler and context") introduces non-essential printing "Failed to find VA for GUID: xxxx, PA:0x0" which causes unnecessary worry for regular users.Refer to PRM Spec Section 4.1.2[1], both static data buffer address and ACPI parameter buffer address may be NULL if they are not needed. So there is no need to print out "Failed to find VA ... " to intimidate regular users.
Signed-off-by Zhu Qiyu <[email protected]>---
Previous versions can be found at:
v1: https://lore.kernel.org/linux-acpi/CAJZ5v0hv0WKd-SXFhUgYs-Zpc+-PsSNOBu0r7L5TzJWgddtsKA@mail.gmail.com/t/#u
v2: https://lore.kernel.org/linux-acpi/[email protected]/#r
v3: https://lore.kernel.org/linux-acpi/[email protected]/t/#uChanges in v2:
- Reduce the code changes.
Changes in v3:
- Fixed title letters not showing.
Changes in v4:
- Only print the necessary warnings.drivers/acpi/prmt.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)drivers/acpi/prmt.c +0
-2@@ -85,8 +85,6 @@ static u64 efi_pa_va_lookup(efi_guid_t *guid, u64 pa) } } -pr_warn ("Failed to find VA for GUID: %pUL, PA: 0x%llx" , guid, pa); -return 0 ; }@@ -154,6 +152,15 @@ acpi_parse_prmt(union acpi_subtable_headers *header, const unsigned long end)guid_copy (&th->guid, (guid_t *)handler_info->handler_guid); th->handler_addr =
drivers/acpi/prmt.c acpi_parse_prmt(union acpi_subtable_headers *header, const unsigned long end) · line 163
Quoted 10 lines
drivers/acpi/prmt.c +9
-0(void *)efi_pa_va_lookup (&th->guid, handler_info->handler_address); +/* +* Refer to PRM Spec, both static data buffer address and +* ACPI parameter buffer address may be NULL if they are not +* needed. So there only print out warning if handler address +* is zero. +*/ +if (!th->handler_addr) +pr_warn ("Failed to find VA for GUID: %pUL, PA: 0x%llx" , + &th->guid, handler_info->handler_address);
I think that the message should still be printed in the other cases if the physical address passed to efi_pa_va_lookup() is nonzero and the lookup fails.
Quoted 6 lines
drivers/acpi/prmt.c +0
-0th->static_data_buffer_addr =efi_pa_va_lookup (&th->guid, handler_info->static_data_buffer_address);base-commit:
82f2b0b97b36ee3fcddf0f0780a9a0825d52fec3--
Hi,Rafael
Thanks for the review, and your consideration is correct. Patch v5 has been sent, please review, thanks!
https://lore.kernel.org/linux-acpi/[email protected]/T/#u
Qiyu