[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200421132136.1595-4-shiju.jose@huawei.com>
Date: Tue, 21 Apr 2020 14:21:33 +0100
From: Shiju Jose <shiju.jose@...wei.com>
To: <linux-acpi@...r.kernel.org>, <linux-pci@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <rjw@...ysocki.net>,
<bp@...en8.de>, <james.morse@....com>, <helgaas@...nel.org>,
<lenb@...nel.org>, <tony.luck@...el.com>,
<dan.carpenter@...cle.com>, <gregkh@...uxfoundation.org>,
<zhangliguang@...ux.alibaba.com>, <tglx@...utronix.de>
CC: <linuxarm@...wei.com>, <jonathan.cameron@...wei.com>,
<tanxiaofei@...wei.com>, <yangyicong@...ilicon.com>,
Shiju Jose <shiju.jose@...wei.com>
Subject: [RESEND PATCH v7 3/6] ACPI / APEI: Add callback for AER to the GHES notifier
Add callback function for handling the AER to the GHES notifier.
Signed-off-by: Shiju Jose <shiju.jose@...wei.com>
---
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
Powered by blists - more mailing lists