Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4773587imm; Wed, 30 May 2018 11:42:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLgPcWZ033gsyjQ7V62az3J313e+8vtSy50ZaUGLw8vgPKsVB5GDDvjysGA/4CI9hC37svb X-Received: by 2002:a62:a111:: with SMTP id b17-v6mr3834260pff.132.1527705771110; Wed, 30 May 2018 11:42:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527705771; cv=none; d=google.com; s=arc-20160816; b=LkHFK3OFAIQCgUCgc2qCUMPeXy35EW2UoyY7puQIjVzM3if6MwEGsqTyirkMz4msnr TWQaPUZhKRc5TUP8R0EWcY9rTl1IeOK26N9tZydxLqdmhsqFuf10+syXsw34N9TipnU4 rgbXh1h2Jjr59gfxADV9HP2wrQl+S6NXBOZocsxSPd301JZZMgWTfJk7SpIzJjZbNmvw COWcV1g6FgpRFiQpZKBbTjK9FTs/p+XIcr4noeZsMdAqRG6/VOg8sULcPk+8aKs5JrWr aMAkgp25nm0u5XoJ/wDAb9A0srEmwYm8mnQxBBcATj+5KCTlX7Ih5wXpyAdakF5qlms7 1CyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=DCV9qo7EmA+jTnMuUiLDOLccGinP33xRbYupszMuNrs=; b=AIVSJ+/lyFyZWdGnnPvnyqGOfqd7w/Op3G/NXdKLV+uAe5iytcjtLNYR/v7RPyzxq8 4v+i56lNl4XqCkpyzSohL+gDTbFTrYDmE7q52aE4Tp/DeK/0bdwIqIl3U+qnhP9tfJE8 UloQ5mblqpwm6E6m/RA8jEDyt3ByJh67G3f2jpc96bkSEOAet6oyyNaUv5c5CyVIYkgr e6ug7vg7ivad7/jwtHWrP+g/Z7eBr4qffR5NclUnV/8FphXVBGCR+bAI+E4ttKH7sYSt K0S11mNx5rXU07qt2JpbFSumQAWYUqt29ikD8UPCJ+hbvEqC0G/YC6oQO2EJ8xQwNg7y F4SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=r9DvmGtL; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t3-v6si15812414plz.93.2018.05.30.11.42.36; Wed, 30 May 2018 11:42:51 -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=@google.com header.s=20161025 header.b=r9DvmGtL; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932108AbeE3SmF (ORCPT + 99 others); Wed, 30 May 2018 14:42:05 -0400 Received: from mail-ot0-f195.google.com ([74.125.82.195]:46096 "EHLO mail-ot0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932091AbeE3SmB (ORCPT ); Wed, 30 May 2018 14:42:01 -0400 Received: by mail-ot0-f195.google.com with SMTP id t1-v6so22299549ott.13 for ; Wed, 30 May 2018 11:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DCV9qo7EmA+jTnMuUiLDOLccGinP33xRbYupszMuNrs=; b=r9DvmGtLuWEGuOxh/tQuJ2+tTkMHmk5fx2pDqNUDjaqlUN553z1oFyUARLH8NW7LFo x2Mj+eAxpluChfaqT8y7XbwqpOOV8A644FkKaYnJ6AvNykj+J8wkJR+Em4gtwQcd6Zhg 9Q+SrGnUipmaqNQGwz21Fs3AbU0aie39rjv1yVIVInpZifaFGPnkRf8fQxK8dLy7rxHL SYNFkeoF/htnxnSHu06K0Fp354JHQUh+T+8urlzWXdP/riDjx3OwbiFhkcg9025+MG+z MP8UXveoZCUavOuRxEnDVsrlLDEkTuv7ffH0Lk1Y1Z1HUGufoKzN9WPiBTpQl28q9A+j 4q0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DCV9qo7EmA+jTnMuUiLDOLccGinP33xRbYupszMuNrs=; b=FraMGXzlLOvCTrAHThTAtTZQQDFOSz/+GKmKvO7Cyt6uTT8U40nTu8cUIaQhW2KQ1V Sw48M8U4NxC6Nhv6fwSnK4DsuYOukHsg2MZFHcVJVfKzf6q0BBgZiaupQJpt+Y/BYV7T 1oW21UoUvPbNYQfw8nF1SMR2OdoiDwgEa/jmQW3hTlpE2YqUiU4gAMuuWsvsVhCW51iY 27m5xc1BFNrPIZQlqGNdyb8VfHBpkWNDwgcfSIQru17m3vlroOh0zsKEjRmy24mPxbc+ kw4XJkSEcYgpSZpm1Tr8jhJ5eUo762SOAQR37BYFdWedn8KObmsKWIxuLDhcJiwL7HL9 T+Dw== X-Gm-Message-State: ALKqPwd2LSHhUxJZB4XGAvAKW2FB4U/3SKfGRR+mppKLUXkWxA7a0L0F vw4B0jVxmbYBuOTMuB1eFjySKwCTyJzz80U/biPeSw== X-Received: by 2002:a9d:5703:: with SMTP id p3-v6mr2666444oth.282.1527705720074; Wed, 30 May 2018 11:42:00 -0700 (PDT) MIME-Version: 1.0 References: <152770259826.80701.7360032106128917833.stgit@bhelgaas-glaptop.roam.corp.google.com> <152770285586.80701.6545710900591672975.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <152770285586.80701.6545710900591672975.stgit@bhelgaas-glaptop.roam.corp.google.com> From: Rajat Jain Date: Wed, 30 May 2018 11:41:23 -0700 Message-ID: Subject: Re: [PATCH v1 1/2] PCI/AER: Decode Error Source Requester ID To: Bjorn Helgaas Cc: linux-pci , Oza Pawandeep , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 30, 2018 at 10:54 AM Bjorn Helgaas wrote: > 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]); Does this code path indicate that a requester id was decoded to a device that is not registered with the kernel? If so, shouldn't we log the bad requester ID for better debugging, specifically since there is not going to be any subsequent print about this ID (since we return from this function in this case)? > 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