linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI/DPC: Allow Non-ACPI Native ports to use DPC
@ 2020-04-16 19:59 Jon Derrick
  2020-04-16 20:32 ` Kuppuswamy, Sathyanarayanan
  0 siblings, 1 reply; 3+ messages in thread
From: Jon Derrick @ 2020-04-16 19:59 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Jon Derrick, Russell Currey, Sam Bobroff, Oliver O'Halloran,
	Bjorn Helgaas, Kuppuswamy Sathyanarayanan, Olof Johansson,
	Keith Busch, Frederick Lawler, linuxppc-dev, linux-pci,
	linux-kernel

Some platforms have a mix of ports whose capabilities can be negotiated
by _OSC, and some ports which are not described by ACPI and instead
managed by Native drivers. The existing Firmware-First HEST model can
incorrectly tag these Native, Non-ACPI ports as Firmware-First capable
ports by advertising the HEST Global flag and specifying the type and
class (aer_hest_parse).

This ultimately can lead to bad situations if the BIOS or port firmware
leaves DPC preconfigured and the Linux DPC driver is unable to bind to
the port to handle DPC events.

This patch adds the check for Native DPC in the port's host bridge in
order to allow DPC services to bind to the port.

Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
---
 drivers/pci/pcie/dpc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c
index 7621704..a1e355d 100644
--- a/drivers/pci/pcie/dpc.c
+++ b/drivers/pci/pcie/dpc.c
@@ -281,10 +281,12 @@ static int dpc_probe(struct pcie_device *dev)
 {
 	struct pci_dev *pdev = dev->port;
 	struct device *device = &dev->device;
+	struct pci_host_bridge *host = pci_find_host_bridge(pdev->bus);
 	int status;
 	u16 ctl, cap;
 
-	if (pcie_aer_get_firmware_first(pdev) && !pcie_ports_dpc_native)
+	if (pcie_aer_get_firmware_first(pdev) && !pcie_ports_dpc_native &&
+	    !host->native_dpc)
 		return -ENOTSUPP;
 
 	status = devm_request_threaded_irq(device, dev->irq, dpc_irq,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-16 20:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-16 19:59 [PATCH] PCI/DPC: Allow Non-ACPI Native ports to use DPC Jon Derrick
2020-04-16 20:32 ` Kuppuswamy, Sathyanarayanan
2020-04-16 20:50   ` Derrick, Jonathan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).