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: 28094 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 664AC2145A for ; Wed, 9 Apr 2014 15:15:02 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id rd18sf11593288iec.4 for ; Wed, 09 Apr 2014 08:15:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=qopVdNG9swywfmrSCBRGdxCwAOb9tp/4HcJ2Q2uH2Ds=; b=XWwMNp5W/ImvkXgs8GGT0dh7y58YwfzYLtH/vdh361b1n5T96YDBkPho79qaNwiQeT 11rBhhaapcX5Ktpmr2KKVCGlpB4sh8cNLz76VzsCan2/n9lvGdzt66Gd/MvC+/bYIJdY Fc9Jf/8WZjUF2Kjl5S79FOHwOt1360j8DEhtT+wSVWWu5jbBxwMqLXwBgNjRAWtK48Od zUWSwpwGGcKLZm+/85pboV0X0GFR4dNRGhv/IWm0PPWNIQeOnyV9WUW0E+ciFj740nuv WqBNBTkQ0PzmbSX4NlCro+HwOGOAQVT2pog3HaREHHo/gP5fFGC/v4q6NtW3/e1+9dHd 5J0g== X-Gm-Message-State: ALoCoQmjD3JpzmLQPpr+F4a5iqbsnW4Z1ZJ6o65aVeJ23YXeyQP/MpPFL0+Cva42HEA7cXyZCPIH X-Received: by 10.43.135.4 with SMTP id ie4mr4586890icc.1.1397056502213; Wed, 09 Apr 2014 08:15:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.105.100 with SMTP id b91ls760359qgf.26.gmail; Wed, 09 Apr 2014 08:15:02 -0700 (PDT) X-Received: by 10.52.128.231 with SMTP id nr7mr7832115vdb.17.1397056502083; Wed, 09 Apr 2014 08:15:02 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id mr9si186343vec.65.2014.04.09.08.15.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 09 Apr 2014 08:15:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id ij19so2264166vcb.10 for ; Wed, 09 Apr 2014 08:15:02 -0700 (PDT) X-Received: by 10.58.187.165 with SMTP id ft5mr1011838vec.47.1397056502000; Wed, 09 Apr 2014 08:15:02 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp338156vcv; Wed, 9 Apr 2014 08:15:01 -0700 (PDT) X-Received: by 10.68.197.99 with SMTP id it3mr12675748pbc.37.1397056501257; Wed, 09 Apr 2014 08:15:01 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j4si629389pad.104.2014.04.09.08.15.00; Wed, 09 Apr 2014 08:15:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964858AbaDIPOg (ORCPT + 27 others); Wed, 9 Apr 2014 11:14:36 -0400 Received: from mail-ee0-f51.google.com ([74.125.83.51]:40672 "EHLO mail-ee0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933782AbaDIPO2 (ORCPT ); Wed, 9 Apr 2014 11:14:28 -0400 Received: by mail-ee0-f51.google.com with SMTP id c13so1999509eek.24 for ; Wed, 09 Apr 2014 08:14:26 -0700 (PDT) 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-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: tomasz.nowicki@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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)