ACPICA: acpi_ds_resolve_package_element: Use proper status when logging exception
Subsystems (2)
PATCH 1/2 ACPICA: acpi_ds_resolve_package_element: Use proper status when logging exception
Do not override the status which causes us to call acpi_exception with the status returned by the acpi_ns_externalize_name call we do to get a name to log.
Related: https://bugzilla.kernel.org/show_bug.cgi?id=198167
--- drivers/acpi/acpica/dspkginit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/acpi/acpica/dspkginit.c +3 -3
@@ -372,9 +372,9 @@ acpi_ds_resolve_package_element(union acpi_operand_object **element_ptr)ACPI_NS_SEARCH_PARENT |ACPI_NS_DONT_OPEN_SCOPE , NULL, &resolved_node);if (ACPI_FAILURE (status)) { - status =acpi_ns_externalize_name (ACPI_UINT32_MAX , - (char *)element->reference. - aml,NULL , &external_path); +acpi_ns_externalize_name (ACPI_UINT32_MAX , + (char *)element->reference.aml,NULL , + &external_path); ACPI_EXCEPTION((AE_INFO, status, "Could not find/resolve named package element: %s",
Signature · 1 line
2.14.3
PATCH 2/2 ACPICA: Log failing to find symbols in the tables as warnings
Many ACPI tables reference missing symbols, there is nothing the ACPICA code can do about this, nor can the user. Getting manufacturers to issue firmware updates to fix this is near impossible and even then most users never update their BIOS.
Logging AE_NOT_FOUND errors as warnings is important because many desktop and embedded applicance Linux use-cases have a hard requirement of not showing any (scary) text messages during system bootup, which get broken by logging these as errors.
This has been tested on an Asrock B150M Pro4S/D3, which throws similar errors as those reported in bko109511 and on an Asus T100HA, which throws similar errors as those reported in bko198167. "dmesg --level=err" is silent on both boards after this commit.
--- drivers/acpi/acpica/tbxfload.c | 2 +- drivers/acpi/acpica/uterror.c | 12 ++++++++++-- drivers/acpi/acpica/utxferror.c | 15 +++++++-------- 3 files changed, 18 insertions(+), 11 deletions(-)
drivers/acpi/acpica/tbxfload.c +1 -1
@@ -241,7 +241,7 @@ acpi_status acpi_tb_load_namespace(void)if (!tables_failed) {ACPI_INFO (("%u ACPI AML tables successfully acquired and loaded" , tables_loaded)); }else { -ACPI_ERROR ((AE_INFO , +ACPI_WARNING ((AE_INFO ,"%u table load failures, %u successful" , tables_failed, tables_loaded));
drivers/acpi/acpica/uterror.c +10 -2
@@ -205,7 +205,11 @@ acpi_ut_namespace_error(const char *module_name,char *name =NULL ;ACPI_MSG_REDIRECT_BEGIN ; -acpi_os_printf (ACPI_MSG_ERROR ); +/* Many ACPI tables reference missing symbols, log this as warnings */ +if (lookup_status ==AE_NOT_FOUND ) +acpi_os_printf (ACPI_MSG_WARNING ); +else +acpi_os_printf (ACPI_MSG_ERROR );if (lookup_status ==AE_BAD_CHARACTER ) {
@@ -269,7 +273,11 @@ acpi_ut_method_error(const char *module_name,struct acpi_namespace_node *node = prefix_node;ACPI_MSG_REDIRECT_BEGIN ; -acpi_os_printf (ACPI_MSG_ERROR ); +/* Many ACPI tables reference missing symbols, log this as warnings */ +if (method_status ==AE_NOT_FOUND ) +acpi_os_printf (ACPI_MSG_WARNING ); +else +acpi_os_printf (ACPI_MSG_ERROR );if (path) { status = acpi_ns_get_node(prefix_node, path,
drivers/acpi/acpica/utxferror.c +7 -8
@@ -107,16 +107,15 @@ acpi_exception(const char *module_name,va_list arg_list;ACPI_MSG_REDIRECT_BEGIN ; - -/* For AE_OK, just print the message */ - -if (ACPI_SUCCESS (status)) { +/* Many ACPI tables reference missing symbols, log this as warnings */ +if (status ==AE_NOT_FOUND ) +acpi_os_printf (ACPI_MSG_WARNING ); +else acpi_os_printf (ACPI_MSG_EXCEPTION ); - }else { -acpi_os_printf (ACPI_MSG_EXCEPTION "%s, " , -acpi_format_exception (status)); - } +/* For failures append the formatted exception */ +if (ACPI_FAILURE (status)) +acpi_os_printf ("%s, " ,acpi_format_exception (status));va_start (arg_list, format);acpi_os_vprintf (format, arg_list);
Signature · 1 line
2.14.3
Moore
We are working on this file right now, thanks.
Bob
Quoted 41 lines
-----Original Message-----
From: Hans de Goede [mailto:hdegoede(a)redhat.com]
Sent: Friday, January 12, 2018 3:37 AM
To: Len Brown <lenb(a)kernel.org>; Moore, Robert <robert.moore(a)intel.com>; Zheng, Lv <lv.zheng(a)intel.com>
Cc: Hans de Goede <hdegoede(a)redhat.com>; linux-acpi(a)vger.kernel.org; devel(a)acpica.org
Subject: [PATCH 1/2] ACPICA:acpi_ds_resolve_package_element: Use proper status when logging exceptionDo not override the status which causes us to call
acpi_exceptionwith the status returned by theacpi_ns_externalize_namecall we do to get a name to log.Related: https://bugzilla.kernel.org/show_bug.cgi?id=198167
Signed-off-by: Hans de Goede <hdegoede(a)redhat.com>--- drivers/acpi/acpica/dspkginit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)(quoted diff) +0
-0
b/drivers/acpi/acpica/dspkginit.cindex6d487edfe2de..cddbbed2f344100644drivers/acpi/acpica/dspkginit.c +3
-3@@ -372,9 +372,9 @@ acpi_ds_resolve_package_element(union acpi_operand_object **element_ptr) ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL, &resolved_node);if (ACPI_FAILURE (status)) { - status =acpi_ns_externalize_name (ACPI_UINT32_MAX , - (char *)element->reference. - aml,NULL , &external_path); +acpi_ns_externalize_name (ACPI_UINT32_MAX , + (char *)element->reference.aml,NULL , + &external_path); ACPI_EXCEPTION((AE_INFO, status,"Could not find/resolve named package element: %s",
--
2.14.3