From patchwork Tue Apr 17 17:09:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 10346063 X-Patchwork-Delegate: bhelgaas@google.com 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 E89EE60542 for ; Tue, 17 Apr 2018 17:11:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAA1C1FF65 for ; Tue, 17 Apr 2018 17:11:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF207285B5; Tue, 17 Apr 2018 17:11:02 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 79C331FF65 for ; Tue, 17 Apr 2018 17:11:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753275AbeDQRKM (ORCPT ); Tue, 17 Apr 2018 13:10:12 -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-Google-Smtp-Source: AIpwx4+uyTQJmdvhQPvIsW6pwi6UqjrBlyyOzN2/MPsFBGTHHJz9WOWMPBhqlakjJEYOCHGaRuTlQw== 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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Tested-by: Tyler Baicar --- 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]);