public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <keith.busch@intel.com>
To: linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
	Maik Broemme <mbroemme@libmpq.org>
Cc: Keith Busch <keith.busch@intel.com>
Subject: [PATCH 3/4] PCI/DPC: Enable DPC in conjuction with AER
Date: Tue, 19 Dec 2017 14:06:42 -0700	[thread overview]
Message-ID: <20171219210643.24615-3-keith.busch@intel.com> (raw)
In-Reply-To: <20171219210643.24615-1-keith.busch@intel.com>

The PCI Express Base Specification's implementation note on "Determination
of DPC Control" recommends the operating system always link DPC control to
the control of AER, as the two functionalities are strongly connected. To
avoid conflicts over whether platform firmware or the OS control DPC,
this patch enables DPC only if AER is enabled in the OS, and the device's
error handling does not have a firmware-first AER handling.

Signed-off-by: Keith Busch <keith.busch@intel.com>
---
 drivers/pci/pcie/Kconfig        | 2 +-
 drivers/pci/pcie/pcie-dpc.c     | 4 ++++
 drivers/pci/pcie/portdrv_core.c | 4 ++--
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/pcie/Kconfig b/drivers/pci/pcie/Kconfig
index ac53edbc9613..d658dfa53b87 100644
--- a/drivers/pci/pcie/Kconfig
+++ b/drivers/pci/pcie/Kconfig
@@ -92,7 +92,7 @@ config PCIE_PME
 
 config PCIE_DPC
 	bool "PCIe Downstream Port Containment support"
-	depends on PCIEPORTBUS
+	depends on PCIEPORTBUS && PCIEAER
 	default n
 	help
 	  This enables PCI Express Downstream Port Containment (DPC)
diff --git a/drivers/pci/pcie/pcie-dpc.c b/drivers/pci/pcie/pcie-dpc.c
index 2d976a623ddc..ef71a472592c 100644
--- a/drivers/pci/pcie/pcie-dpc.c
+++ b/drivers/pci/pcie/pcie-dpc.c
@@ -15,6 +15,7 @@
 #include <linux/pci.h>
 #include <linux/pcieport_if.h>
 #include "../pci.h"
+#include "aer/aerdrv.h"
 
 struct rp_pio_header_log_regs {
 	u32 dw0;
@@ -289,6 +290,9 @@ static int dpc_probe(struct pcie_device *dev)
 	int status;
 	u16 ctl, cap;
 
+	if (pcie_aer_get_firmware_first(pdev))
+		return -ENOTSUPP;
+
 	dpc = devm_kzalloc(device, sizeof(*dpc), GFP_KERNEL);
 	if (!dpc)
 		return -ENOMEM;
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
index a59210350c44..ef3bad4ad010 100644
--- a/drivers/pci/pcie/portdrv_core.c
+++ b/drivers/pci/pcie/portdrv_core.c
@@ -216,9 +216,9 @@ static int get_port_device_capability(struct pci_dev *dev)
 		return 0;
 
 	cap_mask = PCIE_PORT_SERVICE_PME | PCIE_PORT_SERVICE_HP
-			| PCIE_PORT_SERVICE_VC | PCIE_PORT_SERVICE_DPC;
+			| PCIE_PORT_SERVICE_VC;
 	if (pci_aer_available())
-		cap_mask |= PCIE_PORT_SERVICE_AER;
+		cap_mask |= PCIE_PORT_SERVICE_AER | PCIE_PORT_SERVICE_DPC;
 
 	if (pcie_ports_auto)
 		pcie_port_platform_notify(dev, &cap_mask);
-- 
2.13.6

  parent reply	other threads:[~2017-12-19 21:03 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-19 21:06 [PATCH 1/4] PCI/AER: Return approrpiate value when AER is not supported Keith Busch
2017-12-19 21:06 ` [PATCH 2/4] PCI/AER: Provide API for getting AER information Keith Busch
2017-12-19 21:06 ` Keith Busch [this message]
2018-01-15 14:43   ` [PATCH 3/4] PCI/DPC: Enable DPC in conjuction with AER Sinan Kaya
2018-01-16  1:33     ` Keith Busch
2018-01-16  3:04       ` Sinan Kaya
2017-12-19 21:06 ` [PATCH 4/4] PCI/DPC: Print AER status in DPC event handling Keith Busch
2017-12-21  4:43   ` Sinan Kaya
2017-12-21  5:12     ` Keith Busch
2018-01-10 15:52       ` Sinan Kaya
2018-01-16  2:47         ` Keith Busch
2018-01-17  0:56           ` Bjorn Helgaas
2018-01-17  1:34             ` Keith Busch
2018-01-17 13:36             ` Sinan Kaya
2018-01-12 23:03   ` Bjorn Helgaas
2018-01-14  1:35     ` Keith Busch
2018-01-15 14:32       ` Sinan Kaya
2018-01-17  0:36         ` Bjorn Helgaas
2018-01-17  0:14       ` Bjorn Helgaas
2017-12-21  1:04 ` [PATCH 1/4] PCI/AER: Return approrpiate value when AER is not supported Bjorn Helgaas
2017-12-21  3:53   ` Dongdong Liu
2017-12-21 14:59   ` Keith Busch
2018-03-20 23:02 ` Bjorn Helgaas
2018-03-21 22:27   ` Keith Busch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171219210643.24615-3-keith.busch@intel.com \
    --to=keith.busch@intel.com \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=mbroemme@libmpq.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox