Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4734954imm; Wed, 30 May 2018 10:55:17 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKG2yQrQ79sP46mw+5ijaPdyfv2R7HeKlyjitt4vZMHuuQ6G56IJWeohGao91sJVB7Y0JwX X-Received: by 2002:a65:590f:: with SMTP id f15-v6mr2958505pgu.111.1527702917713; Wed, 30 May 2018 10:55:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527702917; cv=none; d=google.com; s=arc-20160816; b=T6mB0ApHoug4UC7keXBu4atXTgNhUoD30dFM8cjGCpCLr9bARqiPsEX4HWA4wY2JE1 uVbexToraRD98ZWcpao5WuIaGk7oP5hcZgJVLYVghfWKtvTUesYq8yBwQutfwwcuj2PX ciqm9u2dhx4q+5FOXBehir/2B+6K3h2MAOERrFW128T2I4V5/snDQUidw8H6Bx/QOWFT Pt168vpULJx58e4smi5NbUyRmb0v3uZgIfeESaL07Su1L5I9ta1GzVt9NyFMLkVb7flW vx1lXu3zzItEpTAYaBkKEKDezMUxwI2YmkTQTFNl3UlrsDR15JTlB4pO4kSbF1BWY3zJ rjHg== 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:cc:to:from :subject:dkim-signature:arc-authentication-results; bh=mVkUbvbvaRCYLU0vGUPHg7MT1I9Cw2WKWhOUfaWTnNI=; b=vqwGu2dWsrlP8DaSwsCGV1WLEUl7lyVtr9W4H4Yvr/RcQdtuRImEhpdnGBpdD5VVym kcTFn4AufFgjbFTHcUQu+5gfrm0k1Soq5yyOe3hZhd9zxEgtPLo0mIqrZo6xy1ehpQb8 EK1fVGt/1nsuiw8qYn13F2URlyY/waLwdcS76iLiQXF8rcrF8vBOWk7KDyCZZsBqgLX+ xyei9YBCd/BULcDX68nZzSbBpkkad3np5uydelBz5hYI63GJBC3V8wd0RMggb1R/gTrn M3xo1gJ0KuQHXTWvLcUJ1roSqnEycLvCY2Pi224EFzqsM3oDGUityh6Jx5eG3JTo5PLz YZyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YWrRNU6j; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11-v6si27768492pgu.459.2018.05.30.10.55.03; Wed, 30 May 2018 10:55:17 -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=YWrRNU6j; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753949AbeE3RyY (ORCPT + 99 others); Wed, 30 May 2018 13:54:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:43850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753895AbeE3RyR (ORCPT ); Wed, 30 May 2018 13:54:17 -0400 Received: from localhost (unknown [104.133.8.78]) (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 58E1620843; Wed, 30 May 2018 17:54:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527702856; bh=/xD+6vRVA5LR884uzWVHKDvwj0d9jxHn6qIWYuYi1CE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=YWrRNU6j/sold+sNBeTRjv08vOZUNRL3fyVe6iOm1mhv8Ok933T9rB9ucojbNgVCs GWoRlQfTkFCdEel2Zg4R8o6m1EWjBtbjiuO+5xEgrkoDVAaEynqBgYkdqjGLbWDygs ln97PnjgtOPTd66wrVEFB+7n6hJEVXkh/2gKnnCw= Subject: [PATCH v1 1/2] PCI/AER: Decode Error Source Requester ID From: Bjorn Helgaas To: linux-pci@vger.kernel.org Cc: Oza Pawandeep , linux-kernel@vger.kernel.org Date: Wed, 30 May 2018 12:54:15 -0500 Message-ID: <152770285586.80701.6545710900591672975.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <152770259826.80701.7360032106128917833.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <152770259826.80701.7360032106128917833.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.18 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjorn Helgaas Decode the Requester ID from the AER Error Source Register into domain/ bus/device/function format to match other logging. In cases where the ID matches the device used for pci_err(), drop the extra ID completely so we don't print it twice. Signed-off-by: Bjorn Helgaas --- drivers/pci/pcie/aer/aerdrv_errprint.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/pci/pcie/aer/aerdrv_errprint.c b/drivers/pci/pcie/aer/aerdrv_errprint.c index 21ca5e1b0ded..d7fde8368d81 100644 --- a/drivers/pci/pcie/aer/aerdrv_errprint.c +++ b/drivers/pci/pcie/aer/aerdrv_errprint.c @@ -163,17 +163,17 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info) int id = ((dev->bus->number << 8) | dev->devfn); if (!info->status) { - pci_err(dev, "PCIe Bus Error: severity=%s, type=Unaccessible, id=%04x(Unregistered Agent ID)\n", - aer_error_severity_string[info->severity], id); + pci_err(dev, "PCIe Bus Error: severity=%s, type=Inaccessible, (Unregistered Agent ID)\n", + aer_error_severity_string[info->severity]); goto out; } layer = AER_GET_LAYER_ERROR(info->severity, info->status); agent = AER_GET_AGENT(info->severity, info->status); - pci_err(dev, "PCIe Bus Error: severity=%s, type=%s, id=%04x(%s)\n", + pci_err(dev, "PCIe Bus Error: severity=%s, type=%s, (%s)\n", aer_error_severity_string[info->severity], - aer_error_layer[layer], id, aer_agent_string[agent]); + aer_error_layer[layer], aer_agent_string[agent]); pci_err(dev, " device [%04x:%04x] error status/mask=%08x/%08x\n", dev->vendor, dev->device, @@ -186,7 +186,7 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info) out: if (info->id && info->error_dev_num > 1 && info->id == id) - pci_err(dev, " Error of this Agent(%04x) is reported first\n", id); + pci_err(dev, " Error of this Agent is reported first\n"); trace_aer_event(dev_name(&dev->dev), (info->status & ~info->mask), info->severity, info->tlp_header_valid, &info->tlp); @@ -194,9 +194,13 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info) void aer_print_port_info(struct pci_dev *dev, struct aer_err_info *info) { - pci_info(dev, "AER: %s%s error received: id=%04x\n", + u8 bus = info->id >> 8; + u8 devfn = info->id & 0xff; + + pci_info(dev, "AER: %s%s error received: %04x:%02x:%02x.%d\n", info->multi_error_valid ? "Multiple " : "", - aer_error_severity_string[info->severity], info->id); + aer_error_severity_string[info->severity], + pci_domain_nr(dev->bus), bus, devfn >> 3, devfn & 0x7); } #ifdef CONFIG_ACPI_APEI_PCIEAER