From patchwork Thu May 7 09:09:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 194224 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04EEEC54E4B for ; Thu, 7 May 2020 09:16:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E36702075E for ; Thu, 7 May 2020 09:16:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726235AbgEGJQM (ORCPT ); Thu, 7 May 2020 05:16:12 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:36736 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726007AbgEGJQM (ORCPT ); Thu, 7 May 2020 05:16:12 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 7689028CC491182D81A4; Thu, 7 May 2020 17:16:06 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Thu, 7 May 2020 17:15:58 +0800 From: Hanjun Guo To: "Rafael J. Wysocki" CC: James Morse , Tony Luck , Borislav Petkov , , Hanjun Guo Subject: [PATCH 1/9] ACPI: LPIT: Put the low power idle table after using it Date: Thu, 7 May 2020 17:09:13 +0800 Message-ID: <1588842561-32907-2-git-send-email-guohanjun@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1588842561-32907-1-git-send-email-guohanjun@huawei.com> References: <1588842561-32907-1-git-send-email-guohanjun@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The mapped LPIT table is not used for runtime after init, put the ACPI table to release the table mapping. Signed-off-by: Hanjun Guo --- drivers/acpi/acpi_lpit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/acpi_lpit.c b/drivers/acpi/acpi_lpit.c index 953437a..48e5059 100644 --- a/drivers/acpi/acpi_lpit.c +++ b/drivers/acpi/acpi_lpit.c @@ -151,10 +151,11 @@ void acpi_init_lpit(void) struct acpi_table_lpit *lpit; status = acpi_get_table(ACPI_SIG_LPIT, 0, (struct acpi_table_header **)&lpit); - if (ACPI_FAILURE(status)) return; lpit_process((u64)lpit + sizeof(*lpit), (u64)lpit + lpit->header.length); + + acpi_put_table((struct acpi_table_header *)lpit); } From patchwork Thu May 7 09:09:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 194225 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80F35C47257 for ; Thu, 7 May 2020 09:16:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 626C721582 for ; Thu, 7 May 2020 09:16:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725985AbgEGJQK (ORCPT ); Thu, 7 May 2020 05:16:10 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:36626 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725939AbgEGJQK (ORCPT ); Thu, 7 May 2020 05:16:10 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 64C4CA3A8AEB6D954CDB; Thu, 7 May 2020 17:16:06 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Thu, 7 May 2020 17:16:00 +0800 From: Hanjun Guo To: "Rafael J. Wysocki" CC: James Morse , Tony Luck , Borislav Petkov , , Hanjun Guo Subject: [PATCH 4/9] ACPI: APEI: Put the error injection table for error path and module exit Date: Thu, 7 May 2020 17:09:16 +0800 Message-ID: <1588842561-32907-5-git-send-email-guohanjun@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1588842561-32907-1-git-send-email-guohanjun@huawei.com> References: <1588842561-32907-1-git-send-email-guohanjun@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The mapped error injection table will be used after einj_init() for debugfs, but it should be released for module exit and error path of einj_init(). Signed-off-by: Hanjun Guo --- drivers/acpi/apei/einj.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c index 086373f..13315675 100644 --- a/drivers/acpi/apei/einj.c +++ b/drivers/acpi/apei/einj.c @@ -692,7 +692,7 @@ static int __init einj_init(void) rc = einj_check_table(einj_tab); if (rc) { pr_warn(FW_BUG "Invalid EINJ table.\n"); - return -EINVAL; + goto err_put_table; } rc = -ENOMEM; @@ -760,6 +760,8 @@ static int __init einj_init(void) err_fini: apei_resources_fini(&einj_resources); debugfs_remove_recursive(einj_debug_dir); +err_put_table: + acpi_put_table((struct acpi_table_header *)einj_tab); return rc; } @@ -780,6 +782,7 @@ static void __exit einj_exit(void) apei_resources_release(&einj_resources); apei_resources_fini(&einj_resources); debugfs_remove_recursive(einj_debug_dir); + acpi_put_table((struct acpi_table_header *)einj_tab); } module_init(einj_init); From patchwork Thu May 7 09:09:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 194223 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAA22C54E4A for ; Thu, 7 May 2020 09:16:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA8372084D for ; Thu, 7 May 2020 09:16:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726382AbgEGJQN (ORCPT ); Thu, 7 May 2020 05:16:13 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:56380 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726029AbgEGJQN (ORCPT ); Thu, 7 May 2020 05:16:13 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 71965FDA446C35BDA24E; Thu, 7 May 2020 17:16:11 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Thu, 7 May 2020 17:16:02 +0800 From: Hanjun Guo To: "Rafael J. Wysocki" CC: James Morse , Tony Luck , Borislav Petkov , , Hanjun Guo Subject: [PATCH 8/9] ACPI: scan: Put SPCR and STAO table after using it Date: Thu, 7 May 2020 17:09:20 +0800 Message-ID: <1588842561-32907-9-git-send-email-guohanjun@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1588842561-32907-1-git-send-email-guohanjun@huawei.com> References: <1588842561-32907-1-git-send-email-guohanjun@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The SPCR and STAO table needs to be released after using it. Signed-off-by: Hanjun Guo --- drivers/acpi/scan.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 6d34488..5287ab9 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -2157,10 +2157,13 @@ static void __init acpi_get_spcr_uart_addr(void) status = acpi_get_table(ACPI_SIG_SPCR, 0, (struct acpi_table_header **)&spcr_ptr); - if (ACPI_SUCCESS(status)) - spcr_uart_addr = spcr_ptr->serial_port.address; - else - printk(KERN_WARNING PREFIX "STAO table present, but SPCR is missing\n"); + if (ACPI_FAILURE(status)) { + pr_warn(PREFIX "STAO table present, but SPCR is missing\n"); + return; + } + + spcr_uart_addr = spcr_ptr->serial_port.address; + acpi_put_table((struct acpi_table_header *)spcr_ptr); } static bool acpi_scan_initialized; @@ -2196,10 +2199,12 @@ int __init acpi_scan_init(void) (struct acpi_table_header **)&stao_ptr); if (ACPI_SUCCESS(status)) { if (stao_ptr->header.length > sizeof(struct acpi_table_stao)) - printk(KERN_INFO PREFIX "STAO Name List not yet supported."); + pr_info(PREFIX "STAO Name List not yet supported.\n"); if (stao_ptr->ignore_uart) acpi_get_spcr_uart_addr(); + + acpi_put_table((struct acpi_table_header *)stao_ptr); } acpi_gpe_apply_masked_gpes(); From patchwork Thu May 7 09:09:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 194222 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6164FC54E7E for ; Thu, 7 May 2020 09:16:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4ADC42075E for ; Thu, 7 May 2020 09:16:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725948AbgEGJQO (ORCPT ); Thu, 7 May 2020 05:16:14 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3836 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726367AbgEGJQO (ORCPT ); Thu, 7 May 2020 05:16:14 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 5C1DD8683BFED22DDEDE; Thu, 7 May 2020 17:16:11 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Thu, 7 May 2020 17:16:02 +0800 From: Hanjun Guo To: "Rafael J. Wysocki" CC: James Morse , Tony Luck , Borislav Petkov , , Hanjun Guo Subject: [PATCH 9/9] ACPI: sleep: Put the FACS table after using it Date: Thu, 7 May 2020 17:09:21 +0800 Message-ID: <1588842561-32907-10-git-send-email-guohanjun@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1588842561-32907-1-git-send-email-guohanjun@huawei.com> References: <1588842561-32907-1-git-send-email-guohanjun@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Put the FACS table after using it to release the table mapping. Signed-off-by: Hanjun Guo --- drivers/acpi/sleep.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 4edc8a3..30e2df9 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -1297,8 +1297,10 @@ static void acpi_sleep_hibernate_setup(void) return; acpi_get_table(ACPI_SIG_FACS, 1, (struct acpi_table_header **)&facs); - if (facs) + if (facs) { s4_hardware_signature = facs->hardware_signature; + acpi_put_table((struct acpi_table_header *)facs); + } } #else /* !CONFIG_HIBERNATION */ static inline void acpi_sleep_hibernate_setup(void) {}