Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp145061ybz; Tue, 21 Apr 2020 06:26:02 -0700 (PDT) X-Google-Smtp-Source: APiQypL9aZVFMewVMDDVsBbZYfJ8kFoPOXHtcN5HrM5on2/XV4p4LSupu0Pi6Aly3jk64nMAmrab X-Received: by 2002:a50:bb2a:: with SMTP id y39mr17921226ede.292.1587475562015; Tue, 21 Apr 2020 06:26:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587475562; cv=none; d=google.com; s=arc-20160816; b=NkvUm3pAH5DNq9QMq1dqOflGpXf8u2malODzKpa9sZrGKzUl8AUs/7A59BoL6vPyLw gbdedaKn5WYduxEtitKWEWoVLMGNMaHPTjOjVp7FdGeKU0Nqvl4SyI/x+UcXiMhFmOFj OHwKao4NWxdrJSZVc9mrUc6Imec3YwTczhoffziA1Msw22X5wEpqKNhG/Wb+JxSIHbHV oib3bf2a6s06TLNlHdfzDmh92bMHoNwIVH8DVveoTDwtBT6/0ZdgCVRP3XO73BTzNpW3 uDm3Hz2IO96uIaQ1PLAVbKMvVuoZJKVvFAoB3PUFC9bFuMSFqVmJfj+JLNPTv2jfASoD Xv9w== 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=3w/Q3nc9aRo2gkf6u9OJWTnc97EGUUrJXAUVPLl8XNY=; b=sqNnrtUeqjZjhL5wZFZkcsYpHQuOd6XpnSXRVpb3l5yuFuBIvk8Ky6EpO/1Gop9L6U KWuYVYrIjXOxSDpmQc8yCGeM6FiuZLoHIjVpdmbm98Dt3VZ9VX5OUTdWTNKxCzkGcsjI UA0EEJ708N7hm/9Dloz4D1f2Q4XSIfZCkn1BEdD8++Q5kRzm6ubQi2OIgiFtj9BqlpiW uGycbmYPjgWI8qk9tYsEe5wGjD+jun/zQaKi6TlZKGTT4NH8O6EgQzopo5b6Z1idaaXJ VuVy8fF1igifAYcRGq/Jts+SIR5VzW/lSIt9/x2WTXK1BA3Dnxe+BLmxFl987o3npnrz 8Nyg== 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 cw20si1642291edb.53.2020.04.21.06.25.38; Tue, 21 Apr 2020 06:26:02 -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 S1729088AbgDUNYA (ORCPT + 99 others); Tue, 21 Apr 2020 09:24:00 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2824 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728864AbgDUNX6 (ORCPT ); Tue, 21 Apr 2020 09:23:58 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 3EF206D6AE95EF88C47E; Tue, 21 Apr 2020 21:23:56 +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:45 +0800 From: Shiju Jose To: , , , , , , , , , , , , CC: , , , , Shiju Jose Subject: [RESEND PATCH v7 4/6] ACPI / APEI: Add callback for ARM HW errors to the GHES notifier Date: Tue, 21 Apr 2020 14:21:34 +0100 Message-ID: <20200421132136.1595-5-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 ARM HW errors to the GHES notifier. Signed-off-by: Shiju Jose --- drivers/acpi/apei/ghes.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 67ef1742fc93..3b89c7621a0d 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -564,6 +564,20 @@ static int ghes_handle_aer(struct notifier_block *nb, unsigned long event, return NOTIFY_STOP; } +static int ghes_handle_arm_hw_error(struct notifier_block *nb, + unsigned long event, void *data) +{ + struct acpi_hest_generic_data *gdata = data; + struct cper_sec_proc_arm *err = acpi_hest_get_payload(gdata); + + if (!guid_equal((guid_t *)gdata->section_type, &CPER_SEC_PROC_ARM)) + return NOTIFY_DONE; + + log_arm_hw_error(err); + + return NOTIFY_STOP; +} + static struct notifier_block ghes_notifier_mem_error = { .notifier_call = ghes_handle_memory_failure, }; @@ -572,6 +586,10 @@ static struct notifier_block ghes_notifier_aer = { .notifier_call = ghes_handle_aer, }; +static struct notifier_block ghes_notifier_arm_hw_error = { + .notifier_call = ghes_handle_arm_hw_error, +}; + struct ghes_error_handler_list { const char *name; struct notifier_block *nb; @@ -586,6 +604,10 @@ static const struct ghes_error_handler_list ghes_error_handler_list[] = { .name = "ghes_notifier_aer", .nb = &ghes_notifier_aer, }, + { + .name = "ghes_notifier_arm_hw_error", + .nb = &ghes_notifier_arm_hw_error, + }, }; static BLOCKING_NOTIFIER_HEAD(ghes_event_notify_list); @@ -670,12 +692,7 @@ static void ghes_do_proc(struct ghes *ghes, pr_warn(GHES_PFX "ghes event queue full\n"); break; } - - 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); - } else { + { void *err = acpi_hest_get_payload(gdata); log_non_standard_event(sec_type, fru_id, fru_text, -- 2.17.1