Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp174160ybp; Thu, 3 Oct 2019 11:51:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzyaMt+37srbTHTRCVgKaH7JGDqogosIQOTbJAV8FEBgK2Mkn8txhlLxedE1NlQxKR9082P X-Received: by 2002:a05:6402:1549:: with SMTP id p9mr11178761edx.221.1570128691976; Thu, 03 Oct 2019 11:51:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570128691; cv=none; d=google.com; s=arc-20160816; b=krJmyQ11xlY5lOHjWpCUolO/xgMSluXmnRwKpRikVs1kq27FWulhWYHShLfZEpq9wo g8FEil2SmVIvuctazFgpvMjkOOwxw+EM4CZVu8pABDSu1HmxlWBTrvyzwsCcLYd/NUAE ORT+DWmX9PYRQYndFX1ea9DDwqU2VZamS1RVdhrVSZDZgZNZvhPqaoT7dRqSiUQ+3I1e F/O5Qy9DexF41QiOWiCEtTbU+r7VzLnTNNwDPJ/AW5chGReg6L2/kg/OEaTppgN2VaPU 4/GAcytXQhjCfOFl++k85rrqx7elvCktPpA/7ZyUu5Is/6ovtlK1cPNdRm3JoYQQBU0P 3C3Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AFffD7Tnl5UetM4wmULuaVadqEbVkVjos60zoEKRvNI=; b=DzbvuP7KARDuKXIDwI7+orzR0exikoGAxyH2btdtv7TmaZGhPPyNvKrQgs7U1OFDqf dZZmieVzOm8GYozAY1LW63IDTH2oxu0WOkeIlOie8p1wA9tbBrBHSLuo009ug5XGb6TI jzBX/ujZw83h87CQWxyuzKlwQT5Rw68lvSHBpjH1C7WEVKKH8QgVDpUHxvY16195Ed6e 7fSZHqpyrH6wJzXN21ziaMyd4FI+LdhASzLGDJZMkb5/cD+bUeULa2psIHd971i+xkge TiaEOwxibHimxWPJGk1vFQhpNYxJeQu2wtTGk3lPTAYML8rySoRxknCOTkko6ByDllqr fTSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oimJiwqc; 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 g20si1597894eje.364.2019.10.03.11.51.07; Thu, 03 Oct 2019 11:51:31 -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; dkim=pass header.i=@kernel.org header.s=default header.b=oimJiwqc; 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 S2390228AbfJCRlx (ORCPT + 99 others); Thu, 3 Oct 2019 13:41:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:40394 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731045AbfJCP5t (ORCPT ); Thu, 3 Oct 2019 11:57:49 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 38D5C20830; Thu, 3 Oct 2019 15:57:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570118268; bh=nbgbhwOlk/LuTh2Jiw/PsDh+mAGYreruz68vM9Rfhvw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oimJiwqcl2PQKGc6JemESW8OSa/7jgQjaecd/zl1HBIIv2D/21fn5tNRDYOAgj8RQ FWNazzlvlOPrpPDrkiCYHsDouhYJqFYGWwoRaQy3Jq8LJU8rS4vJj/Ab2uR/djzLCg hKbL+EiFKj9G/N4DHk3DjH2cBmsF5Np/LpiKs3Eg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiaofei Tan , James Morse , Ard Biesheuvel , Sasha Levin Subject: [PATCH 4.4 51/99] efi: cper: print AER info of PCIe fatal error Date: Thu, 3 Oct 2019 17:53:14 +0200 Message-Id: <20191003154320.334572430@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154252.297991283@linuxfoundation.org> References: <20191003154252.297991283@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiaofei Tan [ Upstream commit b194a77fcc4001dc40aecdd15d249648e8a436d1 ] AER info of PCIe fatal error is not printed in the current driver. Because APEI driver will panic directly for fatal error, and can't run to the place of printing AER info. An example log is as following: {763}[Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 11 {763}[Hardware Error]: event severity: fatal {763}[Hardware Error]: Error 0, type: fatal {763}[Hardware Error]: section_type: PCIe error {763}[Hardware Error]: port_type: 0, PCIe end point {763}[Hardware Error]: version: 4.0 {763}[Hardware Error]: command: 0x0000, status: 0x0010 {763}[Hardware Error]: device_id: 0000:82:00.0 {763}[Hardware Error]: slot: 0 {763}[Hardware Error]: secondary_bus: 0x00 {763}[Hardware Error]: vendor_id: 0x8086, device_id: 0x10fb {763}[Hardware Error]: class_code: 000002 Kernel panic - not syncing: Fatal hardware error! This issue was imported by the patch, '37448adfc7ce ("aerdrv: Move cper_print_aer() call out of interrupt context")'. To fix this issue, this patch adds print of AER info in cper_print_pcie() for fatal error. Here is the example log after this patch applied: {24}[Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 10 {24}[Hardware Error]: event severity: fatal {24}[Hardware Error]: Error 0, type: fatal {24}[Hardware Error]: section_type: PCIe error {24}[Hardware Error]: port_type: 0, PCIe end point {24}[Hardware Error]: version: 4.0 {24}[Hardware Error]: command: 0x0546, status: 0x4010 {24}[Hardware Error]: device_id: 0000:01:00.0 {24}[Hardware Error]: slot: 0 {24}[Hardware Error]: secondary_bus: 0x00 {24}[Hardware Error]: vendor_id: 0x15b3, device_id: 0x1019 {24}[Hardware Error]: class_code: 000002 {24}[Hardware Error]: aer_uncor_status: 0x00040000, aer_uncor_mask: 0x00000000 {24}[Hardware Error]: aer_uncor_severity: 0x00062010 {24}[Hardware Error]: TLP Header: 000000c0 01010000 00000001 00000000 Kernel panic - not syncing: Fatal hardware error! Fixes: 37448adfc7ce ("aerdrv: Move cper_print_aer() call out of interrupt context") Signed-off-by: Xiaofei Tan Reviewed-by: James Morse [ardb: put parens around terms of && operator] Signed-off-by: Ard Biesheuvel Signed-off-by: Sasha Levin --- drivers/firmware/efi/cper.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c index d425374254384..f40f7df4b7344 100644 --- a/drivers/firmware/efi/cper.c +++ b/drivers/firmware/efi/cper.c @@ -384,6 +384,21 @@ static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie, printk( "%s""bridge: secondary_status: 0x%04x, control: 0x%04x\n", pfx, pcie->bridge.secondary_status, pcie->bridge.control); + + /* Fatal errors call __ghes_panic() before AER handler prints this */ + if ((pcie->validation_bits & CPER_PCIE_VALID_AER_INFO) && + (gdata->error_severity & CPER_SEV_FATAL)) { + struct aer_capability_regs *aer; + + aer = (struct aer_capability_regs *)pcie->aer_info; + printk("%saer_uncor_status: 0x%08x, aer_uncor_mask: 0x%08x\n", + pfx, aer->uncor_status, aer->uncor_mask); + printk("%saer_uncor_severity: 0x%08x\n", + pfx, aer->uncor_severity); + printk("%sTLP Header: %08x %08x %08x %08x\n", pfx, + aer->header_log.dw0, aer->header_log.dw1, + aer->header_log.dw2, aer->header_log.dw3); + } } static void cper_estatus_print_section( -- 2.20.1