Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp52288imm; Wed, 30 May 2018 17:29:15 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKHiNqGhnJLvTcp/Vvhg2NKOrkTZfQL+X8WGV3yN2AH3/Smn1pBsJz6E8VN9KoGaugwsQLy X-Received: by 2002:a63:2ac4:: with SMTP id q187-v6mr3398409pgq.333.1527726554944; Wed, 30 May 2018 17:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527726554; cv=none; d=google.com; s=arc-20160816; b=a50s4KAUgmmrbwyRnaQV8tHPMkqxY2oIYeKNdqfvRGzcYeooukeyXnXdtdz7NuymFq UDo5UuVoQ1o1wnpHorJOCATJzdCAeI2TKHWPUu3WsUJ9GJq/tCeUrP7VTpaoCpw8ohR3 6aS7vSUTQTO6sye7mgSECVbLA85MNA1AP5hCRBzvJVONY9gjOQOHcgHcZssal29L5YFD muGDvrx1OUxMU643A5U6djvVYTiSuUOUZ256shu5xWTdASC2kIT471FIFb44Js8WI3Ox MBIGQqnvW+WEkEsvbrixXxnQRblPxpoqyyJ9XfHVf8P9mg6vv1thqh4zYb67/ZVZw0Te ZMbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=z5vvaEoh2E64im1t1JETTkSqqAfljbOOTmONg1sGQYo=; b=yVhcE/hdk2SFXsRfnW8oN3549t3bfZvzKWDtSrERzo0YsSyRzLtZhwfpK0fYMStPmK G/S7d+oAFv652vsTK1vwjwgCyxYOhsLVa2iMJbHuLgnI2BqRL5LiaG5vTrGA7rgTHuTM 2Qf7wGo8uFI+HahJNFu/No/I3IqaVrjNqNQaSRhex/xSbIoqL8cYShkPASzp4ZF5pidN 1ZZiW7RzHQkCOW/06K5sdaazL7G2in0esyYESkZihiTsEJhArompCjzdlJD5fTX3fn6x DwGhAxNGv+yrTVmFU5v9oOCEKSRnLDlr5NmHJesufSZLmDPSMBrnmqpFP3dP1bUWzfIo YueQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=b+WGga1k; 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 p6-v6si11128820pfl.279.2018.05.30.17.29.01; Wed, 30 May 2018 17:29:14 -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=b+WGga1k; 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 S932583AbeEaA2f (ORCPT + 99 others); Wed, 30 May 2018 20:28:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:58848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932450AbeEaA2d (ORCPT ); Wed, 30 May 2018 20:28:33 -0400 Received: from localhost (c-73-15-0-24.hsd1.ca.comcast.net [73.15.0.24]) (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 D0AAD208A0; Thu, 31 May 2018 00:28:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527726513; bh=SvMuBxhAVqp91UzpHNQBp5IIKnZIL+lNc9DO8eItM0Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=b+WGga1kTyFW0Or18yYms9oR4rLynEHb4n6PgLiISe6dU61AMH2RcZ1JAN2p9ibiO 0ALdg6kx14Jj4Wjt7U5qayBzBrqqhLk+3lPClcTl1HhGktFPJrygqq//E7dWgoxVlN o3RTy/XX00ZSan/4UXQlReOK73jlG0KBLP66ZS+Y= Date: Wed, 30 May 2018 19:28:32 -0500 From: Bjorn Helgaas To: Rajat Jain Cc: linux-pci , Oza Pawandeep , Linux Kernel Mailing List Subject: Re: [PATCH v1 2/2] PCI/AER: Stop printing vendor/device ID Message-ID: <20180531002832.GP39853@bhelgaas-glaptop.roam.corp.google.com> References: <152770259826.80701.7360032106128917833.stgit@bhelgaas-glaptop.roam.corp.google.com> <152770286159.80701.8079550179741454699.stgit@bhelgaas-glaptop.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) 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 11:18:35AM -0700, Rajat Jain wrote: > On Wed, May 30, 2018 at 10:54 AM Bjorn Helgaas wrote: > > > From: Bjorn Helgaas > > > The Vendor and Device ID of the root port that raised an AER interrupt is > > irrelevant and already available via normal enumeration dmesg logging or > > lspci. > > Er, what is getting printed is not the vendor/device id of the root port > but that of the AER source device (the one that root port got an ERR_* > message from). In case of fatal AERs, the end point device may become > inaccessible so lspci will not be available, and enumeration logs (from > boot) may have gotten rolled over. So I think it is still better to print > this information here. Thanks for looking this over! You're right, "dev" here is not necessarily the Root Port, so this changelog is bogus. "dev" came from e_info->dev[] from aer_process_err_devices(). I think to be more precise, aer_irq() reads the Root Port's PCI_ERR_ROOT_ERR_SRC register, which gives us the Requester ID from the ERR_* message. Then find_source_device() walks the tree starting with the Root Port, looking for: - a device that matches the Requester ID, or - a device that doesn't match the Requester ID (e.g., because a VMD port clears the source ID) but has AER enabled and has logged an error of the same type (ERR_COR vs ERR_FATAL/NONFATAL) we're currently decoding So there might be multiple "dev" pointers in e_info->dev[] because several devices could have logged errors. I'm not convinced the vendor/device ID is that useful because there might be several devices with the same ID, so it doesn't really tell you which one. The Requester ID (bus/device/function) is the important thing. The current code is not ideal because the find_source_device() path depends on the pci_dev still being present and even accessible (so we can read DEVCTL, ERR_COR_STATUS, etc), which might not be the case. If find_source_device() fails, i.e., it can't find a matching pci_dev and prints the "can't find device of ID%04x" message, we're in real trouble because we don't call aer_process_err_devices(), which means we don't clear PCI_ERR_COR_STATUS. Anyway, I'll abandon this change for now since it's not a clear improvement. > > Remove the Vendor and Device ID from AER logging. > > > Signed-off-by: Bjorn Helgaas > > --- > > drivers/pci/pcie/aer/aerdrv_errprint.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > diff --git a/drivers/pci/pcie/aer/aerdrv_errprint.c > b/drivers/pci/pcie/aer/aerdrv_errprint.c > > index d7fde8368d81..16116844531c 100644 > > --- a/drivers/pci/pcie/aer/aerdrv_errprint.c > > +++ b/drivers/pci/pcie/aer/aerdrv_errprint.c > > @@ -175,9 +175,8 @@ void aer_print_error(struct pci_dev *dev, struct > aer_err_info *info) > > aer_error_severity_string[info->severity], > > aer_error_layer[layer], aer_agent_string[agent]); > > > - pci_err(dev, " device [%04x:%04x] error status/mask=%08x/%08x\n", > > - dev->vendor, dev->device, > > - info->status, info->mask); > > + pci_err(dev, " error status/mask=%08x/%08x\n", info->status, > > + info->mask); > > > __aer_print_error(dev, info);