From patchwork Tue Jun 26 17:01:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 10489677 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 7A1D560386 for ; Tue, 26 Jun 2018 17:04:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6539C1FE82 for ; Tue, 26 Jun 2018 17:04:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5928A25D99; Tue, 26 Jun 2018 17:04:51 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F1A6D1FE82 for ; Tue, 26 Jun 2018 17:04:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=TrEcxarlasbY6u1HUn4XG3OlQpQ29pa36Rn95Ua30ms=; b=Jc/oqauWha+p3YBipq7bFlvRFO FjJw6Ixoh5pHL/EKqn8zfKUYCtqNajxO8CVul1X/IP+lgk7KvjpIG9w1GNho4dO7k1pUvewkv4YQN EVnPeZRPR2v/ikZ8kcZ38NwCE4WEvHCBaVIXmPjyMO9C7gZ7JGnK1aMHULSqpiHgauxSvkQvxm8Dl 7S7MVHUgSC5YIWkC/8R/JJOOL3fznB7+7FTtig9LoPVt4Z+o+UBgRvf6mbOxxKyaSrQEFeiS6KbDE wNs7GgOhSYK2oIYtRBpkveC/UTiJ6YyoU6yb8ZqSDmY9tqIkas+fHmnJ75VbSKPCQkMhLvKTDxtsM NCPu2CSA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXrON-0001g7-1W; Tue, 26 Jun 2018 17:04:35 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXrM5-0000RC-9B for linux-arm-kernel@lists.infradead.org; Tue, 26 Jun 2018 17:02:27 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 327257A9; Tue, 26 Jun 2018 10:02:11 -0700 (PDT) Received: from melchizedek.cambridge.arm.com (melchizedek.cambridge.arm.com [10.1.206.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1E01A3F318; Tue, 26 Jun 2018 10:02:07 -0700 (PDT) From: James Morse To: linux-acpi@vger.kernel.org Subject: [PATCH v5 05/20] ACPI / APEI: Make estatus queue a Kconfig symbol Date: Tue, 26 Jun 2018 18:01:01 +0100 Message-Id: <20180626170116.25825-6-james.morse@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180626170116.25825-1-james.morse@arm.com> References: <20180626170116.25825-1-james.morse@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180626_100213_362925_F3369487 X-CRM114-Status: GOOD ( 14.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jonathan.zhang@cavium.com, Rafael Wysocki , Tony Luck , Punit Agrawal , Xie XiuQi , Marc Zyngier , Catalin Marinas , Tyler Baicar , Will Deacon , Christoffer Dall , Dongjiu Geng , linux-mm@kvack.org, Borislav Petkov , James Morse , Naoya Horiguchi , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, Len Brown MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Now that there are two users of the estatus queue, and likely to be more, make it a Kconfig symbol selected by the appropriate notification. We can move the ARCH_HAVE_NMI_SAFE_CMPXCHG checks in here too. Signed-off-by: James Morse --- drivers/acpi/apei/Kconfig | 6 ++++++ drivers/acpi/apei/ghes.c | 12 +++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/acpi/apei/Kconfig b/drivers/acpi/apei/Kconfig index 52ae5438edeb..2b191e09b647 100644 --- a/drivers/acpi/apei/Kconfig +++ b/drivers/acpi/apei/Kconfig @@ -4,6 +4,7 @@ config HAVE_ACPI_APEI config HAVE_ACPI_APEI_NMI bool + select ACPI_APEI_GHES_ESTATUS_QUEUE config ACPI_APEI bool "ACPI Platform Error Interface (APEI)" @@ -33,6 +34,10 @@ config ACPI_APEI_GHES by firmware to produce more valuable hardware error information for Linux. +config ACPI_APEI_GHES_ESTATUS_QUEUE + bool + depends on ACPI_APEI_GHES && ARCH_HAVE_NMI_SAFE_CMPXCHG + config ACPI_APEI_PCIEAER bool "APEI PCIe AER logging/recovering support" depends on ACPI_APEI && PCIEAER @@ -43,6 +48,7 @@ config ACPI_APEI_PCIEAER config ACPI_APEI_SEA bool "APEI Synchronous External Abort logging/recovering support" depends on ARM64 && ACPI_APEI_GHES + select ACPI_APEI_GHES_ESTATUS_QUEUE default y help This option should be enabled if the system supports diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 150fb184c7cb..2880547e13b8 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -58,10 +58,6 @@ #define GHES_PFX "GHES: " -#if defined(CONFIG_HAVE_ACPI_APEI_NMI) || defined(CONFIG_ACPI_APEI_SEA) -#define WANT_NMI_ESTATUS_QUEUE 1 -#endif - #define GHES_ESTATUS_MAX_SIZE 65536 #define GHES_ESOURCE_PREALLOC_MAX_SIZE 65536 @@ -685,7 +681,7 @@ static void ghes_estatus_cache_add( rcu_read_unlock(); } -#ifdef WANT_NMI_ESTATUS_QUEUE +#ifdef CONFIG_ACPI_APEI_GHES_ESTATUS_QUEUE /* * Handlers for CPER records may not be NMI safe. For example, * memory_failure_queue() takes spinlocks and calls schedule_work_on(). @@ -727,7 +723,6 @@ static void ghes_print_queued_estatus(void) /* Save estatus for further processing in IRQ context */ static void __process_error(struct ghes *ghes) { -#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG u32 len, node_len; struct ghes_estatus_node *estatus_node; struct acpi_hest_generic_status *estatus; @@ -747,7 +742,6 @@ static void __process_error(struct ghes *ghes) estatus = GHES_ESTATUS_FROM_NODE(estatus_node); memcpy(estatus, ghes->estatus, len); llist_add(&estatus_node->llnode, &ghes_estatus_llist); -#endif } static int _in_nmi_notify_one(struct ghes *ghes) @@ -786,7 +780,7 @@ static int ghes_estatus_queue_notified(struct list_head *rcu_list) } rcu_read_unlock(); - if (IS_ENABLED(CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG) && !ret) + if (!ret) irq_work_queue(&ghes_proc_irq_work); return ret; @@ -865,7 +859,7 @@ static void ghes_nmi_init_cxt(void) #else static inline void ghes_nmi_init_cxt(void) { } -#endif /* WANT_NMI_ESTATUS_QUEUE */ +#endif /* CONFIG_ACPI_APEI_GHES_ESTATUS_QUEUE */ static int ghes_ack_error(struct acpi_hest_generic_v2 *gv2) {