From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757039AbcK3HWE (ORCPT ); Wed, 30 Nov 2016 02:22:04 -0500 Received: from mga01.intel.com ([192.55.52.88]:9706 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756753AbcK3HVr (ORCPT ); Wed, 30 Nov 2016 02:21:47 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,720,1473145200"; d="scan'208";a="1092455076" From: Lv Zheng To: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Len Brown Cc: Lv Zheng , Lv Zheng , , linux-acpi@vger.kernel.org, Bob Moore Subject: [PATCH 07/11] ACPICA: Tables: Add an error message complaining driver bugs Date: Wed, 30 Nov 2016 15:21:34 +0800 Message-Id: X-Mailer: git-send-email 1.7.10 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ACPICA commit 68af3c3aa238dd8040e846ac6b4827a016434d8d During early OS boot stage, drivers that have mapped system memory should unmap it during the same stage. Linux kernel has an error message indicating the unbalanced early memory mappings. This patch back ports such error message into ACPICA for the early table mappings, so that ACPICA development environment is also aware of this OS specific requirement and thus is able to ensure the consistent quality locally. Lv Zheng. Link: https://github.com/acpica/acpica/commit/68af3c3a Signed-off-by: Lv Zheng Signed-off-by: Bob Moore --- drivers/acpi/acpica/tbxface.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c index 4ab6b9c..d5adb7a 100644 --- a/drivers/acpi/acpica/tbxface.c +++ b/drivers/acpi/acpica/tbxface.c @@ -167,6 +167,7 @@ acpi_status acpi_allocate_root_table(u32 initial_table_count) acpi_status ACPI_INIT_FUNCTION acpi_reallocate_root_table(void) { acpi_status status; + u32 i; ACPI_FUNCTION_TRACE(acpi_reallocate_root_table); @@ -178,6 +179,21 @@ acpi_status ACPI_INIT_FUNCTION acpi_reallocate_root_table(void) return_ACPI_STATUS(AE_SUPPORT); } + /* + * Ensure OS early boot logic, which is required by some hosts. If the + * table state is reported to be wrong, developers should fix the + * issue by invoking acpi_put_table() for the reported table during the + * early stage. + */ + for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) { + if (acpi_gbl_root_table_list.tables[i].pointer) { + ACPI_ERROR((AE_INFO, + "Table [%4.4s] is not invalidated during early boot stage", + acpi_gbl_root_table_list.tables[i]. + signature.ascii)); + } + } + acpi_gbl_root_table_list.flags |= ACPI_ROOT_ALLOW_RESIZE; status = acpi_tb_resize_root_table_list(); -- 1.7.10