Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp144599ybz; Tue, 21 Apr 2020 06:25:29 -0700 (PDT) X-Google-Smtp-Source: APiQypLzo16z1Sckw0hzRFCUeSRfVPRtE3oQI168ilXyvj746XXIkKiocnI12HB/s0qPtvx1QDkH X-Received: by 2002:aa7:dd53:: with SMTP id o19mr18154940edw.180.1587475529062; Tue, 21 Apr 2020 06:25:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587475529; cv=none; d=google.com; s=arc-20160816; b=SPEzdZoYWkKqgPw0WCKV+Stb9mL52q0F2ly7PaRKYLwokx/etidL3k33C4abTP1GPP Ihf3AuGGrmXLqRyGJN7/SZHvhJ+piDbKuMvx99khR8PkjYZp7E72D50NWgSxEsP1EO8t jCMAyqg0Om7xETn4stu4ic8byVwiKeJqN/YCix0lpdo9K9Qp/+3XSjjj/tBXYQm5fT5T OLoV2s3TRNfpOlwLaDld1o3LcDwfMNsXG4QecR3Lb8HZZaAsIaXuGDoUOROaoN1F7iT9 kwqutQGCXWoMbRF18gjBCz/XCMRg8VsCSHwKMjiXo2W1mFIx9CR9TXFdlUWA4owkWJhq t1uw== 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=PQkO6X3zX/k7eZbeFTu4qAyg4rREhpx7wbXLVjv6j1c9djigkMTmx6V/Q7WnY8rWZM 8RjDr/FShv4vwet3CnGl6yOOvVzSf2bxSiOnQBfxxBtnRM1o7q3qgYtA153vWCSkzatt vLAmmHY+tb8n4ScaSOqkRyYtk5e97KwkHENlmO5kw3aem4DPXTwuSXAMiHFei79ShjXs dDjpmir7QdLfaOfK6tArNciYjEzGuSpsEugDiSDWDX25b7i/9bQZC3Er1FUOFgkMRL9T sQB5FwPZKabj8BiKcgIIZ33TfvnHioVfF2haRgJLc6UP+++U0Go3oO4qzymPUl+NSoFG v39w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w1si1610870edj.107.2020.04.21.06.25.04; Tue, 21 Apr 2020 06:25:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728908AbgDUNXu (ORCPT + 99 others); Tue, 21 Apr 2020 09:23:50 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2823 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728864AbgDUNXt (ORCPT ); Tue, 21 Apr 2020 09:23:49 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 21F483B7C04644112CD7; Tue, 21 Apr 2020 21:23:46 +0800 (CST) Received: from DESKTOP-6T4S3DQ.china.huawei.com (10.47.83.77) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Tue, 21 Apr 2020 21:23:39 +0800 From: Shiju Jose To: , , , , , , , , , , , , CC: , , , , Shiju Jose Subject: [RESEND PATCH v7 3/6] ACPI / APEI: Add callback for AER to the GHES notifier Date: Tue, 21 Apr 2020 14:21:33 +0100 Message-ID: <20200421132136.1595-4-shiju.jose@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20200421132136.1595-1-shiju.jose@huawei.com> References: <20200421132136.1595-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.83.77] 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