Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2594998imm; Thu, 18 Oct 2018 18:12:19 -0700 (PDT) X-Google-Smtp-Source: ACcGV61ew0MKxNWENX7e3qNvQuKjONkKbFyXBrG3jgAT0g/YMjsySl+wdNl+T3XCoowfKjdGSIrK X-Received: by 2002:a62:438c:: with SMTP id l12-v6mr32642900pfi.175.1539911539542; Thu, 18 Oct 2018 18:12:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539911539; cv=none; d=google.com; s=arc-20160816; b=BdM1FBggZnZYxiBb59K6PlJfPzPmwGl8UFak6LaMFJGouD7O3si5bJILe17TtK0Ucf 75gvBZDm2USEhyAT607eBd4E7OsWneFP9zCxv/xa+gbZLTGwuPN5SI8LvxUJqFl5RczC MT2iCJRks8NbaqPGvmGCr0Cj0AFp+Bh56xMRkkf7A1nkPi6/avAtSLiDPNTeAOceC2qI z0po8nI5LQrG+JrNjk24hf9CONenWeXlv9hx/Iu6CDAL1Bmj96zrAry8WccRKMk0NXxV QgTB+8fJwUPnnieRkhFK3rBHaz3NAmg3o2SBNXyb/bx2IJMg8EmBZ0nDcU06L8utWY2U dxQQ== 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; bh=Pi65binK4xavaOhGQ5hTs4BuCLM7ikMs7XtTopowFz0=; b=LEP/DL+U2/GhZi1oZUgUZdfAinPWOBiCCvYA2RIopzblAvxk9uoDXU7aOZAm6ZzHev XJQaZadhTjNRDor19zwl9gqJK7UZjMuMrHIRS/BoCHNJ7ZtlfUrM/ZocI0FTlfIjpbPv 9qXKIem2GmxSYw9ahuSag/MYbchC33JKSD8xND4iZgW86m4Awyyi3CATMVSGoxgd1Rgz 6nPY0RwlAaEGCDyLWER6SoSjbMAKD1j2NzagA+h/2G6SVbVP0thvqG55joovo1ZI9+2k bMR5x/ww0q0zt59UGjkWVS0Wunvc575agTs+RwAkRP0Ss3ZFUKH2u7cvKJ9cCXETaCwE IxWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="N/QZFJuf"; 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 n7-v6si22290514pgh.359.2018.10.18.18.12.03; Thu, 18 Oct 2018 18:12:19 -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="N/QZFJuf"; 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 S1726680AbeJSJPU (ORCPT + 99 others); Fri, 19 Oct 2018 05:15:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:50504 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726245AbeJSJPU (ORCPT ); Fri, 19 Oct 2018 05:15:20 -0400 Received: from localhost (unknown [69.71.4.100]) (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 E4C362087A; Fri, 19 Oct 2018 01:11:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539911497; bh=klujbr7nYprovwe9U06oVDIuLXYayo3DMcd3onFZyPs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N/QZFJufiYBlnWN54oS1DulHo7tA9wrzExP9UMk9HULuGb9EtHVZXbQhuPHgVbNWo VmuRWfUboGy1O+ZV5mIxIGsRXES1b3TWbf3MB77fstsbqt1aR2mgMAOA1plHSNb8cz LyL4SxtDF/2fxkQmJt9WMSoZZsy/Xjinkn6DF69Y= Date: Thu, 18 Oct 2018 20:11:35 -0500 From: Bjorn Helgaas To: Keith Busch Cc: Jon Derrick , Dongdong Liu , Sinan Kaya , Oza Pawandeep , Matthew Wilcox , Lukas Wunner , Christoph Hellwig , Mika Westerberg , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] PCI/AER: Enable error reporting for all ports Message-ID: <20181019011135.GP5906@bhelgaas-glaptop.roam.corp.google.com> References: <153989603841.78375.436243401553964151.stgit@bhelgaas-glaptop.roam.corp.google.com> <20181018230312.GB23301@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181018230312.GB23301@localhost.localdomain> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 18, 2018 at 05:03:13PM -0600, Keith Busch wrote: > On Thu, Oct 18, 2018 at 03:53:58PM -0500, Bjorn Helgaas wrote: > > Change the AER service driver so it binds to *all* PCIe Ports, > > including Switch Upstream and Downstream Ports. Enable AER error > > reporting for all these Ports, but not for any children. > > I'm looking at this again and think enabling/disabling error > reporting for ports is the responsibility of the port driver, not > the AER service. That's an interesting idea. Can you expand on this a little more? Why is it the responsibility of the port driver? Do you think pci_enable_pcie_error_reporting() shouldn't be part of the AER service because it updates the Device Control register, which is in the PCIe Capability, not the AER Capability? What about pci_aer_clear_device_status(), which clears Device Status, which is also in the PCIe Capability? > The following should do the same as this patch, but without making > AER driver handle non-root ports. The report enabling/disabling > functions are already stubbed for '!CONFIG_PCIE_AER' and have checks > for aer_cap and firmware first. If we thought we should enable error reporting *always*, regardless of whether the AER service is enabled, this would make perfect sense to me, and I might suggest doing it in an even more generic place like pci_configure_device() or pci_init_capabilities(). But that doesn't seem like where you're headed. It seems like you still only want error reporting enabled when CONFIG_PCIEAR=y. If that's the case, it seems like doing it in portdrv only obfuscates the connection with AER. When CONFIG_PCIEAER is unset, the portdrv code *looks* like it's doing something but it's really not because of the #ifdef magic. > A real patch for this could even make this remove all the aer > specific error report enabling, so it'd be a net-loss in code lines. > :) > > --- > diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c > index 0acca3596807..f129a33c8303 100644 > --- a/drivers/pci/pcie/portdrv_pci.c > +++ b/drivers/pci/pcie/portdrv_pci.c > @@ -122,12 +122,13 @@ static int pcie_portdrv_probe(struct pci_dev *dev, > pm_runtime_put_autosuspend(&dev->dev); > pm_runtime_allow(&dev->dev); > } > - > + pci_enable_pcie_error_reporting(dev); > return 0; > } > > static void pcie_portdrv_remove(struct pci_dev *dev) > { > + pci_disable_pcie_error_reporting(dev); > if (pci_bridge_d3_possible(dev)) { > pm_runtime_forbid(&dev->dev); > pm_runtime_get_noresume(&dev->dev); > --