Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3276224imm; Fri, 19 Oct 2018 08:03:12 -0700 (PDT) X-Google-Smtp-Source: ACcGV632vfEE5IjRvZozjrQitbmqrewhcRDG5RS8GVHkxw8H6Ztnn/EFqyu8jcl2NvK5WMV6W6Xk X-Received: by 2002:a62:5547:: with SMTP id j68-v6mr34833749pfb.166.1539961392044; Fri, 19 Oct 2018 08:03:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539961392; cv=none; d=google.com; s=arc-20160816; b=l3wBP2mY9zw8wlH5S+Fj36M9UwqI/yPoEvAhUAanyoqsPBgQ/DGm7rVkK8nwLQU+G0 Pijroi1Znuja2t0G3a8du8Q9Ho4ZP7bZK5bUlSlr/r/WAVONGDnfYNboAPBA9YgExZaq GtEa6K5cKiqTlPbhUZ5ViddLJO42K0TQA2Xg4kXvZwK/boDnqSFf17R3F1DfY6CteCkT q0IR1SRODPsmuQI9gM5PLvJf5PHaYNMKwCEmZMJcrsmKNp/gXrrSfeFWo1XBp6NtocPE G9VYba4w2nG/3uwPlBP64+ZWbB6QFdOCz3EZdj9VE8QNT03dznf1Wz2KqGcNZKrjWNa4 hi8g== 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; bh=K982CdvRVj02Rl5hMxhBV5INxJcvzpnEwaDoXL5oYQM=; b=a0uzxC3KsACGuzWsDH/qzP2xeWP+ScVCzrFJ+aRDQwQmrAujIyW2azk5rzfRgWvzvf YtpxZ2tE19ac2xrzdqE0WAQTg50kaGrA7kOKFjBk51xg4Du7Q9SVuDlGXbbkLwXQ1iQd e/IiSD0SVrq5JicB4ZaQ/8jXyKZYvR8JQTiGQ63KOGX27YaB9929JXz0i+TE8fUUuGzO 516VZtxKbG0hUGAdMa1M2i1UFT4q3tajpkkb00+RHLNa6ibjzUzHlqjnBywVdyKfbLlW 5GbvUPiIUNELdhSgSydwUF7vstMWS/LrKy9MYhRb1vxUD5QSDph8RyP/QJhRVOdXkE/B RsMg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10-v6si210181pgk.330.2018.10.19.08.02.54; Fri, 19 Oct 2018 08:03:12 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727610AbeJSXHf (ORCPT + 99 others); Fri, 19 Oct 2018 19:07:35 -0400 Received: from mga17.intel.com ([192.55.52.151]:8316 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726664AbeJSXHe (ORCPT ); Fri, 19 Oct 2018 19:07:34 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Oct 2018 08:01:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,400,1534834800"; d="scan'208";a="100889079" Received: from unknown (HELO localhost.localdomain) ([10.232.112.69]) by orsmga001.jf.intel.com with ESMTP; 19 Oct 2018 08:01:04 -0700 Date: Fri, 19 Oct 2018 08:58:20 -0600 From: Keith Busch To: Bjorn Helgaas 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: <20181019145820.GB23571@localhost.localdomain> References: <153989603841.78375.436243401553964151.stgit@bhelgaas-glaptop.roam.corp.google.com> <20181018230312.GB23301@localhost.localdomain> <20181019011135.GP5906@bhelgaas-glaptop.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181019011135.GP5906@bhelgaas-glaptop.roam.corp.google.com> User-Agent: Mutt/1.9.1 (2017-09-22) 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 08:11:35PM -0500, Bjorn Helgaas wrote: > 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? I was comparing how other end device driver's enable this, and they all call pci_enable_pcie_error_reporting() somewhere along their pci_driver->probe path. With that in mind, are ports special compared to end devices for this particular feature? > > 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(). There are unfortunately still pci_driver instances that don't implement the err_handler callbacks, and may cause problems if we enable error reporting in the device when its driver isn't capable of reacting to them. If it wasn't for that, I think it would make more sense to move this responsibility from drivers to the pci core. > 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. Right, but that's no different than every other Linux pci_driver. The component that provides the pci_driver.err_handler should be responsible for requesting to enable device error reporting, and that's provided by the port driver, not AER.