From patchwork Tue Oct 17 15:42:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Baicar X-Patchwork-Id: 10012311 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 E245860235 for ; Tue, 17 Oct 2017 15:42:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC3902895F for ; Tue, 17 Oct 2017 15:42:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0D2E28967; Tue, 17 Oct 2017 15:42:10 +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=ham 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 32E972895F for ; Tue, 17 Oct 2017 15:42:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755698AbdJQPmI (ORCPT ); Tue, 17 Oct 2017 11:42:08 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:36482 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753585AbdJQPmH (ORCPT ); Tue, 17 Oct 2017 11:42:07 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4FA51607B3; Tue, 17 Oct 2017 15:42:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1508254927; bh=oNAXRnUYJtRLrF/R6Kdwh7+zdBHcai/iGTZhpDuONY4=; h=From:To:Cc:Subject:Date:From; b=obcYfrm/MM3ZruvNcZG6xUxwXj9O1OWwqmigdfVjZJE3Tn+ZQkKA7UG7IOxqBQq06 6G5jpB4mhYA1TptNUjAuxUIlpwMOJ4fV/X7S8G6zCb9b7n1kid8SCjegzvbpJjI7S8 NDMJBcrbhCN0CrMGfZ2tcN13YrEdJwOcUPnpCuA4= Received: from tbaicar-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (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 4592D607B3; Tue, 17 Oct 2017 15:42:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1508254926; bh=oNAXRnUYJtRLrF/R6Kdwh7+zdBHcai/iGTZhpDuONY4=; h=From:To:Cc:Subject:Date:From; b=Vz2Khwu6Hsd7J4RjY++bQvzzdgHDU0u1C/9hayv87g4Lii/wQeRKRz84f+UefUgzU KlAlGXSoFqBB0wwUGRb7wa2KMUsARXdz1zmE9GSGdHKJXBwMu0n8dMdfyK/Dkj8LnU H0byeBYv30Rboj8FQR1ZnWYCF+ZLECUnzogKceSE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4592D607B3 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: bhelgaas@google.com, helgaas@kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tyler Baicar Subject: [PATCH] PCI/AER: update AER status string print to match other AER logs Date: Tue, 17 Oct 2017 09:42:02 -0600 Message-Id: <1508254922-30925-1-git-send-email-tbaicar@codeaurora.org> X-Mailer: git-send-email 1.9.1 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 Currently the AER driver uses cper_print_bits() to print the AER status string. This causes the status string to not include the proper PCI device name prefix that the other AER prints include. Also, it has a different print level than all the other AER prints. Update the AER driver to print the AER status string with the proper string prefix and proper print level. Previous log example: e1000e 0003:01:00.1: aer_status: 0x00000041, aer_mask: 0x00000000 Receiver Error, Bad TLP e1000e 0003:01:00.1: aer_layer=Physical Layer, aer_agent=Receiver ID pcieport 0003:00:00.0: aer_status: 0x00001000, aer_mask: 0x0000e000 Replay Timer Timeout pcieport 0003:00:00.0: aer_layer=Data Link Layer, aer_agent=Transmitter ID New log: e1000e 0003:01:00.1: aer_status: 0x00000041, aer_mask: 0x00000000 e1000e 0003:01:00.1: Receiver Error e1000e 0003:01:00.1: Bad TLP e1000e 0003:01:00.1: aer_layer=Physical Layer, aer_agent=Receiver ID pcieport 0003:00:00.0: aer_status: 0x00001000, aer_mask: 0x0000e000 pcieport 0003:00:00.0: Replay Timer Timeout pcieport 0003:00:00.0: aer_layer=Data Link Layer, aer_agent=Transmitter ID Signed-off-by: Tyler Baicar --- drivers/pci/pcie/aer/aerdrv_errprint.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pcie/aer/aerdrv_errprint.c b/drivers/pci/pcie/aer/aerdrv_errprint.c index 54c4b69..b718daa 100644 --- a/drivers/pci/pcie/aer/aerdrv_errprint.c +++ b/drivers/pci/pcie/aer/aerdrv_errprint.c @@ -206,6 +206,19 @@ void aer_print_port_info(struct pci_dev *dev, struct aer_err_info *info) } #ifdef CONFIG_ACPI_APEI_PCIEAER +void dev_print_bits(struct pci_dev *dev, unsigned int bits, + const char * const strs[], unsigned int strs_size) +{ + unsigned int i; + + for (i = 0; i < strs_size; i++) { + if (!(bits & (1U << i))) + continue; + if (strs[i]) + dev_err(&dev->dev, "%s\n", strs[i]); + } +} + int cper_severity_to_aer(int cper_severity) { switch (cper_severity) { @@ -243,7 +256,7 @@ void cper_print_aer(struct pci_dev *dev, int aer_severity, agent = AER_GET_AGENT(aer_severity, status); dev_err(&dev->dev, "aer_status: 0x%08x, aer_mask: 0x%08x\n", status, mask); - cper_print_bits("", status, status_strs, status_strs_size); + dev_print_bits(dev, status, status_strs, status_strs_size); dev_err(&dev->dev, "aer_layer=%s, aer_agent=%s\n", aer_error_layer[layer], aer_agent_string[agent]);