Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4306889ybb; Tue, 7 Apr 2020 05:03:34 -0700 (PDT) X-Google-Smtp-Source: APiQypLy4JQDS4jtkVRaPGhlqdOJzcPOOGtY2KY4pJvzgyR6oH+8U3gCx4Z0xS/uFxxWs0qXRgZ5 X-Received: by 2002:a9d:6a51:: with SMTP id h17mr1159047otn.247.1586261014428; Tue, 07 Apr 2020 05:03:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586261014; cv=none; d=google.com; s=arc-20160816; b=eZOVIs15pWGD4kMercAyZCLCXsm7C4R9I+jMLhoKiyBGBYFKWTPdz5kGWIILoP4rPQ jaKCzGyVO4ZmrO1ODjq/vcP41renxCsuS9ZmZa0j23Mj+yTxst5iieyKzgXqmTT8tExC Q4h+om7Ue6QAdNIxhwTtdswuBQfFr1oWxDMUSGvSQ2UzBk/Z1qu8zI/PkdfNalGzOxY0 XHK46Lkq9dPUsJPPqOTYtOZpZxbYJLnNfir4CpzZRkgDmEGR42d1gFN6brOQLKNJ9ys/ BTMDynEADh68oewDUhUBxXYT0z+qD/XbIT3aDSUiHui3djsR2PvuUTZ+ddyH3xiqBB0+ q3dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=srS/A4TVH01J7WxzgF4ntzrN3xEN8DiVNB/1Vlv17EE=; b=MyHOKi/LfeKpnHb4MiOknuOfHwz/JQAN3qSrmSSD8d418am9TN87b63gCbl0DK8dl+ rBX8o7y81cnc84v6I4lk+fC/DjMrxpfCgqogS5SHZ/R8LqGq6ae7P1DeU61uZUeOpmKX hsj8s3caOc9qRWV+AJ50TIvWhV9pBpJ5XZRDjhF5D87xn15M0JYVLtTP34DVSV4ueO98 z1m9SVrai6KH5kndB7QSVGXKQQKbQZfVqtv9gpXbzwFiDsx40bI+z/92GsfARp315C4+ 0fAXgX5w0ZJdHJMNxwYpoMuxe138xIz2WjLryGw9LCDF0+sNoX3lieJHIcDZLMDahO+x 7smQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k10si1152100otr.174.2020.04.07.05.03.09; Tue, 07 Apr 2020 05:03:34 -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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728556AbgDGMCg (ORCPT + 99 others); Tue, 7 Apr 2020 08:02:36 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:12691 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728514AbgDGMCg (ORCPT ); Tue, 7 Apr 2020 08:02:36 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id D4FCD2F4798B7A04F03A; Tue, 7 Apr 2020 20:02:33 +0800 (CST) Received: from DESKTOP-6T4S3DQ.china.huawei.com (10.47.82.134) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.487.0; Tue, 7 Apr 2020 20:02:26 +0800 From: Shiju Jose To: , , , , , , , , , , , , CC: , , , , Shiju Jose Subject: [v7 PATCH 3/6] ACPI / APEI: Add callback for AER to the GHES notifier Date: Tue, 7 Apr 2020 13:00:42 +0100 Message-ID: <20200407120045.958-4-shiju.jose@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20200407120045.958-1-shiju.jose@huawei.com> References: <20200407120045.958-1-shiju.jose@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.47.82.134] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add callback function for handling the AER to the GHES notifier. Signed-off-by: Shiju Jose --- 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 053c4a2ed96c..67ef1742fc93 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -527,11 +527,16 @@ static int ghes_handle_memory_failure(struct notifier_block *nb, * GHES_SEV_PANIC does not make it to this handling since the kernel must * panic. */ -static void ghes_handle_aer(struct acpi_hest_generic_data *gdata) +static int ghes_handle_aer(struct notifier_block *nb, unsigned long event, + void *data) { #ifdef CONFIG_ACPI_APEI_PCIEAER + struct acpi_hest_generic_data *gdata = data; struct cper_sec_pcie *pcie_err = acpi_hest_get_payload(gdata); + if (!guid_equal((guid_t *)gdata->section_type, &CPER_SEC_PCIE)) + return NOTIFY_DONE; + if (pcie_err->validation_bits & CPER_PCIE_VALID_DEVICE_ID && pcie_err->validation_bits & CPER_PCIE_VALID_AER_INFO) { unsigned int devfn; @@ -556,12 +561,17 @@ static void ghes_handle_aer(struct acpi_hest_generic_data *gdata) pcie_err->aer_info); } #endif + return NOTIFY_STOP; } static struct notifier_block ghes_notifier_mem_error = { .notifier_call = ghes_handle_memory_failure, }; +static struct notifier_block ghes_notifier_aer = { + .notifier_call = ghes_handle_aer, +}; + struct ghes_error_handler_list { const char *name; struct notifier_block *nb; @@ -572,6 +582,10 @@ static const struct ghes_error_handler_list ghes_error_handler_list[] = { .name = "ghes_notifier_mem_error", .nb = &ghes_notifier_mem_error, }, + { + .name = "ghes_notifier_aer", + .nb = &ghes_notifier_aer, + }, }; static BLOCKING_NOTIFIER_HEAD(ghes_event_notify_list); @@ -657,10 +671,7 @@ static void ghes_do_proc(struct ghes *ghes, break; } - if (guid_equal(sec_type, &CPER_SEC_PCIE)) { - ghes_handle_aer(gdata); - } - else if (guid_equal(sec_type, &CPER_SEC_PROC_ARM)) { + if (guid_equal(sec_type, &CPER_SEC_PROC_ARM)) { struct cper_sec_proc_arm *err = acpi_hest_get_payload(gdata); log_arm_hw_error(err); -- 2.17.1