From patchwork Tue Nov 28 21:48:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Baicar X-Patchwork-Id: 10081159 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 79915602DC for ; Tue, 28 Nov 2017 21:49:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6231829417 for ; Tue, 28 Nov 2017 21:49:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 573DA296D5; Tue, 28 Nov 2017 21:49:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08B4A29417 for ; Tue, 28 Nov 2017 21:49:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752694AbdK1Vsq (ORCPT ); Tue, 28 Nov 2017 16:48:46 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:37776 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752219AbdK1Vsb (ORCPT ); Tue, 28 Nov 2017 16:48:31 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 03ABA6044B; Tue, 28 Nov 2017 21:48:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1511905711; bh=mitSHP0KxTo+O00TUq2j84VeA3ATa7UUBBIx0hLUNso=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hbgqA4JdqvRfesskFmSeV7AZgaw67qGc998l+yyz8QtB0OaUiDcevYOwTQ1kEVwD2 xJOh6joyZoJ4Qrn8XQCC3dAxowOTsXLpud034OMap8Kng7vqwxFc9/6NSPjx5nVYrV kklq6I9vm8lllGURF5BMv9CZJ/voXa7419UTz2yM= Received: from thunderhorn.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tbaicar@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4AA1760350; Tue, 28 Nov 2017 21:48:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1511905710; bh=mitSHP0KxTo+O00TUq2j84VeA3ATa7UUBBIx0hLUNso=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=coBLOG4TM+dDqWQqIudG294BpukFQO2mWDRbyB9f2kicr4BAWSePIPtynvpD2ycxo D9JOX1X8Lx98sqpX2A51on2F4LLCdNE0j4wI/7Pnzg+lQ1tEvHUVOP7e5KFElB2KX4 s7OXPXZ+4gbxYzYVPbvPrxi3G2ZSH63ephbvcFXc= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4AA1760350 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tbaicar@codeaurora.org From: Tyler Baicar To: rjw@rjwysocki.net, tony.luck@intel.com, will.deacon@arm.com, james.morse@arm.com Cc: bp@suse.de, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Tyler Baicar Subject: [PATCH V4 2/2] acpi: apei: call into AER handling regardless of severity Date: Tue, 28 Nov 2017 16:48:09 -0500 Message-Id: <1511905689-11522-3-git-send-email-tbaicar@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1511905689-11522-1-git-send-email-tbaicar@codeaurora.org> References: <1511905689-11522-1-git-send-email-tbaicar@codeaurora.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently the GHES code only calls into the AER driver for recoverable type errors. This is incorrect because errors of other severities do not get logged by the AER driver and do not get exposed to user space via the AER trace event. So, call into the AER driver for PCIe errors regardless of the severity Signed-off-by: Tyler Baicar Reviewed-by: Borislav Petkov --- drivers/acpi/apei/ghes.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index f67eb76..cc65d19 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -414,14 +414,26 @@ static void ghes_handle_memory_failure(struct acpi_hest_generic_data *gdata, int #endif } -static void ghes_handle_aer(struct acpi_hest_generic_data *gdata, int sev, int sec_sev) +/* + * PCIe AER errors need to be sent to the AER driver for reporting and + * recovery. The GHES severities map to the following AER severities and + * require the following handling: + * + * GHES_SEV_CORRECTABLE -> AER_CORRECTABLE + * These need to be reported by the AER driver but no recovery is + * necessary. + * GHES_SEV_RECOVERABLE -> AER_NONFATAL + * GHES_SEV_RECOVERABLE && CPER_SEC_RESET -> AER_FATAL + * These both need to be reported and recovered from by the AER driver. + * 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) { #ifdef CONFIG_ACPI_APEI_PCIEAER struct cper_sec_pcie *pcie_err = acpi_hest_get_payload(gdata); - if (sev == GHES_SEV_RECOVERABLE && - sec_sev == GHES_SEV_RECOVERABLE && - pcie_err->validation_bits & CPER_PCIE_VALID_DEVICE_ID && + if (pcie_err->validation_bits & CPER_PCIE_VALID_DEVICE_ID && pcie_err->validation_bits & CPER_PCIE_VALID_AER_INFO) { unsigned int devfn; int aer_severity; @@ -475,7 +487,7 @@ static void ghes_do_proc(struct ghes *ghes, ghes_handle_memory_failure(gdata, sev); } else if (guid_equal(sec_type, &CPER_SEC_PCIE)) { - ghes_handle_aer(gdata, sev, sec_sev); + ghes_handle_aer(gdata); } else if (guid_equal(sec_type, &CPER_SEC_PROC_ARM)) { struct cper_sec_proc_arm *err = acpi_hest_get_payload(gdata);