From patchwork Wed Mar 1 10:36:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 9598219 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6FC1860453 for ; Wed, 1 Mar 2017 10:55:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82EF02842B for ; Wed, 1 Mar 2017 10:55:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7770B284F5; Wed, 1 Mar 2017 10:55:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 522992842B for ; Wed, 1 Mar 2017 10:55:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752660AbdCAKzV (ORCPT ); Wed, 1 Mar 2017 05:55:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45408 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752147AbdCAKzU (ORCPT ); Wed, 1 Mar 2017 05:55:20 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3827E13AA1; Wed, 1 Mar 2017 10:36:57 +0000 (UTC) Received: from shalem.localdomain.com (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4EC615A80; Wed, 1 Mar 2017 10:36:55 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" , Len Brown , Robert Moore , Lv Zheng Cc: Hans de Goede , linux-acpi@vger.kernel.org, devel@acpica.org Subject: [PATCH] ACPICA: Log Exceptions and Errors as warning while loading extra tables Date: Wed, 1 Mar 2017 11:36:53 +0100 Message-Id: <20170301103653.2296-1-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 01 Mar 2017 10:36:57 +0000 (UTC) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Honor the "Ignore errors while loading tables, get as many as possible" comment in the tbxfload.c code and log any exceptions and errors during loading extra tables as warnings. This 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 errors reported by attempts to load the extra tables, as messaged logged at a KERN_ERR level are always shown even if the quiet kernel cmdline option is used. Signed-off-by: Hans de Goede --- drivers/acpi/acpica/acglobal.h | 1 + drivers/acpi/acpica/tbxfload.c | 4 +++- drivers/acpi/acpica/uterror.c | 10 ++++++++-- drivers/acpi/acpica/utxferror.c | 19 ++++++++++--------- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h index edbb42e..5ae9eee 100644 --- a/drivers/acpi/acpica/acglobal.h +++ b/drivers/acpi/acpica/acglobal.h @@ -146,6 +146,7 @@ ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_operand_cache); ACPI_INIT_GLOBAL(u32, acpi_gbl_startup_flags, 0); ACPI_INIT_GLOBAL(u8, acpi_gbl_shutdown, TRUE); ACPI_INIT_GLOBAL(u8, acpi_gbl_early_initialization, TRUE); +ACPI_INIT_GLOBAL(u8, acpi_gbl_log_errors_exceptions_as_warnings, FALSE); /* Global handlers */ diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c index 1971cd7..b0c5478 100644 --- a/drivers/acpi/acpica/tbxfload.c +++ b/drivers/acpi/acpica/tbxfload.c @@ -256,6 +256,7 @@ acpi_status acpi_tb_load_namespace(void) } /* Ignore errors while loading tables, get as many as possible */ + acpi_gbl_log_errors_exceptions_as_warnings = TRUE; (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); status = acpi_ns_load_table(i, acpi_gbl_root_node); @@ -276,11 +277,12 @@ acpi_status acpi_tb_load_namespace(void) tables_loaded++; } } + acpi_gbl_log_errors_exceptions_as_warnings = FALSE; 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)); diff --git a/drivers/acpi/acpica/uterror.c b/drivers/acpi/acpica/uterror.c index 475932c..e01ff1f 100644 --- a/drivers/acpi/acpica/uterror.c +++ b/drivers/acpi/acpica/uterror.c @@ -205,7 +205,10 @@ acpi_ut_namespace_error(const char *module_name, char *name = NULL; ACPI_MSG_REDIRECT_BEGIN; - acpi_os_printf(ACPI_MSG_ERROR); + if (acpi_gbl_log_errors_exceptions_as_warnings) + acpi_os_printf(ACPI_MSG_WARNING); + else + acpi_os_printf(ACPI_MSG_ERROR); if (lookup_status == AE_BAD_CHARACTER) { @@ -269,7 +272,10 @@ 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); + if (acpi_gbl_log_errors_exceptions_as_warnings) + acpi_os_printf(ACPI_MSG_WARNING); + else + acpi_os_printf(ACPI_MSG_ERROR); if (path) { status = acpi_ns_get_node(prefix_node, path, diff --git a/drivers/acpi/acpica/utxferror.c b/drivers/acpi/acpica/utxferror.c index d9f15cb..c8ca25af 100644 --- a/drivers/acpi/acpica/utxferror.c +++ b/drivers/acpi/acpica/utxferror.c @@ -73,7 +73,10 @@ acpi_error(const char *module_name, u32 line_number, const char *format, ...) va_list arg_list; ACPI_MSG_REDIRECT_BEGIN; - acpi_os_printf(ACPI_MSG_ERROR); + if (acpi_gbl_log_errors_exceptions_as_warnings) + acpi_os_printf(ACPI_MSG_WARNING); + else + acpi_os_printf(ACPI_MSG_ERROR); va_start(arg_list, format); acpi_os_vprintf(format, arg_list); @@ -107,16 +110,14 @@ 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)) { + if (acpi_gbl_log_errors_exceptions_as_warnings) + 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 AE_OK, just print the message */ + if (ACPI_FAILURE(status)) + acpi_os_printf("%s, ", acpi_format_exception(status)); va_start(arg_list, format); acpi_os_vprintf(format, arg_list);