Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4307365ybb; Tue, 7 Apr 2020 05:04:00 -0700 (PDT) X-Google-Smtp-Source: APiQypKIGwlOiF9hpjUiUQeHPci4FSuShraD4lma63UOWqVACzXdysCj8N5QTZzmOYxSLRqrTxPE X-Received: by 2002:aca:c6ca:: with SMTP id w193mr1304781oif.165.1586261040408; Tue, 07 Apr 2020 05:04:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586261040; cv=none; d=google.com; s=arc-20160816; b=kF73woSwGxO/Ue0Tcam3NcQqfIDNGQCEl1F9W1x9ogBEFWC6HCj2m1K6CwfCliSP5k ZP56IMWl+bDVSk60ShD30N6BfTTTtuTIFH+aq+hPz7Ey3oDdo2GwLQb/8Jpnqn3RltD6 YFpTEFN4bdjtrS0jboqIE4zroKtF5yHDncTMdNThGstKnEc/ow992eEZr9N9wZKPNba8 ijbLrvo+w1bLx+rUD7y3cx1TBbgrMlTtM6DpAr/ow3c5aPyHXg5TbmqwO/66hjn6s1Ar /PZHWpf9ruHUnlKvpiJPsDQlzhap0p3l90rT4ruBbJbhskTOO0j4wyCLvVFERDsZPujf 8hZA== 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=heOhatlJ0h0oammmb0lt/yjYRSPIJ92s7SlmLgOUXWJspCA0PL1A5Yu/qq6OOCYdH9 o0yz/RgY67/1eCNAYVagpBuLAj08TeMCGaqg0Ed6B0b1mTs+Cqp+RtadhEl9Q+5DcgF+ JjH9XtrXZCxpWs4KlFStIQZrjCpH9nD1Y8gMejDfprkG0xp62nxR1hgmOORTI9+53/d8 DshwT/S5673fKur6st2jFtggd2aZGaPHPpvSqOipP8QwuDSsaaGPK8PFrPNZBEPH7aiS O1xuZO2U2S+MaZfzSJDWOPFI9Gdha0Nc80A9CBuhj8T72j8We2YqNoFsn+4/0YmKbjyg 7lsg== 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 a128si565619oif.202.2020.04.07.05.03.40; Tue, 07 Apr 2020 05:04: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; 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 S1728598AbgDGMCq (ORCPT + 99 others); Tue, 7 Apr 2020 08:02:46 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:12692 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726591AbgDGMCp (ORCPT ); Tue, 7 Apr 2020 08:02:45 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id F155AB66627BF4D13B8F; Tue, 7 Apr 2020 20:02:38 +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:31 +0800 From: Shiju Jose To: , , , , , , , , , , , , CC: , , , , Shiju Jose Subject: [v7 PATCH 4/6] ACPI / APEI: Add callback for ARM HW errors to the GHES notifier Date: Tue, 7 Apr 2020 13:00:43 +0100 Message-ID: <20200407120045.958-5-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 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