From patchwork Wed Apr 9 15:14:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 3956211 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 70217BFF02 for ; Wed, 9 Apr 2014 15:15:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9CAE3205D6 for ; Wed, 9 Apr 2014 15:15:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CEBDD205CD for ; Wed, 9 Apr 2014 15:15:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964866AbaDIPPV (ORCPT ); Wed, 9 Apr 2014 11:15:21 -0400 Received: from mail-ee0-f54.google.com ([74.125.83.54]:45472 "EHLO mail-ee0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933902AbaDIPO2 (ORCPT ); Wed, 9 Apr 2014 11:14:28 -0400 Received: by mail-ee0-f54.google.com with SMTP id d49so2058765eek.27 for ; Wed, 09 Apr 2014 08:14:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pTf3xFLfqxgLI0PPUIaDFzJGspUUOt5/8DsBjF6TiKg=; b=SvDOlln/T67bkUGsP/CF8YE3vaCqrd1FpWcOjPeHHeqVGtNqxvCm9LGazuZZiPivs4 S22KA4qoemYJNAvTPN7gZ/o+R+Uc6H+SwGTvWaD8JlwryW76RnKVPBq1ZwMi1jVMdM9Y 2LabslY3siA+Epom74DUQFfYkooQsRbytdwGjRIziGnbPC2+zz1m82TrFmpl6DF2UpYg m+t8v7v1HKwjYrTY5qBlZnbxU37s1N9qFhnpokpOSKSrXqjkniD3b/WdvQk6gPr1wOew X/H/kWBA42GFedP9ew8fDNIq+NuaFV0K3U0BftXnIkc/G9Pd620FoFfXG6Fl63nMIXNL n9OA== X-Gm-Message-State: ALoCoQm4TXQiig7SAN/SJN70QQ9C7od2bPE4SL+XLc8k+vEtiVC+g0kyqhcSnzgX+mreM94L04a6 X-Received: by 10.15.35.66 with SMTP id f42mr672497eev.93.1397056466773; Wed, 09 Apr 2014 08:14:26 -0700 (PDT) Received: from tn-HP3-PC.semihalf.com ([80.82.22.190]) by mx.google.com with ESMTPSA id x46sm2326082een.17.2014.04.09.08.14.25 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 09 Apr 2014 08:14:26 -0700 (PDT) From: Tomasz Nowicki To: rjw@rjwysocki.net, lenb@kernel.org, tony.luck@intel.com, bp@alien8.de, bp@suse.de, m.chehab@samsung.com Cc: linux-edac@vger.kernel.org, x86@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, Tomasz Nowicki Subject: [PATCH 5/7] acpi, apei, ghes: Attach NMI init/deinit functions while CONFIG_ACPI_APEI_NMI is enabled. Date: Wed, 9 Apr 2014 17:14:33 +0200 Message-Id: <1397056476-9183-6-git-send-email-tomasz.nowicki@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1397056476-9183-1-git-send-email-tomasz.nowicki@linaro.org> References: <1397056476-9183-1-git-send-email-tomasz.nowicki@linaro.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Thanks to more generic way of init/deinit error notification, we can register NMI related calls in runtime. It happens before walking through GHES entries, so probe function will treat NMI as supported. Signed-off-by: Tomasz Nowicki --- drivers/acpi/apei/ghes.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 7a0d66e..aaf8db3 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -906,7 +906,6 @@ static void ghes_estatus_pool_shrink(unsigned long len) { ghes_estatus_pool_size_request -= PAGE_ALIGN(len); } -#endif static int ghes_notify_init_nmi(struct ghes *ghes) { @@ -941,6 +940,20 @@ static void ghes_notify_remove_nmi(struct ghes *ghes) ghes_estatus_pool_shrink(len); } +static void ghes_init_nmi(void) +{ + init_irq_work(&ghes_proc_irq_work, ghes_proc_in_irq); + ghes_notify_tab[ACPI_HEST_NOTIFY_NMI].init_call = ghes_notify_init_nmi; + ghes_notify_tab[ACPI_HEST_NOTIFY_NMI].remove_call = ghes_notify_remove_nmi; + +} +#else +inline static void ghes_init_nmi(void) +{ + +} +#endif + static int ghes_notify_init_polled(struct ghes *ghes) { ghes->timer.function = ghes_poll_func; @@ -1018,9 +1031,7 @@ static struct ghes_notify_setup [ACPI_HEST_NOTIFY_SCI] = {"SCI", ghes_notify_init_sci, ghes_notify_remove_sci}, - [ACPI_HEST_NOTIFY_NMI] = {"NMI", - ghes_notify_init_nmi, - ghes_notify_remove_nmi}, + [ACPI_HEST_NOTIFY_NMI] = {"NMI", NULL, NULL}, [ACPI_HEST_NOTIFY_CMCI] = {"CMCI", NULL, NULL}, [ACPI_HEST_NOTIFY_MCE] = {"MCE", NULL, NULL}, }; @@ -1141,7 +1152,7 @@ static int __init ghes_init(void) return -EINVAL; } - init_irq_work(&ghes_proc_irq_work, ghes_proc_in_irq); + ghes_init_nmi(); rc = ghes_ioremap_init(); if (rc)