Received: by 10.192.165.156 with SMTP id m28csp292820imm; Tue, 17 Apr 2018 10:11:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/Nj5UNONpuJD0gCmudJB0xTN1KqsIIKdxbwzHaGWEnYt2vrMeaYolrhjNAT4rA7JqXPyBa X-Received: by 10.98.247.17 with SMTP id h17mr2661505pfi.165.1523985119659; Tue, 17 Apr 2018 10:11:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523985119; cv=none; d=google.com; s=arc-20160816; b=dYKER2dQk0UC7pfjhFB3rq7oSINE9XxE6a/M/+A0SejiOMD/aMo64PHNpvoG5l+oWV FzYAoN13SHX1AXeZbgxjLIn2a3Yj0fXlyQVCr6tyWYUsUXeDmgCwzNhXXtijZGdD/38g Elr16PBLLfp8Ev5wvfoegK94hbcyPaS90LQGW2DnbFGiUG5hW6jQwVoL1UeJhGNS+bq7 YpJZaEOs93FIyhc3AKzNNUaNLFTZd0JMai3P/uOFBJjtPAyzoQbdJSvxCszSuPUnoW9w R6l/Btkl6KJIq/v3iNUmpQ1ow6huYPeQa5FxQPJw1S+ubQQQlw4WRnjKWplYZZJ9LvKL KKqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=PEYjKfzE2DRKd4gxfVIi7aHdPcHMttStVmLOsDOoXzE=; b=PxZpM6xeWpk/Lxyxjudg1vxiLwOJp22bHDXs3uH7MiepHISlQ8YknyfC+kEcUVt7nt mxjY79z2LGXk3qrqR2GTKTl2OnKfbvaAECRVdFPGFrps4OvVsG2qU1hXGu0Lf+b0msm3 CJzpYZL3w6htXzECBWEdtwuhbQ9F6wLPH428xwsAFs3+jxrq3GE0JkWpQGsbRL0rTCt+ DQcG/0T/PC8PbnsQges0zJ2U/v1EvZ5O4pJuL3geRWv9HPmbcgXA6fF2tWhnn0D4PGix IvZ6VM9qQzyyKCsiM+rOnbkS3xN/oMvJ5qCyXNbsA16PtxHsfw1OHP+PjMdNCNILaqEY j6YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ngek7N9y; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g15-v6si1670648pln.526.2018.04.17.10.11.45; Tue, 17 Apr 2018 10:11:59 -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=@gmail.com header.s=20161025 header.b=Ngek7N9y; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753473AbeDQRKO (ORCPT + 99 others); Tue, 17 Apr 2018 13:10:14 -0400 Received: from mail-ot0-f195.google.com ([74.125.82.195]:40884 "EHLO mail-ot0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753320AbeDQRJv (ORCPT ); Tue, 17 Apr 2018 13:09:51 -0400 Received: by mail-ot0-f195.google.com with SMTP id h8-v6so11121571otj.7; Tue, 17 Apr 2018 10:09:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=PEYjKfzE2DRKd4gxfVIi7aHdPcHMttStVmLOsDOoXzE=; b=Ngek7N9yeYeoEhxbQwtt69MiFmMu7yNiM2vPQT3kg5bFWIxMbeSjsTYWeyBXZUfh0S uIuRHW8tgklquQH8FTF/tb7UhJZSs3tWszL0362BNhEHLwN+xoCj6re6t1fQffRUzAYU /GqXgTmW6if1bAz5RzlhhgQMEZMI64vhYRlATeWLanrAg6PWSDZMR0+mRHS/xwuHCiJI D+ZmkI4LaWIPbNrSE8B8BKJqHBYgXlG5a/PGenMJ9I/BFeL8AQu+IGxuUgthe0ZKiGn5 dFjh2Xq763JD+kcDr/KJxrh3P2NWF9aodHqONqRJEcv6dHMYgPhWqn4mQ5JtCfMOGn41 gX6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=PEYjKfzE2DRKd4gxfVIi7aHdPcHMttStVmLOsDOoXzE=; b=rJciCW78BM+qvCMICtPQFHUkj05OJOIDGCITilMs6lE1Jos37WWF7lU0ebJije6l8O sD6Fp9bFgP2ZSTHEa3ZWkDyy64yfKFCzFUD57pLDgrV7aQc0V/H7psdUP+JqSrOjMNLH sTX5u/jQW57E1Va/EtDTUefk+aUEtN/t1xlDolhoOdMh4KOQTGJYkPG6lm1o/9F5hPDM vxbO0vkzMmXePFi8Sm8jKvIoiiWnnzdlougE5j9NyjWLoNvAfndgsBzcYrnl2BaAe7HX tHifWc+vAfCayA3CYM/rSY0yyMKLnaBD53vFIQyr/61cqFu6lsfXg8zljGdq7oW6PUBH R7Ug== X-Gm-Message-State: ALQs6tA0egrR4+w9s30zxbs+ZK1e88fWwecDYXTkM2edXnSq5pIcqhJb 8WU2UYk7Agfi4kl5JdC3s5Y= X-Received: by 2002:a9d:3789:: with SMTP id x9-v6mr1623043otb.326.1523984990734; Tue, 17 Apr 2018 10:09:50 -0700 (PDT) Received: from nuclearis2_1.lan (c-98-197-2-30.hsd1.tx.comcast.net. [98.197.2.30]) by smtp.gmail.com with ESMTPSA id 48-v6sm800879oty.8.2018.04.17.10.09.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Apr 2018 10:09:50 -0700 (PDT) From: Alexandru Gagniuc To: bhelgaas@google.com, linux-pci@vger.kernel.org Cc: gregkh@linuxfoundation.org, fred@fredlawl.com, linux-kernel@vger.kernel.org, alex_gagniuc@dellteam.com, austin_bolen@dell.com, keith.busch@intel.com, Alexandru Gagniuc Subject: [PATCH RESEND] PCI/AER: Use a common function to print AER error bits Date: Tue, 17 Apr 2018 12:09:43 -0500 Message-Id: <20180417170943.1767-1-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.14.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On errors reported from CPER, cper_print_bits() was used to log the AER bits. This resulted in hard-to-understand messages, without a prefix. Instead use __aer_print_error() for both native AER and CPER to provide a more consistent log format. Signed-off-by: Alexandru Gagniuc --- drivers/pci/pcie/aer/aerdrv_errprint.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/pci/pcie/aer/aerdrv_errprint.c b/drivers/pci/pcie/aer/aerdrv_errprint.c index cfc89dd57831..cfae4d52f848 100644 --- a/drivers/pci/pcie/aer/aerdrv_errprint.c +++ b/drivers/pci/pcie/aer/aerdrv_errprint.c @@ -216,28 +216,30 @@ EXPORT_SYMBOL_GPL(cper_severity_to_aer); void cper_print_aer(struct pci_dev *dev, int aer_severity, struct aer_capability_regs *aer) { - int layer, agent, status_strs_size, tlp_header_valid = 0; + int layer, agent, tlp_header_valid = 0; u32 status, mask; - const char **status_strs; + struct aer_err_info info; if (aer_severity == AER_CORRECTABLE) { status = aer->cor_status; mask = aer->cor_mask; - status_strs = aer_correctable_error_string; - status_strs_size = ARRAY_SIZE(aer_correctable_error_string); } else { status = aer->uncor_status; mask = aer->uncor_mask; - status_strs = aer_uncorrectable_error_string; - status_strs_size = ARRAY_SIZE(aer_uncorrectable_error_string); tlp_header_valid = status & AER_LOG_TLP_MASKS; } layer = AER_GET_LAYER_ERROR(aer_severity, status); agent = AER_GET_AGENT(aer_severity, status); + memset(&info, 0, sizeof(info)); + info.severity = aer_severity; + info.status = status; + info.mask = mask; + info.first_error = 0x1f; + pci_err(dev, "aer_status: 0x%08x, aer_mask: 0x%08x\n", status, mask); - cper_print_bits("", status, status_strs, status_strs_size); + __aer_print_error(dev, &info); pci_err(dev, "aer_layer=%s, aer_agent=%s\n", aer_error_layer[layer], aer_agent_string[agent]); -- 2.14.3