All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Add support to register platform service IRQ
@ 2018-11-14 14:47 Bharat Kumar Gogada
  2018-11-14 14:47 ` [PATCH v2 1/4] PCI: Add setup_platform_service_irq hook to struct pci_host_bridge Bharat Kumar Gogada
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Bharat Kumar Gogada @ 2018-11-14 14:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: bhelgaas, rgummal, Bharat Kumar Gogada

Some platforms have dedicated IRQ lines for PCIe services like AER/PME etc.
The root complex on these platform will use these seperate IRQ lines to
report AER/PME etc., interrupts and will not generate MSI/MSI-X/INTx interrupts
for these services.
These patches will add new method for these kind of platforms to register the
platform IRQ number with respective PCIe services.

Bharat Kumar Gogada (4):
  PCI: Add setup_platform_service_irq hook to struct pci_host_bridge
  PCI: Add pci_check_platform_service_irqs
  PCI/portdrv: Check platform supported service IRQ's
  PCI: xilinx-nwl: Add method to setup_platform_service_irq hook

 drivers/pci/controller/pcie-xilinx-nwl.c | 12 ++++++++++++
 drivers/pci/pcie/portdrv_core.c          |  8 ++++++++
 include/linux/pci.h                      | 20 ++++++++++++++++++++
 3 files changed, 40 insertions(+)

-- 
2.7.4


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

* [PATCH v2 1/4] PCI: Add setup_platform_service_irq hook to struct pci_host_bridge
  2018-11-14 14:47 [PATCH v2 0/4] Add support to register platform service IRQ Bharat Kumar Gogada
@ 2018-11-14 14:47 ` Bharat Kumar Gogada
  2018-11-14 14:47 ` [PATCH v2 2/4] PCI: Add pci_check_platform_service_irqs Bharat Kumar Gogada
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Bharat Kumar Gogada @ 2018-11-14 14:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: bhelgaas, rgummal, Bharat Kumar Gogada

As per section 6.2.4.1.2, 6.2.6 in PCIe r4.0 error interrupts can
be delivered with paltform 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.

Signed-off-by: Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>
---
 include/linux/pci.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index 11c71c4..28e5e06b 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -481,6 +481,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;
 	struct msi_controller *msi;
 	unsigned int	ignore_reset_delay:1;	/* For entire hierarchy */
-- 
2.7.4


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

* [PATCH v2 2/4] PCI: Add pci_check_platform_service_irqs
  2018-11-14 14:47 [PATCH v2 0/4] Add support to register platform service IRQ Bharat Kumar Gogada
  2018-11-14 14:47 ` [PATCH v2 1/4] PCI: Add setup_platform_service_irq hook to struct pci_host_bridge Bharat Kumar Gogada
@ 2018-11-14 14:47 ` Bharat Kumar Gogada
  2018-11-14 14:47 ` [PATCH v2 3/4] PCI/portdrv: Check platform supported service IRQ's Bharat Kumar Gogada
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Bharat Kumar Gogada @ 2018-11-14 14:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: bhelgaas, rgummal, Bharat Kumar Gogada

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

Signed-off-by: Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>
---
 include/linux/pci.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index 28e5e06b..4fd54c2 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -2307,6 +2307,24 @@ static inline bool pci_ari_enabled(struct pci_bus *bus)
 }
 
 /**
+ * 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
  *
-- 
2.7.4


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

* [PATCH v2 3/4] PCI/portdrv: Check platform supported service IRQ's
  2018-11-14 14:47 [PATCH v2 0/4] Add support to register platform service IRQ Bharat Kumar Gogada
  2018-11-14 14:47 ` [PATCH v2 1/4] PCI: Add setup_platform_service_irq hook to struct pci_host_bridge Bharat Kumar Gogada
  2018-11-14 14:47 ` [PATCH v2 2/4] PCI: Add pci_check_platform_service_irqs Bharat Kumar Gogada
@ 2018-11-14 14:47 ` Bharat Kumar Gogada
  2018-11-14 14:47 ` [PATCH v2 4/4] PCI: xilinx-nwl: Add method to setup_platform_service_irq hook Bharat Kumar Gogada
  2018-12-06 15:47 ` [PATCH v2 0/4] Add support to register platform service IRQ Bharat Kumar Gogada
  4 siblings, 0 replies; 6+ messages in thread
From: Bharat Kumar Gogada @ 2018-11-14 14:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: bhelgaas, rgummal, Bharat Kumar Gogada

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.

Signed-off-by: Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>
---
 drivers/pci/pcie/portdrv_core.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
index f458ac9..8e37beb 100644
--- a/drivers/pci/pcie/portdrv_core.c
+++ b/drivers/pci/pcie/portdrv_core.c
@@ -330,6 +330,14 @@ int pcie_port_device_register(struct pci_dev *dev)
 			goto error_disable;
 	}
 
+	/*
+	 * 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;
-- 
2.7.4


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

* [PATCH v2 4/4] PCI: xilinx-nwl: Add method to setup_platform_service_irq hook
  2018-11-14 14:47 [PATCH v2 0/4] Add support to register platform service IRQ Bharat Kumar Gogada
                   ` (2 preceding siblings ...)
  2018-11-14 14:47 ` [PATCH v2 3/4] PCI/portdrv: Check platform supported service IRQ's Bharat Kumar Gogada
@ 2018-11-14 14:47 ` Bharat Kumar Gogada
  2018-12-06 15:47 ` [PATCH v2 0/4] Add support to register platform service IRQ Bharat Kumar Gogada
  4 siblings, 0 replies; 6+ messages in thread
From: Bharat Kumar Gogada @ 2018-11-14 14:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: bhelgaas, rgummal, Bharat Kumar Gogada

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

Signed-off-by: Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>
---
 drivers/pci/controller/pcie-xilinx-nwl.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/pci/controller/pcie-xilinx-nwl.c b/drivers/pci/controller/pcie-xilinx-nwl.c
index 81538d7..d22125d 100644
--- a/drivers/pci/controller/pcie-xilinx-nwl.c
+++ b/drivers/pci/controller/pcie-xilinx-nwl.c
@@ -22,6 +22,7 @@
 #include <linux/irqchip/chained_irq.h>
 
 #include "../pci.h"
+#include "../pcie/portdrv.h"
 
 /* Bridge core config registers */
 #define BRCFG_PCIE_RX0			0x00000000
@@ -810,6 +811,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", },
 	{}
@@ -871,6 +882,7 @@ static int nwl_pcie_probe(struct platform_device *pdev)
 	bridge->ops = &nwl_pcie_ops;
 	bridge->map_irq = of_irq_parse_and_map_pci;
 	bridge->swizzle_irq = pci_common_swizzle;
+	bridge->setup_platform_service_irq = nwl_setup_service_irqs;
 
 	if (IS_ENABLED(CONFIG_PCI_MSI)) {
 		err = nwl_pcie_enable_msi(pcie);
-- 
2.7.4


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

* RE: [PATCH v2 0/4] Add support to register platform service IRQ
  2018-11-14 14:47 [PATCH v2 0/4] Add support to register platform service IRQ Bharat Kumar Gogada
                   ` (3 preceding siblings ...)
  2018-11-14 14:47 ` [PATCH v2 4/4] PCI: xilinx-nwl: Add method to setup_platform_service_irq hook Bharat Kumar Gogada
@ 2018-12-06 15:47 ` Bharat Kumar Gogada
  4 siblings, 0 replies; 6+ messages in thread
From: Bharat Kumar Gogada @ 2018-12-06 15:47 UTC (permalink / raw)
  To: Bharat Kumar Gogada, linux-kernel; +Cc: bhelgaas, Ravikiran Gummaluri

Hi All,

Please let me know if anyone has any issue with this patch series.

Regards,
Bharat

> -----Original Message-----
> From: Bharat Kumar Gogada [mailto:bharat.kumar.gogada@xilinx.com]
> Sent: Wednesday, November 14, 2018 8:18 PM
> To: linux-kernel@vger.kernel.org
> Cc: bhelgaas@google.com; Ravikiran Gummaluri <rgummal@xilinx.com>;
> Bharat Kumar Gogada <bharatku@xilinx.com>
> Subject: [PATCH v2 0/4] Add support to register platform service IRQ
> 
> Some platforms have dedicated IRQ lines for PCIe services like AER/PME etc.
> The root complex on these platform will use these seperate IRQ lines to
> report AER/PME etc., interrupts and will not generate MSI/MSI-X/INTx
> interrupts for these services.
> These patches will add new method for these kind of platforms to register
> the platform IRQ number with respective PCIe services.
> 
> Bharat Kumar Gogada (4):
>   PCI: Add setup_platform_service_irq hook to struct pci_host_bridge
>   PCI: Add pci_check_platform_service_irqs
>   PCI/portdrv: Check platform supported service IRQ's
>   PCI: xilinx-nwl: Add method to setup_platform_service_irq hook
> 
>  drivers/pci/controller/pcie-xilinx-nwl.c | 12 ++++++++++++
>  drivers/pci/pcie/portdrv_core.c          |  8 ++++++++
>  include/linux/pci.h                      | 20 ++++++++++++++++++++
>  3 files changed, 40 insertions(+)
> 
> --
> 2.7.4


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

end of thread, other threads:[~2018-12-06 15:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-14 14:47 [PATCH v2 0/4] Add support to register platform service IRQ Bharat Kumar Gogada
2018-11-14 14:47 ` [PATCH v2 1/4] PCI: Add setup_platform_service_irq hook to struct pci_host_bridge Bharat Kumar Gogada
2018-11-14 14:47 ` [PATCH v2 2/4] PCI: Add pci_check_platform_service_irqs Bharat Kumar Gogada
2018-11-14 14:47 ` [PATCH v2 3/4] PCI/portdrv: Check platform supported service IRQ's Bharat Kumar Gogada
2018-11-14 14:47 ` [PATCH v2 4/4] PCI: xilinx-nwl: Add method to setup_platform_service_irq hook Bharat Kumar Gogada
2018-12-06 15:47 ` [PATCH v2 0/4] Add support to register platform service IRQ Bharat Kumar Gogada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.