Skip to contentSkip to conversation

PCI: Add setup_platform_service_irq hook to struct pci_host_bridge

PATCH RESEND In review Stefan Roese 3 participants 13 messages Jan 12, 2022 – Jan 13, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND v2 1/4 PCI: Add setup_platform_service_irq hook to struct pci_host_bridge

From: Bharat Kumar Gogada <[email protected]>

As per section 6.2.4.1.2, 6.2.6 in PCIe r4.0 error interrupts can be delivered with platform specific interrupt lines. Add setup_platform_service_irq hook to struct pci_host_bridge. Some platforms have dedicated interrupt line from root complex to interrupt controller for PCIe services like AER.
This hook is to register platform IRQ's to PCIe port services.

---
 include/linux/pci.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/pci.h +2 -0
index 18a75c8e615c..291eadade811 100644
@@ -554,6 +554,8 @@ struct pci_host_bridge {
 	u8 (*swizzle_irq)(struct pci_dev *, u8 *); /* Platform IRQ swizzler */
 	int (*map_irq)(const struct pci_dev *, u8, u8);
 	void (*release_fn)(struct pci_host_bridge *);
+	void (*setup_platform_service_irq)(struct pci_host_bridge *, int *,
+					   int);
 	void		*release_data;
 	unsigned int	ignore_reset_delay:1;	/* For entire hierarchy */
 	unsigned int	no_ext_tags:1;		/* No Extended Tags */
Signature · 1 line
2.34.1
#1 lore raw

PATCH RESEND v2 2/4 PCI: Add pci_check_platform_service_irqs

From: Bharat Kumar Gogada <[email protected]>

Adding method pci_check_platform_service_irqs to check if platform has registered method to proivde dedicated IRQ lines for PCIe services like AER.

---
 include/linux/pci.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
include/linux/pci.h +18 -0
index 291eadade811..d6812d596ecc 100644
@@ -2420,6 +2420,24 @@ static inline bool pci_ari_enabled(struct pci_bus *bus)
 	return bus->self && bus->self->ari_enabled;
 }
 
+/**
+ * pci_check_platform_service_irqs - check platform service irq's
+ * @pdev: PCI Express device to check
+ * @irqs: Array of irqs to populate
+ * @mask: Bitmask of capabilities
+ */
+static inline void pci_check_platform_service_irqs(struct pci_dev *dev,
+						   int *irqs, int mask)
+{
+	struct pci_host_bridge *bridge;
+
+	if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT) {
+		bridge = pci_find_host_bridge(dev->bus);
+		if (bridge && bridge->setup_platform_service_irq)
+			bridge->setup_platform_service_irq(bridge, irqs, mask);
+	}
+}
+
 /**
  * pci_is_thunderbolt_attached - whether device is on a Thunderbolt daisy chain
  * @pdev: PCI device to check
Signature · 1 line
2.34.1
#2 lore raw

Re: [RESEND PATCH v2 2/4] PCI: Add pci_check_platform_service_irqs

Quoted 31 lines · Stefan Roese

From: Bharat Kumar Gogada <[email protected]>

Adding method pci_check_platform_service_irqs to check if platform has registered method to proivde dedicated IRQ lines for PCIe services like AER.

---
 include/linux/pci.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
include/linux/pci.h +7 -0
index 291eadade811..d6812d596ecc 100644
@@ -2420,6 +2420,24 @@ static inline bool pci_ari_enabled(struct pci_bus *bus)
 	return bus->self && bus->self->ari_enabled;
 }
 
+/**
+ * pci_check_platform_service_irqs - check platform service irq's
+ * @pdev: PCI Express device to check
+ * @irqs: Array of irqs to populate
+ * @mask: Bitmask of capabilities
+ */
+static inline void pci_check_platform_service_irqs(struct pci_dev *dev,

include/linux/pci.h static inline bool pci_ari_enabled(struct pci_bus *bus) · line 2439

Quoted 10 lines
include/linux/pci.h +10 -0
+						   int *irqs, int mask)
+{
+	struct pci_host_bridge *bridge;
+
+	if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT) {
+		bridge = pci_find_host_bridge(dev->bus);
+		if (bridge && bridge->setup_platform_service_irq)
+			bridge->setup_platform_service_irq(bridge, irqs, mask);
+	}
+}

I don't think this needs to be in include/linux/pci.h; I think it should be in drivers/pci/pcie/portdrv_core.c where it is called.

The name and signature should be parallel to pcie_init_service_irqs() since it is basically doing the same thing for platform-specific interrupts.

These patches are split up a little bit *too* much. Each one should add some piece of functionality. Currently they add declarations that are not used, functions that are not called, etc. That makes it hard to read one patch and get any idea of what it's for.

Bjorn

#3 lore raw

Re: [RESEND PATCH v2 2/4] PCI: Add pci_check_platform_service_irqs

Quoted 37 lines · Bjorn Helgaas
Quoted 36 lines · Stefan Roese

From: Bharat Kumar Gogada <[email protected]>

Adding method pci_check_platform_service_irqs to check if platform has registered method to proivde dedicated IRQ lines for PCIe services like AER.

---
  include/linux/pci.h | 18 ++++++++++++++++++
  1 file changed, 18 insertions(+)
include/linux/pci.h +12 -0
index 291eadade811..d6812d596ecc 100644
@@ -2420,6 +2420,24 @@ static inline bool pci_ari_enabled(struct pci_bus *bus)
  	return bus->self && bus->self->ari_enabled;
  }
 
+/**
+ * pci_check_platform_service_irqs - check platform service irq's
+ * @pdev: PCI Express device to check
+ * @irqs: Array of irqs to populate
+ * @mask: Bitmask of capabilities
+ */
+static inline void pci_check_platform_service_irqs(struct pci_dev *dev,
+						   int *irqs, int mask)
+{
+	struct pci_host_bridge *bridge;
+
+	if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT) {
Quoted 8 lines

include/linux/pci.h static inline bool pci_ari_enabled(struct pci_bus *bus) · line 2439

Quoted 5 lines
include/linux/pci.h +5 -0
+		bridge = pci_find_host_bridge(dev->bus);
+		if (bridge && bridge->setup_platform_service_irq)
+			bridge->setup_platform_service_irq(bridge, irqs, mask);
+	}
+}

I don't think this needs to be in include/linux/pci.h; I think it should be in drivers/pci/pcie/portdrv_core.c where it is called.

Agreed.

Quoted 3 lines

The name and signature should be parallel to pcie_init_service_irqs() since it is basically doing the same thing for platform-specific interrupts.

I've changed it now to pcie_init_platform_service_irqs(). Just let me know if you had some other naming in mind.

Quoted 4 lines

These patches are split up a little bit *too* much. Each one should add some piece of functionality. Currently they add declarations that are not used, functions that are not called, etc. That makes it hard to read one patch and get any idea of what it's for.

Agreed. Let me see, how this is best done. Most likely 2 patches, one adding the new infrastructure to the PCIe subsystem and one adding the "user" to the Xilinx PCIe controller driver.

Thanks,
Stefan

#4 lore raw

PATCH RESEND v2 3/4 PCI/portdrv: Check platform supported service IRQ's

In reply to Stefan Roese

From: Bharat Kumar Gogada <[email protected]>

Platforms may have dedicated IRQ lines for PCIe services like AER/PME etc., check for such IRQ lines.
Check if platform has any dedicated IRQ lines for PCIe services.

---
 drivers/pci/pcie/portdrv_core.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/pci/pcie/portdrv_core.c +8 -0
index bda630889f95..70dd45671ed8 100644
@@ -358,6 +358,14 @@ int pcie_port_device_register(struct pci_dev *dev)
 		}
 	}
 
+	/*
+	 * Some platforms have dedicated interrupt line from root complex to
+	 * interrupt controller for PCIe services like AER/PME etc., check
+	 * if platform registered with any such IRQ.
+	 */
+	if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT)
+		pci_check_platform_service_irqs(dev, irqs, capabilities);
+
 	/* Allocate child services if any */
 	status = -ENODEV;
 	nr_service = 0;
Signature · 1 line
2.34.1
#5 lore raw

Re: [RESEND PATCH v2 3/4] PCI/portdrv: Check platform supported service IRQ's

Quoted 23 lines · On Wednesday 12 January 2022 10:42:50 Stefan Roese wrote:

From: Bharat Kumar Gogada <[email protected]>

Platforms may have dedicated IRQ lines for PCIe services like AER/PME etc., check for such IRQ lines.
Check if platform has any dedicated IRQ lines for PCIe services.

---
 drivers/pci/pcie/portdrv_core.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/pci/pcie/portdrv_core.c +0 -0
index bda630889f95..70dd45671ed8 100644
@@ -358,6 +358,14 @@ int pcie_port_device_register(struct pci_dev *dev)
 		}

drivers/pci/pcie/portdrv_core.c int pcie_port_device_register(struct pci_dev *dev) · line 368

Quoted 10 lines
drivers/pci/pcie/portdrv_core.c +8 -0
 	}
 
+	/*
+	 * Some platforms have dedicated interrupt line from root complex to
+	 * interrupt controller for PCIe services like AER/PME etc., check
+	 * if platform registered with any such IRQ.
+	 */
+	if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT)
+		pci_check_platform_service_irqs(dev, irqs, capabilities);
+

In my opinion calling this hook at this stage is too late. Few lines above is following code:

	if (irq_services) {
		/*
		 * Initialize service IRQs. Don't use service devices that
		 * require interrupts if there is no way to generate them.
		 * However, some drivers may have a polling mode (e.g.
		 * pciehp_poll_mode) that can be used in the absence of IRQs.
		 * Allow them to determine if that is to be used.
		 */
		status = pcie_init_service_irqs(dev, irqs, irq_services);
		if (status) {
			irq_services &= PCIE_PORT_SERVICE_HP;
			if (!irq_services)
				goto error_disable;
		}
	}

Function pcie_init_service_irqs() fails if "dev" does not have any suitable interrupt. Which happens for devices / root ports without support for standard interrupts (INTx / MSI).

I think that this new hook should have preference over pcie_init_service_irqs() and after this new hook should be pcie_init_service_irqs() called only for irq_services which new hook has not filled. And if at least new hook or pcie_init_service_irqs() passes then "error_disable" path should not be called.

Quoted 6 lines
drivers/pci/pcie/portdrv_core.c +0 -0
 	/* Allocate child services if any */
 	status = -ENODEV;
 	nr_service = 0;
Signature · 1 line
2.34.1
#6 lore raw

Re: [RESEND PATCH v2 3/4] PCI/portdrv: Check platform supported service IRQ's

Quoted 7 lines · Pali Rohár
Quoted 6 lines · On Wednesday 12 January 2022 10:42:50 Stefan Roese wrote:

From: Bharat Kumar Gogada <[email protected]>

Platforms may have dedicated IRQ lines for PCIe services like AER/PME etc., check for such IRQ lines.
Check if platform has any dedicated IRQ lines for PCIe services.

Use the terminology from the spec again ("platform-specific System Errors").

Quoted 50 lines
Quoted 16 lines
---
 drivers/pci/pcie/portdrv_core.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/pci/pcie/portdrv_core.c +0 -0
index bda630889f95..70dd45671ed8 100644
@@ -358,6 +358,14 @@ int pcie_port_device_register(struct pci_dev *dev)
 		}

drivers/pci/pcie/portdrv_core.c int pcie_port_device_register(struct pci_dev *dev) · line 368

Quoted 10 lines
drivers/pci/pcie/portdrv_core.c +8 -0
 	}
 
+	/*
+	 * Some platforms have dedicated interrupt line from root complex to
+	 * interrupt controller for PCIe services like AER/PME etc., check
+	 * if platform registered with any such IRQ.
+	 */
+	if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT)
+		pci_check_platform_service_irqs(dev, irqs, capabilities);
+

In my opinion calling this hook at this stage is too late. Few lines above is following code:

	if (irq_services) {
		/*
		 * Initialize service IRQs. Don't use service devices that
		 * require interrupts if there is no way to generate them.
		 * However, some drivers may have a polling mode (e.g.
		 * pciehp_poll_mode) that can be used in the absence of IRQs.
		 * Allow them to determine if that is to be used.
		 */
		status = pcie_init_service_irqs(dev, irqs, irq_services);
		if (status) {
			irq_services &= PCIE_PORT_SERVICE_HP;
			if (!irq_services)
				goto error_disable;
		}
	}

Function pcie_init_service_irqs() fails if "dev" does not have any suitable interrupt. Which happens for devices / root ports without support for standard interrupts (INTx / MSI).

Quoted 5 lines

I think that this new hook should have preference over pcie_init_service_irqs() and after this new hook should be pcie_init_service_irqs() called only for irq_services which new hook has not filled. And if at least new hook or pcie_init_service_irqs() passes then "error_disable" path should not be called.

I tend to agree. I expect that a host bridge will only use this new mechanism if the standard INTx/MSI interrupts don't work.

I guess it's possible a device could use platform-specific errors for some services and standard INTx/MSI for others, but unless we have an example of that, I'm not sure it's worth trying to support that.

For now, I think it will be simpler to skip pcie_init_service_irqs() completely if the platform-specific hook is successful.

Bjorn

#7 lore raw

Re: [RESEND PATCH v2 3/4] PCI/portdrv: Check platform supported service IRQ's

Quoted 11 lines · Bjorn Helgaas
Quoted 7 lines · Pali Rohár
Quoted 6 lines · On Wednesday 12 January 2022 10:42:50 Stefan Roese wrote:

From: Bharat Kumar Gogada <[email protected]>

Platforms may have dedicated IRQ lines for PCIe services like AER/PME etc., check for such IRQ lines.
Check if platform has any dedicated IRQ lines for PCIe services.

Use the terminology from the spec again ("platform-specific System Errors").

Ok.

Quoted 59 lines
Quoted 50 lines
Quoted 16 lines
---
  drivers/pci/pcie/portdrv_core.c | 8 ++++++++
  1 file changed, 8 insertions(+)
drivers/pci/pcie/portdrv_core.c +0 -0
index bda630889f95..70dd45671ed8 100644
@@ -358,6 +358,14 @@ int pcie_port_device_register(struct pci_dev *dev)
  		}

drivers/pci/pcie/portdrv_core.c int pcie_port_device_register(struct pci_dev *dev) · line 368

Quoted 10 lines
drivers/pci/pcie/portdrv_core.c +8 -0
  	}
 
+	/*
+	 * Some platforms have dedicated interrupt line from root complex to
+	 * interrupt controller for PCIe services like AER/PME etc., check
+	 * if platform registered with any such IRQ.
+	 */
+	if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT)
+		pci_check_platform_service_irqs(dev, irqs, capabilities);
+

In my opinion calling this hook at this stage is too late. Few lines above is following code:

	if (irq_services) {
		/*
		 * Initialize service IRQs. Don't use service devices that
		 * require interrupts if there is no way to generate them.
		 * However, some drivers may have a polling mode (e.g.
		 * pciehp_poll_mode) that can be used in the absence of IRQs.
		 * Allow them to determine if that is to be used.
		 */
		status = pcie_init_service_irqs(dev, irqs, irq_services);
		if (status) {
			irq_services &= PCIE_PORT_SERVICE_HP;
			if (!irq_services)
				goto error_disable;
		}
	}

Function pcie_init_service_irqs() fails if "dev" does not have any suitable interrupt. Which happens for devices / root ports without support for standard interrupts (INTx / MSI).

Quoted 5 lines

I think that this new hook should have preference over pcie_init_service_irqs() and after this new hook should be pcie_init_service_irqs() called only for irq_services which new hook has not filled. And if at least new hook or pcie_init_service_irqs() passes then "error_disable" path should not be called.

I tend to agree. I expect that a host bridge will only use this new mechanism if the standard INTx/MSI interrupts don't work.

Quoted 6 lines

I guess it's possible a device could use platform-specific errors for some services and standard INTx/MSI for others, but unless we have an example of that, I'm not sure it's worth trying to support that.

For now, I think it will be simpler to skip pcie_init_service_irqs() completely if the platform-specific hook is successful.

Understood. I'll make the necessary changes in v3.

Thanks,
Stefan

#8 lore raw

PATCH RESEND v2 4/4 PCI: xilinx-nwl: Add method to setup_platform_service_irq hook

In reply to Stefan Roese

From: Bharat Kumar Gogada <[email protected]>

Add nwl_setup_service_irqs hook to setup_platform_service_irq to register platform provided IRQ number to kernel AER service.

---
 drivers/pci/controller/pcie-xilinx-nwl.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/pci/controller/pcie-xilinx-nwl.c +12 -0
index 414b679175b3..4969f35db7e5 100644
@@ -24,6 +24,7 @@
 #include <linux/irqchip/chained_irq.h>
 
 #include "../pci.h"
+#include "../pcie/portdrv.h"
 
 /* Bridge core config registers */
 #define BRCFG_PCIE_RX0			0x00000000
@@ -806,6 +807,16 @@ static int nwl_pcie_parse_dt(struct nwl_pcie *pcie,
 	return 0;
 }
 
+static void nwl_setup_service_irqs(struct pci_host_bridge *bridge, int *irqs,
+				   int plat_mask)
+{
+	struct nwl_pcie *pcie;
+
+	pcie = pci_host_bridge_priv(bridge);
+	if (plat_mask & PCIE_PORT_SERVICE_AER)
+		irqs[PCIE_PORT_SERVICE_AER_SHIFT] = pcie->irq_misc;
+}
+
 static const struct of_device_id nwl_pcie_of_match[] = {
 	{ .compatible = "xlnx,nwl-pcie-2.11", },
 	{}
@@ -857,6 +868,7 @@ static int nwl_pcie_probe(struct platform_device *pdev)
 
 	bridge->sysdata = pcie;
 	bridge->ops = &nwl_pcie_ops;
+	bridge->setup_platform_service_irq = nwl_setup_service_irqs;
 
 	if (IS_ENABLED(CONFIG_PCI_MSI)) {
 		err = nwl_pcie_enable_msi(pcie);
Signature · 1 line
2.34.1
#9 lore raw
In reply to Stefan Roese

Hello!

Quoted 4 lines · On Wednesday 12 January 2022 10:42:48 Stefan Roese wrote:

From: Bharat Kumar Gogada <[email protected]>

As per section 6.2.4.1.2, 6.2.6 in PCIe r4.0 error interrupts can be delivered with platform specific interrupt lines.

My understanding of these sections is that they still have to be deliverable via standard interrupts (INTx / MSI) if root port supports standard interrupts:

"If a Root Port or Root Complex Event Collector is enabled for level-triggered interrupt signaling using the INTx messages, the virtual INTx wire must be asserted..."

"If a Root Port or Root Complex Event Collector is enabled for edge-triggered interrupt signaling using MSI or MSI-X, an interrupt message must be sent every time..."

Quoted 20 lines

Add setup_platform_service_irq hook to struct pci_host_bridge. Some platforms have dedicated interrupt line from root complex to interrupt controller for PCIe services like AER.
This hook is to register platform IRQ's to PCIe port services.

---
 include/linux/pci.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/pci.h +0 -0
index 18a75c8e615c..291eadade811 100644

include/linux/pci.h struct pci_host_bridge { · line 558

Quoted 5 lines
include/linux/pci.h +2 -0
@@ -554,6 +554,8 @@ struct pci_host_bridge {
 	u8 (*swizzle_irq)(struct pci_dev *, u8 *); /* Platform IRQ swizzler */
 	int (*map_irq)(const struct pci_dev *, u8, u8);
 	void (*release_fn)(struct pci_host_bridge *);
+	void (*setup_platform_service_irq)(struct pci_host_bridge *, int *,
+					   int);

This callback is used only for root port. So I would suggest to put _root port_ into the name of the callback to indicate it. To distinguish for which devices is callback designed because other callbacks (e.g. map_irq) are used for any device.

This callback is root port specific and therefore struct pci_dev * pointer should be passed as callback argument. Host bridge may have multiple root ports, so passing only host bridge is not enough.

Maybe it would be better to pass struct pci_dev * instead of struct pci_host_bridge * As from pci_dev can be easily derived host bridge.

Anyway, this callback looks to be very useful, I would like to use it in pci-aardvark.c and pci-mvebu.c drivers for better mapping of PME, AER and HP interrupts. And pci-mvebu.c is multi root port driver, so needs pci_dev*.

And my guess is that this callback can be useful for adding AER support also for pcie-uniphier.c driver, as replacement for this (rather ugly) patches:
https://lore.kernel.org/linux-pci/[email protected]/

So I would be happy to see it!

Quoted 6 lines
include/linux/pci.h +0 -0
 	void		*release_data;
 	unsigned int	ignore_reset_delay:1;	/* For entire hierarchy */
 	unsigned int	no_ext_tags:1;		/* No Extended Tags */
Signature · 1 line
2.34.1
#10 lore raw
Quoted 35 lines · Pali Rohár

Hello!

Quoted 4 lines · On Wednesday 12 January 2022 10:42:48 Stefan Roese wrote:

From: Bharat Kumar Gogada <[email protected]>

As per section 6.2.4.1.2, 6.2.6 in PCIe r4.0 error interrupts can be delivered with platform specific interrupt lines.

My understanding of these sections is that they still have to be deliverable via standard interrupts (INTx / MSI) if root port supports standard interrupts:

"If a Root Port or Root Complex Event Collector is enabled for level-triggered interrupt signaling using the INTx messages, the virtual INTx wire must be asserted..."

"If a Root Port or Root Complex Event Collector is enabled for edge-triggered interrupt signaling using MSI or MSI-X, an interrupt message must be sent every time..."

Quoted 15 lines

Add setup_platform_service_irq hook to struct pci_host_bridge. Some platforms have dedicated interrupt line from root complex to interrupt controller for PCIe services like AER.
This hook is to register platform IRQ's to PCIe port services.

---
  include/linux/pci.h | 2 ++
  1 file changed, 2 insertions(+)
Quoted 15 lines

include/linux/pci.h struct pci_host_bridge { · line 558

Quoted 10 lines
include/linux/pci.h +2 -0
index 18a75c8e615c..291eadade811 100644
@@ -554,6 +554,8 @@ struct pci_host_bridge {
  	u8 (*swizzle_irq)(struct pci_dev *, u8 *); /* Platform IRQ swizzler */
  	int (*map_irq)(const struct pci_dev *, u8, u8);
  	void (*release_fn)(struct pci_host_bridge *);
+	void (*setup_platform_service_irq)(struct pci_host_bridge *, int *,
+					   int);

This callback is used only for root port. So I would suggest to put _root port_ into the name of the callback to indicate it. To distinguish for which devices is callback designed because other callbacks (e.g. map_irq) are used for any device.

I see your point, but I also don't want to make this function name too long, making the code harder to read IMHO. In the next patchset version I've changed this name to init_platform_service_irqs (added 's') to better reflect the input parameters and its related function in portdrv_core.c, which I now changed according to Bjorn's suggestion to pcie_init_platform_service_irqs().

Please feel free to suggest a better matching name that is not too long if one comes to your mind.

Quoted 6 lines

This callback is root port specific and therefore struct pci_dev * pointer should be passed as callback argument. Host bridge may have multiple root ports, so passing only host bridge is not enough.

Maybe it would be better to pass struct pci_dev * instead of struct pci_host_bridge * As from pci_dev can be easily derived host bridge.

Good idea. I'll integrate this in the next version.

Quoted 4 lines

Anyway, this callback looks to be very useful, I would like to use it in pci-aardvark.c and pci-mvebu.c drivers for better mapping of PME, AER and HP interrupts. And pci-mvebu.c is multi root port driver, so needs pci_dev*.

Sounds like a plan.

Quoted 6 lines

And my guess is that this callback can be useful for adding AER support also for pcie-uniphier.c driver, as replacement for this (rather ugly) patches:
https://lore.kernel.org/linux-pci/[email protected]/

So I would be happy to see it!

Stay tuned...

Thanks,
Stefan

#11 lore raw
In reply to Stefan Roese
Quoted 9 lines · Stefan Roese

From: Bharat Kumar Gogada <[email protected]>

As per section 6.2.4.1.2, 6.2.6 in PCIe r4.0 error interrupts can be delivered with platform specific interrupt lines. Add setup_platform_service_irq hook to struct pci_host_bridge. Some platforms have dedicated interrupt line from root complex to interrupt controller for PCIe services like AER.
This hook is to register platform IRQ's to PCIe port services.

Quoted 6 lines

It would be nice if this included a cover letter like Bharat's original posting did [1]. That makes it easier to keep organized.

The PCIe r6.0 spec just came out, so let's update the spec references to that. Conveniently, the section numbers stayed the same as they were in r4.0.

Update the language here to use the spec terminology, i.e., "platform-specific System Errors" That helps find the related bits, e.g., "System Error on Correctable Error Enable" in the Root Control register.

Rewrap this into paragraphs separated by blank lines.

[1] https://lore.kernel.org/all/[email protected]/

Quoted 20 lines
---
 include/linux/pci.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/pci.h +2 -0
index 18a75c8e615c..291eadade811 100644
@@ -554,6 +554,8 @@ struct pci_host_bridge {
 	u8 (*swizzle_irq)(struct pci_dev *, u8 *); /* Platform IRQ swizzler */
 	int (*map_irq)(const struct pci_dev *, u8, u8);
 	void (*release_fn)(struct pci_host_bridge *);
+	void (*setup_platform_service_irq)(struct pci_host_bridge *, int *,
+					   int);
 	void		*release_data;
 	unsigned int	ignore_reset_delay:1;	/* For entire hierarchy */
 	unsigned int	no_ext_tags:1;		/* No Extended Tags */
Signature · 1 line
2.34.1
#12 lore raw
Quoted 17 lines · Bjorn Helgaas
Quoted 9 lines · Stefan Roese

From: Bharat Kumar Gogada <[email protected]>

As per section 6.2.4.1.2, 6.2.6 in PCIe r4.0 error interrupts can be delivered with platform specific interrupt lines. Add setup_platform_service_irq hook to struct pci_host_bridge. Some platforms have dedicated interrupt line from root complex to interrupt controller for PCIe services like AER.
This hook is to register platform IRQ's to PCIe port services.

Quoted 6 lines
Quoted 2 lines

It would be nice if this included a cover letter like Bharat's original posting did [1]. That makes it easier to keep organized.

I wanted to do this, but somehow forgot it when sending the patches. Will do in the next version for sure.

Quoted 4 lines

The PCIe r6.0 spec just came out, so let's update the spec references to that. Conveniently, the section numbers stayed the same as they were in r4.0.

Quoted 8 lines

Update the language here to use the spec terminology, i.e., "platform-specific System Errors" That helps find the related bits, e.g., "System Error on Correctable Error Enable" in the Root Control register.

Rewrap this into paragraphs separated by blank lines.

[1] https://lore.kernel.org/all/[email protected]/

Okay, I'll try to update these descriptions accordingly in v3.

Thanks,
Stefan

Quoted 20 lines
Quoted 20 lines
---
  include/linux/pci.h | 2 ++
  1 file changed, 2 insertions(+)
include/linux/pci.h +2 -0
index 18a75c8e615c..291eadade811 100644
@@ -554,6 +554,8 @@ struct pci_host_bridge {
  	u8 (*swizzle_irq)(struct pci_dev *, u8 *); /* Platform IRQ swizzler */
  	int (*map_irq)(const struct pci_dev *, u8, u8);
  	void (*release_fn)(struct pci_host_bridge *);
+	void (*setup_platform_service_irq)(struct pci_host_bridge *, int *,
+					   int);
  	void		*release_data;
  	unsigned int	ignore_reset_delay:1;	/* For entire hierarchy */
  	unsigned int	no_ext_tags:1;		/* No Extended Tags */
Signature · 1 line
2.34.1