Skip to content

Commit 959c38a

Browse files
acpibobrafaeljw
authored andcommitted
ACPICA: Add option to disable Package object name resolution errors
ACPICA commit a6c3c725c44dd44ad9d3f2b2a64351fdbe6e0014 For the kernel-resident ACPICA, optionally be silent about the NOT_FOUND case. Although this is potentially a serious problem, it can generate a lot of noise/errors on platforms whose firmware carries around a bunch of unused Package objects. To disable these errors, define ACPI_IGNORE_PACKAGE_RESOLUTION_ERRORS in the OS-specific header. Link: https://bugzilla.kernel.org/show_bug.cgi?id=198167 Link: acpica/acpica@a6c3c725 Signed-off-by: Bob Moore <[email protected]> Signed-off-by: Erik Schmauss <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 5a8361f commit 959c38a

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

drivers/acpi/acpica/dspkginit.c

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,12 @@ static void
389389
acpi_ds_resolve_package_element(union acpi_operand_object **element_ptr)
390390
{
391391
acpi_status status;
392+
acpi_status status2;
392393
union acpi_generic_state scope_info;
393394
union acpi_operand_object *element = *element_ptr;
394395
struct acpi_namespace_node *resolved_node;
395396
struct acpi_namespace_node *original_node;
396-
char *external_path = NULL;
397+
char *external_path = "";
397398
acpi_object_type type;
398399

399400
ACPI_FUNCTION_TRACE(ds_resolve_package_element);
@@ -417,17 +418,40 @@ acpi_ds_resolve_package_element(union acpi_operand_object **element_ptr)
417418
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
418419
NULL, &resolved_node);
419420
if (ACPI_FAILURE(status)) {
420-
status = acpi_ns_externalize_name(ACPI_UINT32_MAX,
421-
(char *)element->reference.
422-
aml, NULL, &external_path);
421+
#if defined ACPI_IGNORE_PACKAGE_RESOLUTION_ERRORS && !defined ACPI_APPLICATION
422+
/*
423+
* For the kernel-resident ACPICA, optionally be silent about the
424+
* NOT_FOUND case. Although this is potentially a serious problem,
425+
* it can generate a lot of noise/errors on platforms whose
426+
* firmware carries around a bunch of unused Package objects.
427+
* To disable these errors, define ACPI_IGNORE_PACKAGE_RESOLUTION_ERRORS
428+
* in the OS-specific header.
429+
*
430+
* All errors are always reported for ACPICA applications such as
431+
* acpi_exec.
432+
*/
433+
if (status == AE_NOT_FOUND) {
434+
435+
/* Reference name not found, set the element to NULL */
436+
437+
acpi_ut_remove_reference(*element_ptr);
438+
*element_ptr = NULL;
439+
return_VOID;
440+
}
441+
#endif
442+
status2 = acpi_ns_externalize_name(ACPI_UINT32_MAX,
443+
(char *)element->reference.
444+
aml, NULL, &external_path);
423445

424446
ACPI_EXCEPTION((AE_INFO, status,
425-
"Could not find/resolve named package element: %s",
447+
"While resolving a named reference package element - %s",
426448
external_path));
449+
if (ACPI_SUCCESS(status2)) {
450+
ACPI_FREE(external_path);
451+
}
427452

428-
/* Not found, set the element to NULL */
453+
/* Could not resolve name, set the element to NULL */
429454

430-
ACPI_FREE(external_path);
431455
acpi_ut_remove_reference(*element_ptr);
432456
*element_ptr = NULL;
433457
return_VOID;

include/acpi/platform/aclinux.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858

5959
#define ACPI_USE_SYSTEM_CLIBRARY
6060
#define ACPI_USE_DO_WHILE_0
61+
#define ACPI_IGNORE_PACKAGE_RESOLUTION_ERRORS
6162

6263
#ifdef __KERNEL__
6364

0 commit comments

Comments
 (0)