All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V3 0/6] gicv2m: acpi: Add ACPI support for GICv2m MSI
@ 2015-10-21 18:47 ` Suravee Suthikulpanit
  0 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: marc.zyngier, tglx, jason, rjw
  Cc: Lorenzo Pieralisi, Will Deacon, Catalin Marinas, hanjun.guo,
	tomasz.nowicki, graeme.gregory, dhdang, linux-arm-kernel,
	linux-kernel, linux-acpi, Suravee Suthikulpanit

This patch series has been forked from the following patch series since
it no longer depends on the rest of the patches.

  [PATCH v4 00/10] ACPI GIC Self-probing, GICv2m and GICv3 support
  https://lkml.org/lkml/2015/7/29/234

It has been ported to use the newly introduced device fwnode_handle 
for ACPI irqdmain introduced by Marc in the following patch series:

  [PATCH v2 00/17] Divorcing irqdomain and device_node
  http://git.kernel.org/cgit/linux/kernel/git/maz/arm-platforms.git irq/irq-domain-fwnode-v2

The following git branch contains the submitted patches along with
the pre-requsite patches (mainly for ARM64 PCI support for ACPI).

  https://github.com/ssuthiku/linux.git	v2m-multiframe-v3

This has been tested on AMD Seattle (Overdrive) RevB system. 

NOTE: I have not tested ACPI GICv2m multiframe support since
I don't have access to such system. Any helps are appreciated.

Thanks,
Suravee

Changes from V2: (https://lkml.org/lkml/2015/10/14/1010)
  - Minor clean up from Tomasz review comment in patch 6/6.

Changes from V1: (https://lkml.org/lkml/2015/10/13/859)
  - Rebase on top of Marc's patch to addng support for multiple MSI frames
    (https://lkml.org/lkml/2015/10/14/271)
  - Adding fwnode convenient functions (patch 3 and 4)


Suravee Suthikulpanit (6):
  pci: msi: Add support to query MSI domain for pci device
  acpi: pci: Setup MSI domain for ACPI based pci devices
  irqdomain: introduce is_fwnode_irqchip helper
  irqdomain: Introduce irq_domain_get_irqchip_fwnode_name helper
    function
  gicv2m: Refactor to prepare for ACPI support
  gicv2m: acpi: Introducing GICv2m ACPI support

 drivers/irqchip/irq-gic-v2m.c   | 152 ++++++++++++++++++++++++++++++++++------
 drivers/irqchip/irq-gic.c       |   5 +-
 drivers/pci/msi.c               |  30 ++++++++
 drivers/pci/pci-acpi.c          |  13 ++++
 drivers/pci/probe.c             |   2 +
 include/linux/irqchip/arm-gic.h |   4 ++
 include/linux/irqdomain.h       |   6 ++
 include/linux/msi.h             |   7 ++
 include/linux/pci.h             |   7 ++
 kernel/irq/irqdomain.c          |  20 +++++-
 10 files changed, 223 insertions(+), 23 deletions(-)

-- 
2.1.0


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

* [PATCH V3 0/6] gicv2m: acpi: Add ACPI support for GICv2m MSI
@ 2015-10-21 18:47 ` Suravee Suthikulpanit
  0 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: marc.zyngier, tglx, jason, rjw
  Cc: Lorenzo Pieralisi, Will Deacon, Catalin Marinas, hanjun.guo,
	tomasz.nowicki, graeme.gregory, dhdang, linux-arm-kernel,
	linux-kernel, linux-acpi, Suravee Suthikulpanit

This patch series has been forked from the following patch series since
it no longer depends on the rest of the patches.

  [PATCH v4 00/10] ACPI GIC Self-probing, GICv2m and GICv3 support
  https://lkml.org/lkml/2015/7/29/234

It has been ported to use the newly introduced device fwnode_handle 
for ACPI irqdmain introduced by Marc in the following patch series:

  [PATCH v2 00/17] Divorcing irqdomain and device_node
  http://git.kernel.org/cgit/linux/kernel/git/maz/arm-platforms.git irq/irq-domain-fwnode-v2

The following git branch contains the submitted patches along with
the pre-requsite patches (mainly for ARM64 PCI support for ACPI).

  https://github.com/ssuthiku/linux.git	v2m-multiframe-v3

This has been tested on AMD Seattle (Overdrive) RevB system. 

NOTE: I have not tested ACPI GICv2m multiframe support since
I don't have access to such system. Any helps are appreciated.

Thanks,
Suravee

Changes from V2: (https://lkml.org/lkml/2015/10/14/1010)
  - Minor clean up from Tomasz review comment in patch 6/6.

Changes from V1: (https://lkml.org/lkml/2015/10/13/859)
  - Rebase on top of Marc's patch to addng support for multiple MSI frames
    (https://lkml.org/lkml/2015/10/14/271)
  - Adding fwnode convenient functions (patch 3 and 4)


Suravee Suthikulpanit (6):
  pci: msi: Add support to query MSI domain for pci device
  acpi: pci: Setup MSI domain for ACPI based pci devices
  irqdomain: introduce is_fwnode_irqchip helper
  irqdomain: Introduce irq_domain_get_irqchip_fwnode_name helper
    function
  gicv2m: Refactor to prepare for ACPI support
  gicv2m: acpi: Introducing GICv2m ACPI support

 drivers/irqchip/irq-gic-v2m.c   | 152 ++++++++++++++++++++++++++++++++++------
 drivers/irqchip/irq-gic.c       |   5 +-
 drivers/pci/msi.c               |  30 ++++++++
 drivers/pci/pci-acpi.c          |  13 ++++
 drivers/pci/probe.c             |   2 +
 include/linux/irqchip/arm-gic.h |   4 ++
 include/linux/irqdomain.h       |   6 ++
 include/linux/msi.h             |   7 ++
 include/linux/pci.h             |   7 ++
 kernel/irq/irqdomain.c          |  20 +++++-
 10 files changed, 223 insertions(+), 23 deletions(-)

-- 
2.1.0


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

* [PATCH V3 0/6] gicv2m: acpi: Add ACPI support for GICv2m MSI
@ 2015-10-21 18:47 ` Suravee Suthikulpanit
  0 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series has been forked from the following patch series since
it no longer depends on the rest of the patches.

  [PATCH v4 00/10] ACPI GIC Self-probing, GICv2m and GICv3 support
  https://lkml.org/lkml/2015/7/29/234

It has been ported to use the newly introduced device fwnode_handle 
for ACPI irqdmain introduced by Marc in the following patch series:

  [PATCH v2 00/17] Divorcing irqdomain and device_node
  http://git.kernel.org/cgit/linux/kernel/git/maz/arm-platforms.git irq/irq-domain-fwnode-v2

The following git branch contains the submitted patches along with
the pre-requsite patches (mainly for ARM64 PCI support for ACPI).

  https://github.com/ssuthiku/linux.git	v2m-multiframe-v3

This has been tested on AMD Seattle (Overdrive) RevB system. 

NOTE: I have not tested ACPI GICv2m multiframe support since
I don't have access to such system. Any helps are appreciated.

Thanks,
Suravee

Changes from V2: (https://lkml.org/lkml/2015/10/14/1010)
  - Minor clean up from Tomasz review comment in patch 6/6.

Changes from V1: (https://lkml.org/lkml/2015/10/13/859)
  - Rebase on top of Marc's patch to addng support for multiple MSI frames
    (https://lkml.org/lkml/2015/10/14/271)
  - Adding fwnode convenient functions (patch 3 and 4)


Suravee Suthikulpanit (6):
  pci: msi: Add support to query MSI domain for pci device
  acpi: pci: Setup MSI domain for ACPI based pci devices
  irqdomain: introduce is_fwnode_irqchip helper
  irqdomain: Introduce irq_domain_get_irqchip_fwnode_name helper
    function
  gicv2m: Refactor to prepare for ACPI support
  gicv2m: acpi: Introducing GICv2m ACPI support

 drivers/irqchip/irq-gic-v2m.c   | 152 ++++++++++++++++++++++++++++++++++------
 drivers/irqchip/irq-gic.c       |   5 +-
 drivers/pci/msi.c               |  30 ++++++++
 drivers/pci/pci-acpi.c          |  13 ++++
 drivers/pci/probe.c             |   2 +
 include/linux/irqchip/arm-gic.h |   4 ++
 include/linux/irqdomain.h       |   6 ++
 include/linux/msi.h             |   7 ++
 include/linux/pci.h             |   7 ++
 kernel/irq/irqdomain.c          |  20 +++++-
 10 files changed, 223 insertions(+), 23 deletions(-)

-- 
2.1.0

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

* [PATCH V3 1/6] pci: msi: Add support to query MSI domain for pci device
  2015-10-21 18:47 ` Suravee Suthikulpanit
  (?)
@ 2015-10-21 18:47   ` Suravee Suthikulpanit
  -1 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: marc.zyngier, tglx, jason, rjw
  Cc: Lorenzo Pieralisi, Will Deacon, Catalin Marinas, hanjun.guo,
	tomasz.nowicki, graeme.gregory, dhdang, linux-arm-kernel,
	linux-kernel, linux-acpi, Suravee Suthikulpanit

This patch introduces an interface for irqchip to register a callback,
to provide a way to determine appropriate MSI domain for a pci device.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 drivers/pci/msi.c   | 30 ++++++++++++++++++++++++++++++
 include/linux/msi.h |  7 +++++++
 2 files changed, 37 insertions(+)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index ddd59fe..2c87843 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -1327,4 +1327,34 @@ struct irq_domain *pci_msi_create_default_irq_domain(struct fwnode_handle *fwnod
 
 	return domain;
 }
+
+static struct fwnode_handle *(*pci_msi_get_fwnode_cb)(struct device *dev);
+
+/**
+ * pci_msi_register_fwnode_provider - Register callback to retrieve fwnode
+ * @fn:		The interrupt domain to retrieve
+ *
+ * This should be called by irqchip driver, which is the parent of
+ * the MSI domain to provide callback interface to query fwnode.
+ */
+void
+pci_msi_register_fwnode_provider(struct fwnode_handle *(*fn)(struct device *))
+{
+	pci_msi_get_fwnode_cb = fn;
+}
+
+/**
+ * pci_msi_get_fwnode - Query fwnode for MSI controller of the @dev
+ * @dev:	The device that we try to query MSI domain token for
+ *
+ * This is used to query MSI domain token when setting up MSI domain
+ * for a device. Returns fwnode_handle * if token found / NULL if not found
+ */
+struct fwnode_handle *pci_msi_get_fwnode(struct device *dev)
+{
+	if (pci_msi_get_fwnode_cb)
+		return pci_msi_get_fwnode_cb(dev);
+
+	return NULL;
+}
 #endif /* CONFIG_PCI_MSI_IRQ_DOMAIN */
diff --git a/include/linux/msi.h b/include/linux/msi.h
index 32a24b9..ceaebf6 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -3,6 +3,7 @@
 
 #include <linux/kobject.h>
 #include <linux/list.h>
+#include <linux/fwnode.h>
 
 struct msi_msg {
 	u32	address_lo;	/* low 32 bits of msi message address */
@@ -294,6 +295,12 @@ irq_hw_number_t pci_msi_domain_calc_hwirq(struct pci_dev *dev,
 					  struct msi_desc *desc);
 int pci_msi_domain_check_cap(struct irq_domain *domain,
 			     struct msi_domain_info *info, struct device *dev);
+
+void
+pci_msi_register_fwnode_provider(struct fwnode_handle *(*fn)(struct device *));
+
+struct fwnode_handle *pci_msi_get_fwnode(struct device *dev);
+
 #endif /* CONFIG_PCI_MSI_IRQ_DOMAIN */
 
 #endif /* LINUX_MSI_H */
-- 
2.1.0


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

* [PATCH V3 1/6] pci: msi: Add support to query MSI domain for pci device
@ 2015-10-21 18:47   ` Suravee Suthikulpanit
  0 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: marc.zyngier, tglx, jason, rjw
  Cc: Lorenzo Pieralisi, Will Deacon, Catalin Marinas, hanjun.guo,
	tomasz.nowicki, graeme.gregory, dhdang, linux-arm-kernel,
	linux-kernel, linux-acpi, Suravee Suthikulpanit

This patch introduces an interface for irqchip to register a callback,
to provide a way to determine appropriate MSI domain for a pci device.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 drivers/pci/msi.c   | 30 ++++++++++++++++++++++++++++++
 include/linux/msi.h |  7 +++++++
 2 files changed, 37 insertions(+)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index ddd59fe..2c87843 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -1327,4 +1327,34 @@ struct irq_domain *pci_msi_create_default_irq_domain(struct fwnode_handle *fwnod
 
 	return domain;
 }
+
+static struct fwnode_handle *(*pci_msi_get_fwnode_cb)(struct device *dev);
+
+/**
+ * pci_msi_register_fwnode_provider - Register callback to retrieve fwnode
+ * @fn:		The interrupt domain to retrieve
+ *
+ * This should be called by irqchip driver, which is the parent of
+ * the MSI domain to provide callback interface to query fwnode.
+ */
+void
+pci_msi_register_fwnode_provider(struct fwnode_handle *(*fn)(struct device *))
+{
+	pci_msi_get_fwnode_cb = fn;
+}
+
+/**
+ * pci_msi_get_fwnode - Query fwnode for MSI controller of the @dev
+ * @dev:	The device that we try to query MSI domain token for
+ *
+ * This is used to query MSI domain token when setting up MSI domain
+ * for a device. Returns fwnode_handle * if token found / NULL if not found
+ */
+struct fwnode_handle *pci_msi_get_fwnode(struct device *dev)
+{
+	if (pci_msi_get_fwnode_cb)
+		return pci_msi_get_fwnode_cb(dev);
+
+	return NULL;
+}
 #endif /* CONFIG_PCI_MSI_IRQ_DOMAIN */
diff --git a/include/linux/msi.h b/include/linux/msi.h
index 32a24b9..ceaebf6 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -3,6 +3,7 @@
 
 #include <linux/kobject.h>
 #include <linux/list.h>
+#include <linux/fwnode.h>
 
 struct msi_msg {
 	u32	address_lo;	/* low 32 bits of msi message address */
@@ -294,6 +295,12 @@ irq_hw_number_t pci_msi_domain_calc_hwirq(struct pci_dev *dev,
 					  struct msi_desc *desc);
 int pci_msi_domain_check_cap(struct irq_domain *domain,
 			     struct msi_domain_info *info, struct device *dev);
+
+void
+pci_msi_register_fwnode_provider(struct fwnode_handle *(*fn)(struct device *));
+
+struct fwnode_handle *pci_msi_get_fwnode(struct device *dev);
+
 #endif /* CONFIG_PCI_MSI_IRQ_DOMAIN */
 
 #endif /* LINUX_MSI_H */
-- 
2.1.0


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

* [PATCH V3 1/6] pci: msi: Add support to query MSI domain for pci device
@ 2015-10-21 18:47   ` Suravee Suthikulpanit
  0 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: linux-arm-kernel

This patch introduces an interface for irqchip to register a callback,
to provide a way to determine appropriate MSI domain for a pci device.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 drivers/pci/msi.c   | 30 ++++++++++++++++++++++++++++++
 include/linux/msi.h |  7 +++++++
 2 files changed, 37 insertions(+)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index ddd59fe..2c87843 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -1327,4 +1327,34 @@ struct irq_domain *pci_msi_create_default_irq_domain(struct fwnode_handle *fwnod
 
 	return domain;
 }
+
+static struct fwnode_handle *(*pci_msi_get_fwnode_cb)(struct device *dev);
+
+/**
+ * pci_msi_register_fwnode_provider - Register callback to retrieve fwnode
+ * @fn:		The interrupt domain to retrieve
+ *
+ * This should be called by irqchip driver, which is the parent of
+ * the MSI domain to provide callback interface to query fwnode.
+ */
+void
+pci_msi_register_fwnode_provider(struct fwnode_handle *(*fn)(struct device *))
+{
+	pci_msi_get_fwnode_cb = fn;
+}
+
+/**
+ * pci_msi_get_fwnode - Query fwnode for MSI controller of the @dev
+ * @dev:	The device that we try to query MSI domain token for
+ *
+ * This is used to query MSI domain token when setting up MSI domain
+ * for a device. Returns fwnode_handle * if token found / NULL if not found
+ */
+struct fwnode_handle *pci_msi_get_fwnode(struct device *dev)
+{
+	if (pci_msi_get_fwnode_cb)
+		return pci_msi_get_fwnode_cb(dev);
+
+	return NULL;
+}
 #endif /* CONFIG_PCI_MSI_IRQ_DOMAIN */
diff --git a/include/linux/msi.h b/include/linux/msi.h
index 32a24b9..ceaebf6 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -3,6 +3,7 @@
 
 #include <linux/kobject.h>
 #include <linux/list.h>
+#include <linux/fwnode.h>
 
 struct msi_msg {
 	u32	address_lo;	/* low 32 bits of msi message address */
@@ -294,6 +295,12 @@ irq_hw_number_t pci_msi_domain_calc_hwirq(struct pci_dev *dev,
 					  struct msi_desc *desc);
 int pci_msi_domain_check_cap(struct irq_domain *domain,
 			     struct msi_domain_info *info, struct device *dev);
+
+void
+pci_msi_register_fwnode_provider(struct fwnode_handle *(*fn)(struct device *));
+
+struct fwnode_handle *pci_msi_get_fwnode(struct device *dev);
+
 #endif /* CONFIG_PCI_MSI_IRQ_DOMAIN */
 
 #endif /* LINUX_MSI_H */
-- 
2.1.0

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

* [PATCH V3 2/6] acpi: pci: Setup MSI domain for ACPI based pci devices
  2015-10-21 18:47 ` Suravee Suthikulpanit
  (?)
@ 2015-10-21 18:47   ` Suravee Suthikulpanit
  -1 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: marc.zyngier, tglx, jason, rjw
  Cc: Lorenzo Pieralisi, graeme.gregory, Catalin Marinas, dhdang,
	Will Deacon, linux-kernel, tomasz.nowicki, linux-acpi,
	hanjun.guo, Suravee Suthikulpanit, linux-arm-kernel

This patch introduces pci_host_bridge_acpi_msi_domain(), which returns
the MSI domain of the specified PCI host bridge with DOMAIN_BUS_PCI_MSI
bus token. Then, it is assigned to pci device.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 drivers/pci/pci-acpi.c | 13 +++++++++++++
 drivers/pci/probe.c    |  2 ++
 include/linux/pci.h    |  7 +++++++
 3 files changed, 22 insertions(+)

diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index a32ba75..0e21ef4 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -9,7 +9,9 @@
 
 #include <linux/delay.h>
 #include <linux/init.h>
+#include <linux/irqdomain.h>
 #include <linux/pci.h>
+#include <linux/msi.h>
 #include <linux/pci_hotplug.h>
 #include <linux/module.h>
 #include <linux/pci-aspm.h>
@@ -689,6 +691,17 @@ static struct acpi_bus_type acpi_pci_bus = {
 	.cleanup = pci_acpi_cleanup,
 };
 
+struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
+{
+	struct irq_domain *dom = NULL;
+	struct fwnode_handle *fwnode = pci_msi_get_fwnode(&bus->dev);
+
+	if (fwnode)
+		dom = irq_find_matching_fwnode(fwnode,
+					       DOMAIN_BUS_PCI_MSI);
+	return dom;
+}
+
 static int __init acpi_pci_init(void)
 {
 	int ret;
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 0dbc7fb..bea1840 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -671,6 +671,8 @@ static struct irq_domain *pci_host_bridge_msi_domain(struct pci_bus *bus)
 	 * should be called from here.
 	 */
 	d = pci_host_bridge_of_msi_domain(bus);
+	if (!d)
+		d = pci_host_bridge_acpi_msi_domain(bus);
 
 	return d;
 }
diff --git a/include/linux/pci.h b/include/linux/pci.h
index e90eb22..4a7f6a9 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1925,6 +1925,13 @@ static inline struct irq_domain *
 pci_host_bridge_of_msi_domain(struct pci_bus *bus) { return NULL; }
 #endif  /* CONFIG_OF */
 
+#ifdef CONFIG_ACPI
+struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus);
+#else
+static inline struct irq_domain *
+pci_host_bridge_acpi_msi_domain(struct pci_bus *bus) { return NULL; }
+#endif
+
 #ifdef CONFIG_EEH
 static inline struct eeh_dev *pci_dev_to_eeh_dev(struct pci_dev *pdev)
 {
-- 
2.1.0

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

* [PATCH V3 2/6] acpi: pci: Setup MSI domain for ACPI based pci devices
@ 2015-10-21 18:47   ` Suravee Suthikulpanit
  0 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: marc.zyngier, tglx, jason, rjw
  Cc: Lorenzo Pieralisi, Will Deacon, Catalin Marinas, hanjun.guo,
	tomasz.nowicki, graeme.gregory, dhdang, linux-arm-kernel,
	linux-kernel, linux-acpi, Suravee Suthikulpanit

This patch introduces pci_host_bridge_acpi_msi_domain(), which returns
the MSI domain of the specified PCI host bridge with DOMAIN_BUS_PCI_MSI
bus token. Then, it is assigned to pci device.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 drivers/pci/pci-acpi.c | 13 +++++++++++++
 drivers/pci/probe.c    |  2 ++
 include/linux/pci.h    |  7 +++++++
 3 files changed, 22 insertions(+)

diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index a32ba75..0e21ef4 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -9,7 +9,9 @@
 
 #include <linux/delay.h>
 #include <linux/init.h>
+#include <linux/irqdomain.h>
 #include <linux/pci.h>
+#include <linux/msi.h>
 #include <linux/pci_hotplug.h>
 #include <linux/module.h>
 #include <linux/pci-aspm.h>
@@ -689,6 +691,17 @@ static struct acpi_bus_type acpi_pci_bus = {
 	.cleanup = pci_acpi_cleanup,
 };
 
+struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
+{
+	struct irq_domain *dom = NULL;
+	struct fwnode_handle *fwnode = pci_msi_get_fwnode(&bus->dev);
+
+	if (fwnode)
+		dom = irq_find_matching_fwnode(fwnode,
+					       DOMAIN_BUS_PCI_MSI);
+	return dom;
+}
+
 static int __init acpi_pci_init(void)
 {
 	int ret;
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 0dbc7fb..bea1840 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -671,6 +671,8 @@ static struct irq_domain *pci_host_bridge_msi_domain(struct pci_bus *bus)
 	 * should be called from here.
 	 */
 	d = pci_host_bridge_of_msi_domain(bus);
+	if (!d)
+		d = pci_host_bridge_acpi_msi_domain(bus);
 
 	return d;
 }
diff --git a/include/linux/pci.h b/include/linux/pci.h
index e90eb22..4a7f6a9 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1925,6 +1925,13 @@ static inline struct irq_domain *
 pci_host_bridge_of_msi_domain(struct pci_bus *bus) { return NULL; }
 #endif  /* CONFIG_OF */
 
+#ifdef CONFIG_ACPI
+struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus);
+#else
+static inline struct irq_domain *
+pci_host_bridge_acpi_msi_domain(struct pci_bus *bus) { return NULL; }
+#endif
+
 #ifdef CONFIG_EEH
 static inline struct eeh_dev *pci_dev_to_eeh_dev(struct pci_dev *pdev)
 {
-- 
2.1.0


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

* [PATCH V3 2/6] acpi: pci: Setup MSI domain for ACPI based pci devices
@ 2015-10-21 18:47   ` Suravee Suthikulpanit
  0 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: linux-arm-kernel

This patch introduces pci_host_bridge_acpi_msi_domain(), which returns
the MSI domain of the specified PCI host bridge with DOMAIN_BUS_PCI_MSI
bus token. Then, it is assigned to pci device.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 drivers/pci/pci-acpi.c | 13 +++++++++++++
 drivers/pci/probe.c    |  2 ++
 include/linux/pci.h    |  7 +++++++
 3 files changed, 22 insertions(+)

diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index a32ba75..0e21ef4 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -9,7 +9,9 @@
 
 #include <linux/delay.h>
 #include <linux/init.h>
+#include <linux/irqdomain.h>
 #include <linux/pci.h>
+#include <linux/msi.h>
 #include <linux/pci_hotplug.h>
 #include <linux/module.h>
 #include <linux/pci-aspm.h>
@@ -689,6 +691,17 @@ static struct acpi_bus_type acpi_pci_bus = {
 	.cleanup = pci_acpi_cleanup,
 };
 
+struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
+{
+	struct irq_domain *dom = NULL;
+	struct fwnode_handle *fwnode = pci_msi_get_fwnode(&bus->dev);
+
+	if (fwnode)
+		dom = irq_find_matching_fwnode(fwnode,
+					       DOMAIN_BUS_PCI_MSI);
+	return dom;
+}
+
 static int __init acpi_pci_init(void)
 {
 	int ret;
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 0dbc7fb..bea1840 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -671,6 +671,8 @@ static struct irq_domain *pci_host_bridge_msi_domain(struct pci_bus *bus)
 	 * should be called from here.
 	 */
 	d = pci_host_bridge_of_msi_domain(bus);
+	if (!d)
+		d = pci_host_bridge_acpi_msi_domain(bus);
 
 	return d;
 }
diff --git a/include/linux/pci.h b/include/linux/pci.h
index e90eb22..4a7f6a9 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1925,6 +1925,13 @@ static inline struct irq_domain *
 pci_host_bridge_of_msi_domain(struct pci_bus *bus) { return NULL; }
 #endif  /* CONFIG_OF */
 
+#ifdef CONFIG_ACPI
+struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus);
+#else
+static inline struct irq_domain *
+pci_host_bridge_acpi_msi_domain(struct pci_bus *bus) { return NULL; }
+#endif
+
 #ifdef CONFIG_EEH
 static inline struct eeh_dev *pci_dev_to_eeh_dev(struct pci_dev *pdev)
 {
-- 
2.1.0

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

* [PATCH V3 3/6] irqdomain: introduce is_fwnode_irqchip helper
  2015-10-21 18:47 ` Suravee Suthikulpanit
  (?)
@ 2015-10-21 18:47   ` Suravee Suthikulpanit
  -1 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: marc.zyngier, tglx, jason, rjw
  Cc: Lorenzo Pieralisi, Will Deacon, Catalin Marinas, hanjun.guo,
	tomasz.nowicki, graeme.gregory, dhdang, linux-arm-kernel,
	linux-kernel, linux-acpi, Suravee Suthikulpanit

Since there will be several places checking if fwnode.type
is equal FWNODE_IRQCHIP, this patch adds a convenient function
for this purpose.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 drivers/irqchip/irq-gic.c | 2 +-
 include/linux/irqdomain.h | 5 +++++
 kernel/irq/irqdomain.c    | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 1d0e768..6685b33 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -939,7 +939,7 @@ static int gic_irq_domain_translate(struct irq_domain *d,
 		return 0;
 	}
 
-	if (fwspec->fwnode->type == FWNODE_IRQCHIP) {
+	if (is_fwnode_irqchip(fwspec->fwnode)) {
 		if(fwspec->param_count != 2)
 			return -EINVAL;
 
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index d5e5c5b..4950a71 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -211,6 +211,11 @@ static inline struct fwnode_handle *of_node_to_fwnode(struct device_node *node)
 	return node ? &node->fwnode : NULL;
 }
 
+static inline bool is_fwnode_irqchip(struct fwnode_handle *fwnode)
+{
+	return fwnode && fwnode->type == FWNODE_IRQCHIP;
+}
+
 static inline struct irq_domain *irq_find_matching_host(struct device_node *node,
 							enum irq_domain_bus_token bus_token)
 {
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 22aa961..7f34d98 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -70,7 +70,7 @@ void irq_domain_free_fwnode(struct fwnode_handle *fwnode)
 {
 	struct irqchip_fwid *fwid;
 
-	if (WARN_ON(fwnode->type != FWNODE_IRQCHIP))
+	if (WARN_ON(!is_fwnode_irqchip(fwnode)))
 		return;
 
 	fwid = container_of(fwnode, struct irqchip_fwid, fwnode);
-- 
2.1.0

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

* [PATCH V3 3/6] irqdomain: introduce is_fwnode_irqchip helper
@ 2015-10-21 18:47   ` Suravee Suthikulpanit
  0 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: marc.zyngier, tglx, jason, rjw
  Cc: Lorenzo Pieralisi, Will Deacon, Catalin Marinas, hanjun.guo,
	tomasz.nowicki, graeme.gregory, dhdang, linux-arm-kernel,
	linux-kernel, linux-acpi, Suravee Suthikulpanit

Since there will be several places checking if fwnode.type
is equal FWNODE_IRQCHIP, this patch adds a convenient function
for this purpose.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 drivers/irqchip/irq-gic.c | 2 +-
 include/linux/irqdomain.h | 5 +++++
 kernel/irq/irqdomain.c    | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 1d0e768..6685b33 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -939,7 +939,7 @@ static int gic_irq_domain_translate(struct irq_domain *d,
 		return 0;
 	}
 
-	if (fwspec->fwnode->type == FWNODE_IRQCHIP) {
+	if (is_fwnode_irqchip(fwspec->fwnode)) {
 		if(fwspec->param_count != 2)
 			return -EINVAL;
 
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index d5e5c5b..4950a71 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -211,6 +211,11 @@ static inline struct fwnode_handle *of_node_to_fwnode(struct device_node *node)
 	return node ? &node->fwnode : NULL;
 }
 
+static inline bool is_fwnode_irqchip(struct fwnode_handle *fwnode)
+{
+	return fwnode && fwnode->type == FWNODE_IRQCHIP;
+}
+
 static inline struct irq_domain *irq_find_matching_host(struct device_node *node,
 							enum irq_domain_bus_token bus_token)
 {
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 22aa961..7f34d98 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -70,7 +70,7 @@ void irq_domain_free_fwnode(struct fwnode_handle *fwnode)
 {
 	struct irqchip_fwid *fwid;
 
-	if (WARN_ON(fwnode->type != FWNODE_IRQCHIP))
+	if (WARN_ON(!is_fwnode_irqchip(fwnode)))
 		return;
 
 	fwid = container_of(fwnode, struct irqchip_fwid, fwnode);
-- 
2.1.0


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

* [PATCH V3 3/6] irqdomain: introduce is_fwnode_irqchip helper
@ 2015-10-21 18:47   ` Suravee Suthikulpanit
  0 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: linux-arm-kernel

Since there will be several places checking if fwnode.type
is equal FWNODE_IRQCHIP, this patch adds a convenient function
for this purpose.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 drivers/irqchip/irq-gic.c | 2 +-
 include/linux/irqdomain.h | 5 +++++
 kernel/irq/irqdomain.c    | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 1d0e768..6685b33 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -939,7 +939,7 @@ static int gic_irq_domain_translate(struct irq_domain *d,
 		return 0;
 	}
 
-	if (fwspec->fwnode->type == FWNODE_IRQCHIP) {
+	if (is_fwnode_irqchip(fwspec->fwnode)) {
 		if(fwspec->param_count != 2)
 			return -EINVAL;
 
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index d5e5c5b..4950a71 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -211,6 +211,11 @@ static inline struct fwnode_handle *of_node_to_fwnode(struct device_node *node)
 	return node ? &node->fwnode : NULL;
 }
 
+static inline bool is_fwnode_irqchip(struct fwnode_handle *fwnode)
+{
+	return fwnode && fwnode->type == FWNODE_IRQCHIP;
+}
+
 static inline struct irq_domain *irq_find_matching_host(struct device_node *node,
 							enum irq_domain_bus_token bus_token)
 {
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 22aa961..7f34d98 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -70,7 +70,7 @@ void irq_domain_free_fwnode(struct fwnode_handle *fwnode)
 {
 	struct irqchip_fwid *fwid;
 
-	if (WARN_ON(fwnode->type != FWNODE_IRQCHIP))
+	if (WARN_ON(!is_fwnode_irqchip(fwnode)))
 		return;
 
 	fwid = container_of(fwnode, struct irqchip_fwid, fwnode);
-- 
2.1.0

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

* [PATCH V3 4/6] irqdomain: Introduce irq_domain_get_irqchip_fwnode_name helper function
  2015-10-21 18:47 ` Suravee Suthikulpanit
  (?)
@ 2015-10-21 18:47   ` Suravee Suthikulpanit
  -1 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: marc.zyngier, tglx, jason, rjw
  Cc: Lorenzo Pieralisi, Will Deacon, Catalin Marinas, hanjun.guo,
	tomasz.nowicki, graeme.gregory, dhdang, linux-arm-kernel,
	linux-kernel, linux-acpi, Suravee Suthikulpanit

This patch adds an accessor function to retrieve struct irqchip_fwid.name.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 include/linux/irqdomain.h |  1 +
 kernel/irq/irqdomain.c    | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 4950a71..006633d 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -187,6 +187,7 @@ static inline struct device_node *irq_domain_get_of_node(struct irq_domain *d)
 #ifdef CONFIG_IRQ_DOMAIN
 struct fwnode_handle *irq_domain_alloc_fwnode(void *data);
 void irq_domain_free_fwnode(struct fwnode_handle *fwnode);
+const char *irq_domain_get_irqchip_fwnode_name(struct fwnode_handle *fwnode);
 struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size,
 				    irq_hw_number_t hwirq_max, int direct_max,
 				    const struct irq_domain_ops *ops,
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 7f34d98..a8c1cf6 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -79,6 +79,24 @@ void irq_domain_free_fwnode(struct fwnode_handle *fwnode)
 }
 
 /**
+ * irq_domain_get_irqchip_fwnode_name - Retrieve associated name of
+ *                                      specified irqchip fwnode
+ * @fwnode: Specified fwnode_handle
+ *
+ * Returns associated name of the specified fwnode, or NULL on failure.
+ */
+const char *irq_domain_get_irqchip_fwnode_name(struct fwnode_handle *fwnode)
+{
+	struct irqchip_fwid *fwid;
+
+	if (!is_fwnode_irqchip(fwnode))
+		return NULL;
+
+	fwid = container_of(fwnode, struct irqchip_fwid, fwnode);
+	return fwid->name;
+}
+
+/**
  * __irq_domain_add() - Allocate a new irq_domain data structure
  * @of_node: optional device-tree node of the interrupt controller
  * @size: Size of linear map; 0 for radix mapping only
-- 
2.1.0


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

* [PATCH V3 4/6] irqdomain: Introduce irq_domain_get_irqchip_fwnode_name helper function
@ 2015-10-21 18:47   ` Suravee Suthikulpanit
  0 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: marc.zyngier, tglx, jason, rjw
  Cc: Lorenzo Pieralisi, Will Deacon, Catalin Marinas, hanjun.guo,
	tomasz.nowicki, graeme.gregory, dhdang, linux-arm-kernel,
	linux-kernel, linux-acpi, Suravee Suthikulpanit

This patch adds an accessor function to retrieve struct irqchip_fwid.name.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 include/linux/irqdomain.h |  1 +
 kernel/irq/irqdomain.c    | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 4950a71..006633d 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -187,6 +187,7 @@ static inline struct device_node *irq_domain_get_of_node(struct irq_domain *d)
 #ifdef CONFIG_IRQ_DOMAIN
 struct fwnode_handle *irq_domain_alloc_fwnode(void *data);
 void irq_domain_free_fwnode(struct fwnode_handle *fwnode);
+const char *irq_domain_get_irqchip_fwnode_name(struct fwnode_handle *fwnode);
 struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size,
 				    irq_hw_number_t hwirq_max, int direct_max,
 				    const struct irq_domain_ops *ops,
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 7f34d98..a8c1cf6 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -79,6 +79,24 @@ void irq_domain_free_fwnode(struct fwnode_handle *fwnode)
 }
 
 /**
+ * irq_domain_get_irqchip_fwnode_name - Retrieve associated name of
+ *                                      specified irqchip fwnode
+ * @fwnode: Specified fwnode_handle
+ *
+ * Returns associated name of the specified fwnode, or NULL on failure.
+ */
+const char *irq_domain_get_irqchip_fwnode_name(struct fwnode_handle *fwnode)
+{
+	struct irqchip_fwid *fwid;
+
+	if (!is_fwnode_irqchip(fwnode))
+		return NULL;
+
+	fwid = container_of(fwnode, struct irqchip_fwid, fwnode);
+	return fwid->name;
+}
+
+/**
  * __irq_domain_add() - Allocate a new irq_domain data structure
  * @of_node: optional device-tree node of the interrupt controller
  * @size: Size of linear map; 0 for radix mapping only
-- 
2.1.0


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

* [PATCH V3 4/6] irqdomain: Introduce irq_domain_get_irqchip_fwnode_name helper function
@ 2015-10-21 18:47   ` Suravee Suthikulpanit
  0 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds an accessor function to retrieve struct irqchip_fwid.name.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 include/linux/irqdomain.h |  1 +
 kernel/irq/irqdomain.c    | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 4950a71..006633d 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -187,6 +187,7 @@ static inline struct device_node *irq_domain_get_of_node(struct irq_domain *d)
 #ifdef CONFIG_IRQ_DOMAIN
 struct fwnode_handle *irq_domain_alloc_fwnode(void *data);
 void irq_domain_free_fwnode(struct fwnode_handle *fwnode);
+const char *irq_domain_get_irqchip_fwnode_name(struct fwnode_handle *fwnode);
 struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size,
 				    irq_hw_number_t hwirq_max, int direct_max,
 				    const struct irq_domain_ops *ops,
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 7f34d98..a8c1cf6 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -79,6 +79,24 @@ void irq_domain_free_fwnode(struct fwnode_handle *fwnode)
 }
 
 /**
+ * irq_domain_get_irqchip_fwnode_name - Retrieve associated name of
+ *                                      specified irqchip fwnode
+ * @fwnode: Specified fwnode_handle
+ *
+ * Returns associated name of the specified fwnode, or NULL on failure.
+ */
+const char *irq_domain_get_irqchip_fwnode_name(struct fwnode_handle *fwnode)
+{
+	struct irqchip_fwid *fwid;
+
+	if (!is_fwnode_irqchip(fwnode))
+		return NULL;
+
+	fwid = container_of(fwnode, struct irqchip_fwid, fwnode);
+	return fwid->name;
+}
+
+/**
  * __irq_domain_add() - Allocate a new irq_domain data structure
  * @of_node: optional device-tree node of the interrupt controller
  * @size: Size of linear map; 0 for radix mapping only
-- 
2.1.0

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

* [PATCH V3 5/6] gicv2m: Refactor to prepare for ACPI support
  2015-10-21 18:47 ` Suravee Suthikulpanit
  (?)
@ 2015-10-21 18:47   ` Suravee Suthikulpanit
  -1 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: marc.zyngier, tglx, jason, rjw
  Cc: Lorenzo Pieralisi, Will Deacon, Catalin Marinas, hanjun.guo,
	tomasz.nowicki, graeme.gregory, dhdang, linux-arm-kernel,
	linux-kernel, linux-acpi, Suravee Suthikulpanit

This patch replaces the struct device_node with struct fwnode_handle
since this structure is common between DT and ACPI.

It also refactors gicv2m_init_one() to prepare for ACPI support.
There should be no functional changes.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 drivers/irqchip/irq-gic-v2m.c | 57 +++++++++++++++++++++++++++----------------
 1 file changed, 36 insertions(+), 21 deletions(-)

diff --git a/drivers/irqchip/irq-gic-v2m.c b/drivers/irqchip/irq-gic-v2m.c
index 87f8d10..7e60f7e 100644
--- a/drivers/irqchip/irq-gic-v2m.c
+++ b/drivers/irqchip/irq-gic-v2m.c
@@ -55,7 +55,7 @@ static DEFINE_SPINLOCK(v2m_lock);
 
 struct v2m_data {
 	struct list_head entry;
-	struct device_node *node;
+	struct fwnode_handle *fwnode;
 	struct resource res;	/* GICv2m resource */
 	void __iomem *base;	/* GICv2m virt address */
 	u32 spi_start;		/* The SPI number that MSIs start */
@@ -254,7 +254,7 @@ static void gicv2m_teardown(void)
 		list_del(&v2m->entry);
 		kfree(v2m->bm);
 		iounmap(v2m->base);
-		of_node_put(v2m->node);
+		of_node_put(to_of_node(v2m->fwnode));
 		kfree(v2m);
 	}
 }
@@ -268,7 +268,7 @@ static int gicv2m_allocate_domains(struct irq_domain *parent)
 	if (!v2m)
 		return 0;
 
-	inner_domain = irq_domain_create_tree(of_node_to_fwnode(v2m->node),
+	inner_domain = irq_domain_create_tree(v2m->fwnode,
 					      &gicv2m_domain_ops, v2m);
 	if (!inner_domain) {
 		pr_err("Failed to create GICv2m domain\n");
@@ -277,10 +277,10 @@ static int gicv2m_allocate_domains(struct irq_domain *parent)
 
 	inner_domain->bus_token = DOMAIN_BUS_NEXUS;
 	inner_domain->parent = parent;
-	pci_domain = pci_msi_create_irq_domain(of_node_to_fwnode(v2m->node),
+	pci_domain = pci_msi_create_irq_domain(v2m->fwnode,
 					       &gicv2m_msi_domain_info,
 					       inner_domain);
-	plat_domain = platform_msi_create_irq_domain(of_node_to_fwnode(v2m->node),
+	plat_domain = platform_msi_create_irq_domain(v2m->fwnode,
 						     &gicv2m_pmsi_domain_info,
 						     inner_domain);
 	if (!pci_domain || !plat_domain) {
@@ -296,11 +296,13 @@ static int gicv2m_allocate_domains(struct irq_domain *parent)
 	return 0;
 }
 
-static int __init gicv2m_init_one(struct device_node *node,
-				  struct irq_domain *parent)
+static int __init gicv2m_init_one(struct fwnode_handle *fwnode,
+				  u32 spi_start, u32 nr_spis,
+				  struct resource *res)
 {
 	int ret;
 	struct v2m_data *v2m;
+	const char *name = NULL;
 
 	v2m = kzalloc(sizeof(struct v2m_data), GFP_KERNEL);
 	if (!v2m) {
@@ -309,13 +311,9 @@ static int __init gicv2m_init_one(struct device_node *node,
 	}
 
 	INIT_LIST_HEAD(&v2m->entry);
-	v2m->node = node;
+	v2m->fwnode = fwnode;
 
-	ret = of_address_to_resource(node, 0, &v2m->res);
-	if (ret) {
-		pr_err("Failed to allocate v2m resource.\n");
-		goto err_free_v2m;
-	}
+	memcpy(&v2m->res, res, sizeof(struct resource));
 
 	v2m->base = ioremap(v2m->res.start, resource_size(&v2m->res));
 	if (!v2m->base) {
@@ -324,10 +322,9 @@ static int __init gicv2m_init_one(struct device_node *node,
 		goto err_free_v2m;
 	}
 
-	if (!of_property_read_u32(node, "arm,msi-base-spi", &v2m->spi_start) &&
-	    !of_property_read_u32(node, "arm,msi-num-spis", &v2m->nr_spis)) {
-		pr_info("Overriding V2M MSI_TYPER (base:%u, num:%u)\n",
-			v2m->spi_start, v2m->nr_spis);
+	if (spi_start && nr_spis) {
+		v2m->spi_start = spi_start;
+		v2m->nr_spis = nr_spis;
 	} else {
 		u32 typer = readl_relaxed(v2m->base + V2M_MSI_TYPER);
 
@@ -359,10 +356,13 @@ static int __init gicv2m_init_one(struct device_node *node,
 	}
 
 	list_add_tail(&v2m->entry, &v2m_nodes);
-	pr_info("Node %s: range[%#lx:%#lx], SPI[%d:%d]\n", node->name,
-		(unsigned long)v2m->res.start, (unsigned long)v2m->res.end,
-		v2m->spi_start, (v2m->spi_start + v2m->nr_spis));
 
+	if (to_of_node(fwnode))
+		name = to_of_node(fwnode)->name;
+
+	pr_info("Frame %s: range[%#lx:%#lx], SPI[%d:%d]\n", name,
+		(unsigned long)res->start, (unsigned long)res->end,
+		v2m->spi_start, (v2m->spi_start + v2m->nr_spis));
 	return 0;
 
 err_iounmap:
@@ -384,10 +384,25 @@ int __init gicv2m_of_init(struct device_node *node, struct irq_domain *parent)
 
 	for (child = of_find_matching_node(node, gicv2m_device_id); child;
 	     child = of_find_matching_node(child, gicv2m_device_id)) {
+		u32 spi_start = 0, nr_spis = 0;
+		struct resource res;
+
 		if (!of_find_property(child, "msi-controller", NULL))
 			continue;
 
-		ret = gicv2m_init_one(child, parent);
+		ret = of_address_to_resource(child, 0, &res);
+		if (ret) {
+			pr_err("Failed to allocate v2m resource.\n");
+			break;
+		}
+
+		if (!of_property_read_u32(child, "arm,msi-base-spi",
+					  &spi_start) &&
+		    !of_property_read_u32(child, "arm,msi-num-spis", &nr_spis))
+			pr_info("DT overriding V2M MSI_TYPER (base:%u, num:%u)\n",
+				spi_start, nr_spis);
+
+		ret = gicv2m_init_one(&child->fwnode, spi_start, nr_spis, &res);
 		if (ret) {
 			of_node_put(node);
 			break;
-- 
2.1.0


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

* [PATCH V3 5/6] gicv2m: Refactor to prepare for ACPI support
@ 2015-10-21 18:47   ` Suravee Suthikulpanit
  0 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: marc.zyngier, tglx, jason, rjw
  Cc: Lorenzo Pieralisi, Will Deacon, Catalin Marinas, hanjun.guo,
	tomasz.nowicki, graeme.gregory, dhdang, linux-arm-kernel,
	linux-kernel, linux-acpi, Suravee Suthikulpanit

This patch replaces the struct device_node with struct fwnode_handle
since this structure is common between DT and ACPI.

It also refactors gicv2m_init_one() to prepare for ACPI support.
There should be no functional changes.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 drivers/irqchip/irq-gic-v2m.c | 57 +++++++++++++++++++++++++++----------------
 1 file changed, 36 insertions(+), 21 deletions(-)

diff --git a/drivers/irqchip/irq-gic-v2m.c b/drivers/irqchip/irq-gic-v2m.c
index 87f8d10..7e60f7e 100644
--- a/drivers/irqchip/irq-gic-v2m.c
+++ b/drivers/irqchip/irq-gic-v2m.c
@@ -55,7 +55,7 @@ static DEFINE_SPINLOCK(v2m_lock);
 
 struct v2m_data {
 	struct list_head entry;
-	struct device_node *node;
+	struct fwnode_handle *fwnode;
 	struct resource res;	/* GICv2m resource */
 	void __iomem *base;	/* GICv2m virt address */
 	u32 spi_start;		/* The SPI number that MSIs start */
@@ -254,7 +254,7 @@ static void gicv2m_teardown(void)
 		list_del(&v2m->entry);
 		kfree(v2m->bm);
 		iounmap(v2m->base);
-		of_node_put(v2m->node);
+		of_node_put(to_of_node(v2m->fwnode));
 		kfree(v2m);
 	}
 }
@@ -268,7 +268,7 @@ static int gicv2m_allocate_domains(struct irq_domain *parent)
 	if (!v2m)
 		return 0;
 
-	inner_domain = irq_domain_create_tree(of_node_to_fwnode(v2m->node),
+	inner_domain = irq_domain_create_tree(v2m->fwnode,
 					      &gicv2m_domain_ops, v2m);
 	if (!inner_domain) {
 		pr_err("Failed to create GICv2m domain\n");
@@ -277,10 +277,10 @@ static int gicv2m_allocate_domains(struct irq_domain *parent)
 
 	inner_domain->bus_token = DOMAIN_BUS_NEXUS;
 	inner_domain->parent = parent;
-	pci_domain = pci_msi_create_irq_domain(of_node_to_fwnode(v2m->node),
+	pci_domain = pci_msi_create_irq_domain(v2m->fwnode,
 					       &gicv2m_msi_domain_info,
 					       inner_domain);
-	plat_domain = platform_msi_create_irq_domain(of_node_to_fwnode(v2m->node),
+	plat_domain = platform_msi_create_irq_domain(v2m->fwnode,
 						     &gicv2m_pmsi_domain_info,
 						     inner_domain);
 	if (!pci_domain || !plat_domain) {
@@ -296,11 +296,13 @@ static int gicv2m_allocate_domains(struct irq_domain *parent)
 	return 0;
 }
 
-static int __init gicv2m_init_one(struct device_node *node,
-				  struct irq_domain *parent)
+static int __init gicv2m_init_one(struct fwnode_handle *fwnode,
+				  u32 spi_start, u32 nr_spis,
+				  struct resource *res)
 {
 	int ret;
 	struct v2m_data *v2m;
+	const char *name = NULL;
 
 	v2m = kzalloc(sizeof(struct v2m_data), GFP_KERNEL);
 	if (!v2m) {
@@ -309,13 +311,9 @@ static int __init gicv2m_init_one(struct device_node *node,
 	}
 
 	INIT_LIST_HEAD(&v2m->entry);
-	v2m->node = node;
+	v2m->fwnode = fwnode;
 
-	ret = of_address_to_resource(node, 0, &v2m->res);
-	if (ret) {
-		pr_err("Failed to allocate v2m resource.\n");
-		goto err_free_v2m;
-	}
+	memcpy(&v2m->res, res, sizeof(struct resource));
 
 	v2m->base = ioremap(v2m->res.start, resource_size(&v2m->res));
 	if (!v2m->base) {
@@ -324,10 +322,9 @@ static int __init gicv2m_init_one(struct device_node *node,
 		goto err_free_v2m;
 	}
 
-	if (!of_property_read_u32(node, "arm,msi-base-spi", &v2m->spi_start) &&
-	    !of_property_read_u32(node, "arm,msi-num-spis", &v2m->nr_spis)) {
-		pr_info("Overriding V2M MSI_TYPER (base:%u, num:%u)\n",
-			v2m->spi_start, v2m->nr_spis);
+	if (spi_start && nr_spis) {
+		v2m->spi_start = spi_start;
+		v2m->nr_spis = nr_spis;
 	} else {
 		u32 typer = readl_relaxed(v2m->base + V2M_MSI_TYPER);
 
@@ -359,10 +356,13 @@ static int __init gicv2m_init_one(struct device_node *node,
 	}
 
 	list_add_tail(&v2m->entry, &v2m_nodes);
-	pr_info("Node %s: range[%#lx:%#lx], SPI[%d:%d]\n", node->name,
-		(unsigned long)v2m->res.start, (unsigned long)v2m->res.end,
-		v2m->spi_start, (v2m->spi_start + v2m->nr_spis));
 
+	if (to_of_node(fwnode))
+		name = to_of_node(fwnode)->name;
+
+	pr_info("Frame %s: range[%#lx:%#lx], SPI[%d:%d]\n", name,
+		(unsigned long)res->start, (unsigned long)res->end,
+		v2m->spi_start, (v2m->spi_start + v2m->nr_spis));
 	return 0;
 
 err_iounmap:
@@ -384,10 +384,25 @@ int __init gicv2m_of_init(struct device_node *node, struct irq_domain *parent)
 
 	for (child = of_find_matching_node(node, gicv2m_device_id); child;
 	     child = of_find_matching_node(child, gicv2m_device_id)) {
+		u32 spi_start = 0, nr_spis = 0;
+		struct resource res;
+
 		if (!of_find_property(child, "msi-controller", NULL))
 			continue;
 
-		ret = gicv2m_init_one(child, parent);
+		ret = of_address_to_resource(child, 0, &res);
+		if (ret) {
+			pr_err("Failed to allocate v2m resource.\n");
+			break;
+		}
+
+		if (!of_property_read_u32(child, "arm,msi-base-spi",
+					  &spi_start) &&
+		    !of_property_read_u32(child, "arm,msi-num-spis", &nr_spis))
+			pr_info("DT overriding V2M MSI_TYPER (base:%u, num:%u)\n",
+				spi_start, nr_spis);
+
+		ret = gicv2m_init_one(&child->fwnode, spi_start, nr_spis, &res);
 		if (ret) {
 			of_node_put(node);
 			break;
-- 
2.1.0


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

* [PATCH V3 5/6] gicv2m: Refactor to prepare for ACPI support
@ 2015-10-21 18:47   ` Suravee Suthikulpanit
  0 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: linux-arm-kernel

This patch replaces the struct device_node with struct fwnode_handle
since this structure is common between DT and ACPI.

It also refactors gicv2m_init_one() to prepare for ACPI support.
There should be no functional changes.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 drivers/irqchip/irq-gic-v2m.c | 57 +++++++++++++++++++++++++++----------------
 1 file changed, 36 insertions(+), 21 deletions(-)

diff --git a/drivers/irqchip/irq-gic-v2m.c b/drivers/irqchip/irq-gic-v2m.c
index 87f8d10..7e60f7e 100644
--- a/drivers/irqchip/irq-gic-v2m.c
+++ b/drivers/irqchip/irq-gic-v2m.c
@@ -55,7 +55,7 @@ static DEFINE_SPINLOCK(v2m_lock);
 
 struct v2m_data {
 	struct list_head entry;
-	struct device_node *node;
+	struct fwnode_handle *fwnode;
 	struct resource res;	/* GICv2m resource */
 	void __iomem *base;	/* GICv2m virt address */
 	u32 spi_start;		/* The SPI number that MSIs start */
@@ -254,7 +254,7 @@ static void gicv2m_teardown(void)
 		list_del(&v2m->entry);
 		kfree(v2m->bm);
 		iounmap(v2m->base);
-		of_node_put(v2m->node);
+		of_node_put(to_of_node(v2m->fwnode));
 		kfree(v2m);
 	}
 }
@@ -268,7 +268,7 @@ static int gicv2m_allocate_domains(struct irq_domain *parent)
 	if (!v2m)
 		return 0;
 
-	inner_domain = irq_domain_create_tree(of_node_to_fwnode(v2m->node),
+	inner_domain = irq_domain_create_tree(v2m->fwnode,
 					      &gicv2m_domain_ops, v2m);
 	if (!inner_domain) {
 		pr_err("Failed to create GICv2m domain\n");
@@ -277,10 +277,10 @@ static int gicv2m_allocate_domains(struct irq_domain *parent)
 
 	inner_domain->bus_token = DOMAIN_BUS_NEXUS;
 	inner_domain->parent = parent;
-	pci_domain = pci_msi_create_irq_domain(of_node_to_fwnode(v2m->node),
+	pci_domain = pci_msi_create_irq_domain(v2m->fwnode,
 					       &gicv2m_msi_domain_info,
 					       inner_domain);
-	plat_domain = platform_msi_create_irq_domain(of_node_to_fwnode(v2m->node),
+	plat_domain = platform_msi_create_irq_domain(v2m->fwnode,
 						     &gicv2m_pmsi_domain_info,
 						     inner_domain);
 	if (!pci_domain || !plat_domain) {
@@ -296,11 +296,13 @@ static int gicv2m_allocate_domains(struct irq_domain *parent)
 	return 0;
 }
 
-static int __init gicv2m_init_one(struct device_node *node,
-				  struct irq_domain *parent)
+static int __init gicv2m_init_one(struct fwnode_handle *fwnode,
+				  u32 spi_start, u32 nr_spis,
+				  struct resource *res)
 {
 	int ret;
 	struct v2m_data *v2m;
+	const char *name = NULL;
 
 	v2m = kzalloc(sizeof(struct v2m_data), GFP_KERNEL);
 	if (!v2m) {
@@ -309,13 +311,9 @@ static int __init gicv2m_init_one(struct device_node *node,
 	}
 
 	INIT_LIST_HEAD(&v2m->entry);
-	v2m->node = node;
+	v2m->fwnode = fwnode;
 
-	ret = of_address_to_resource(node, 0, &v2m->res);
-	if (ret) {
-		pr_err("Failed to allocate v2m resource.\n");
-		goto err_free_v2m;
-	}
+	memcpy(&v2m->res, res, sizeof(struct resource));
 
 	v2m->base = ioremap(v2m->res.start, resource_size(&v2m->res));
 	if (!v2m->base) {
@@ -324,10 +322,9 @@ static int __init gicv2m_init_one(struct device_node *node,
 		goto err_free_v2m;
 	}
 
-	if (!of_property_read_u32(node, "arm,msi-base-spi", &v2m->spi_start) &&
-	    !of_property_read_u32(node, "arm,msi-num-spis", &v2m->nr_spis)) {
-		pr_info("Overriding V2M MSI_TYPER (base:%u, num:%u)\n",
-			v2m->spi_start, v2m->nr_spis);
+	if (spi_start && nr_spis) {
+		v2m->spi_start = spi_start;
+		v2m->nr_spis = nr_spis;
 	} else {
 		u32 typer = readl_relaxed(v2m->base + V2M_MSI_TYPER);
 
@@ -359,10 +356,13 @@ static int __init gicv2m_init_one(struct device_node *node,
 	}
 
 	list_add_tail(&v2m->entry, &v2m_nodes);
-	pr_info("Node %s: range[%#lx:%#lx], SPI[%d:%d]\n", node->name,
-		(unsigned long)v2m->res.start, (unsigned long)v2m->res.end,
-		v2m->spi_start, (v2m->spi_start + v2m->nr_spis));
 
+	if (to_of_node(fwnode))
+		name = to_of_node(fwnode)->name;
+
+	pr_info("Frame %s: range[%#lx:%#lx], SPI[%d:%d]\n", name,
+		(unsigned long)res->start, (unsigned long)res->end,
+		v2m->spi_start, (v2m->spi_start + v2m->nr_spis));
 	return 0;
 
 err_iounmap:
@@ -384,10 +384,25 @@ int __init gicv2m_of_init(struct device_node *node, struct irq_domain *parent)
 
 	for (child = of_find_matching_node(node, gicv2m_device_id); child;
 	     child = of_find_matching_node(child, gicv2m_device_id)) {
+		u32 spi_start = 0, nr_spis = 0;
+		struct resource res;
+
 		if (!of_find_property(child, "msi-controller", NULL))
 			continue;
 
-		ret = gicv2m_init_one(child, parent);
+		ret = of_address_to_resource(child, 0, &res);
+		if (ret) {
+			pr_err("Failed to allocate v2m resource.\n");
+			break;
+		}
+
+		if (!of_property_read_u32(child, "arm,msi-base-spi",
+					  &spi_start) &&
+		    !of_property_read_u32(child, "arm,msi-num-spis", &nr_spis))
+			pr_info("DT overriding V2M MSI_TYPER (base:%u, num:%u)\n",
+				spi_start, nr_spis);
+
+		ret = gicv2m_init_one(&child->fwnode, spi_start, nr_spis, &res);
 		if (ret) {
 			of_node_put(node);
 			break;
-- 
2.1.0

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

* [PATCH V3 6/6] gicv2m: acpi: Introducing GICv2m ACPI support
  2015-10-21 18:47 ` Suravee Suthikulpanit
  (?)
@ 2015-10-21 18:47   ` Suravee Suthikulpanit
  -1 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: marc.zyngier, tglx, jason, rjw
  Cc: Lorenzo Pieralisi, Will Deacon, Catalin Marinas, hanjun.guo,
	tomasz.nowicki, graeme.gregory, dhdang, linux-arm-kernel,
	linux-kernel, linux-acpi, Suravee Suthikulpanit

This patch introduces gicv2m_acpi_init(), which uses information
in MADT GIC MSI frames structure to initialize GICv2m driver.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
---
 drivers/irqchip/irq-gic-v2m.c   | 95 +++++++++++++++++++++++++++++++++++++++++
 drivers/irqchip/irq-gic.c       |  3 ++
 include/linux/irqchip/arm-gic.h |  4 ++
 3 files changed, 102 insertions(+)

diff --git a/drivers/irqchip/irq-gic-v2m.c b/drivers/irqchip/irq-gic-v2m.c
index 7e60f7e..4f52e9a 100644
--- a/drivers/irqchip/irq-gic-v2m.c
+++ b/drivers/irqchip/irq-gic-v2m.c
@@ -15,9 +15,11 @@
 
 #define pr_fmt(fmt) "GICv2m: " fmt
 
+#include <linux/acpi.h>
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
 #include <linux/kernel.h>
+#include <linux/msi.h>
 #include <linux/of_address.h>
 #include <linux/of_pci.h>
 #include <linux/slab.h>
@@ -138,6 +140,11 @@ static int gicv2m_irq_gic_domain_alloc(struct irq_domain *domain,
 		fwspec.param[0] = 0;
 		fwspec.param[1] = hwirq - 32;
 		fwspec.param[2] = IRQ_TYPE_EDGE_RISING;
+	} else if (is_fwnode_irqchip(domain->parent->fwnode)) {
+		fwspec.fwnode = domain->parent->fwnode;
+		fwspec.param_count = 2;
+		fwspec.param[0] = hwirq;
+		fwspec.param[1] = IRQ_TYPE_EDGE_RISING;
 	} else {
 		return -EINVAL;
 	}
@@ -255,6 +262,8 @@ static void gicv2m_teardown(void)
 		kfree(v2m->bm);
 		iounmap(v2m->base);
 		of_node_put(to_of_node(v2m->fwnode));
+		if (is_fwnode_irqchip(v2m->fwnode))
+			irq_domain_free_fwnode(v2m->fwnode);
 		kfree(v2m);
 	}
 }
@@ -359,6 +368,8 @@ static int __init gicv2m_init_one(struct fwnode_handle *fwnode,
 
 	if (to_of_node(fwnode))
 		name = to_of_node(fwnode)->name;
+	else
+		name = irq_domain_get_irqchip_fwnode_name(fwnode);
 
 	pr_info("Frame %s: range[%#lx:%#lx], SPI[%d:%d]\n", name,
 		(unsigned long)res->start, (unsigned long)res->end,
@@ -415,3 +426,87 @@ int __init gicv2m_of_init(struct device_node *node, struct irq_domain *parent)
 		gicv2m_teardown();
 	return ret;
 }
+
+#ifdef CONFIG_ACPI
+static int acpi_num_msi;
+
+static struct fwnode_handle *gicv2m_get_fwnode(struct device *dev)
+{
+	struct v2m_data *data;
+
+	if (WARN_ON(acpi_num_msi <= 0))
+		return NULL;
+
+	/* We only return the fwnode of the first MSI frame. */
+	data = list_first_entry_or_null(&v2m_nodes, struct v2m_data, entry);
+	if (!data)
+		return NULL;
+
+	return data->fwnode;
+}
+
+static int __init
+acpi_parse_madt_msi(struct acpi_subtable_header *header,
+		    const unsigned long end)
+{
+	int ret;
+	struct resource res;
+	u32 spi_start = 0, nr_spis = 0;
+	struct acpi_madt_generic_msi_frame *m;
+	struct fwnode_handle *fwnode = NULL;
+
+	m = (struct acpi_madt_generic_msi_frame *)header;
+	if (BAD_MADT_ENTRY(m, end))
+		return -EINVAL;
+
+	res.start = m->base_address;
+	res.end = m->base_address + 0x1000;
+
+	if (m->flags & ACPI_MADT_OVERRIDE_SPI_VALUES) {
+		spi_start = m->spi_base;
+		nr_spis = m->spi_count;
+
+		pr_info("ACPI overriding V2M MSI_TYPER (base:%u, num:%u)\n",
+			spi_start, nr_spis);
+	}
+
+	fwnode = irq_domain_alloc_fwnode((void *)m->base_address);
+	if (!fwnode) {
+		pr_err("Unable to allocate GICv2m domain token\n");
+		return -EINVAL;
+	}
+
+	ret = gicv2m_init_one(fwnode, spi_start, nr_spis, &res);
+	if (ret)
+		irq_domain_free_fwnode(fwnode);
+
+	return ret;
+}
+
+int __init gicv2m_acpi_init(struct irq_domain *parent)
+{
+	int ret;
+
+	if (acpi_num_msi > 0)
+		return 0;
+
+	acpi_num_msi = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_MSI_FRAME,
+				      acpi_parse_madt_msi, 0);
+
+	if (acpi_num_msi <= 0)
+		goto err_out;
+
+	ret = gicv2m_allocate_domains(parent);
+	if (ret)
+		goto err_out;
+
+	pci_msi_register_fwnode_provider(&gicv2m_get_fwnode);
+
+	return 0;
+
+err_out:
+	gicv2m_teardown();
+	return -EINVAL;
+}
+
+#endif /* CONFIG_ACPI */
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 6685b33..bb3e1f2 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -1329,6 +1329,9 @@ gic_v2_acpi_init(struct acpi_table_header *table)
 
 	__gic_init_bases(0, -1, dist_base, cpu_base, 0, domain_handle);
 
+	if (IS_ENABLED(CONFIG_ARM_GIC_V2M))
+		gicv2m_acpi_init(gic_data[0].domain);
+
 	acpi_set_irq_model(ACPI_IRQ_MODEL_GIC, domain_handle);
 	return 0;
 }
diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h
index bae69e5..30b2ccb 100644
--- a/include/linux/irqchip/arm-gic.h
+++ b/include/linux/irqchip/arm-gic.h
@@ -108,6 +108,10 @@ void gic_init(unsigned int nr, int start,
 
 int gicv2m_of_init(struct device_node *node, struct irq_domain *parent);
 
+#ifdef CONFIG_ACPI
+int gicv2m_acpi_init(struct irq_domain *parent);
+#endif
+
 void gic_send_sgi(unsigned int cpu_id, unsigned int irq);
 int gic_get_cpu_id(unsigned int cpu);
 void gic_migrate_target(unsigned int new_cpu_id);
-- 
2.1.0


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

* [PATCH V3 6/6] gicv2m: acpi: Introducing GICv2m ACPI support
@ 2015-10-21 18:47   ` Suravee Suthikulpanit
  0 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: marc.zyngier, tglx, jason, rjw
  Cc: Lorenzo Pieralisi, Will Deacon, Catalin Marinas, hanjun.guo,
	tomasz.nowicki, graeme.gregory, dhdang, linux-arm-kernel,
	linux-kernel, linux-acpi, Suravee Suthikulpanit

This patch introduces gicv2m_acpi_init(), which uses information
in MADT GIC MSI frames structure to initialize GICv2m driver.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
---
 drivers/irqchip/irq-gic-v2m.c   | 95 +++++++++++++++++++++++++++++++++++++++++
 drivers/irqchip/irq-gic.c       |  3 ++
 include/linux/irqchip/arm-gic.h |  4 ++
 3 files changed, 102 insertions(+)

diff --git a/drivers/irqchip/irq-gic-v2m.c b/drivers/irqchip/irq-gic-v2m.c
index 7e60f7e..4f52e9a 100644
--- a/drivers/irqchip/irq-gic-v2m.c
+++ b/drivers/irqchip/irq-gic-v2m.c
@@ -15,9 +15,11 @@
 
 #define pr_fmt(fmt) "GICv2m: " fmt
 
+#include <linux/acpi.h>
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
 #include <linux/kernel.h>
+#include <linux/msi.h>
 #include <linux/of_address.h>
 #include <linux/of_pci.h>
 #include <linux/slab.h>
@@ -138,6 +140,11 @@ static int gicv2m_irq_gic_domain_alloc(struct irq_domain *domain,
 		fwspec.param[0] = 0;
 		fwspec.param[1] = hwirq - 32;
 		fwspec.param[2] = IRQ_TYPE_EDGE_RISING;
+	} else if (is_fwnode_irqchip(domain->parent->fwnode)) {
+		fwspec.fwnode = domain->parent->fwnode;
+		fwspec.param_count = 2;
+		fwspec.param[0] = hwirq;
+		fwspec.param[1] = IRQ_TYPE_EDGE_RISING;
 	} else {
 		return -EINVAL;
 	}
@@ -255,6 +262,8 @@ static void gicv2m_teardown(void)
 		kfree(v2m->bm);
 		iounmap(v2m->base);
 		of_node_put(to_of_node(v2m->fwnode));
+		if (is_fwnode_irqchip(v2m->fwnode))
+			irq_domain_free_fwnode(v2m->fwnode);
 		kfree(v2m);
 	}
 }
@@ -359,6 +368,8 @@ static int __init gicv2m_init_one(struct fwnode_handle *fwnode,
 
 	if (to_of_node(fwnode))
 		name = to_of_node(fwnode)->name;
+	else
+		name = irq_domain_get_irqchip_fwnode_name(fwnode);
 
 	pr_info("Frame %s: range[%#lx:%#lx], SPI[%d:%d]\n", name,
 		(unsigned long)res->start, (unsigned long)res->end,
@@ -415,3 +426,87 @@ int __init gicv2m_of_init(struct device_node *node, struct irq_domain *parent)
 		gicv2m_teardown();
 	return ret;
 }
+
+#ifdef CONFIG_ACPI
+static int acpi_num_msi;
+
+static struct fwnode_handle *gicv2m_get_fwnode(struct device *dev)
+{
+	struct v2m_data *data;
+
+	if (WARN_ON(acpi_num_msi <= 0))
+		return NULL;
+
+	/* We only return the fwnode of the first MSI frame. */
+	data = list_first_entry_or_null(&v2m_nodes, struct v2m_data, entry);
+	if (!data)
+		return NULL;
+
+	return data->fwnode;
+}
+
+static int __init
+acpi_parse_madt_msi(struct acpi_subtable_header *header,
+		    const unsigned long end)
+{
+	int ret;
+	struct resource res;
+	u32 spi_start = 0, nr_spis = 0;
+	struct acpi_madt_generic_msi_frame *m;
+	struct fwnode_handle *fwnode = NULL;
+
+	m = (struct acpi_madt_generic_msi_frame *)header;
+	if (BAD_MADT_ENTRY(m, end))
+		return -EINVAL;
+
+	res.start = m->base_address;
+	res.end = m->base_address + 0x1000;
+
+	if (m->flags & ACPI_MADT_OVERRIDE_SPI_VALUES) {
+		spi_start = m->spi_base;
+		nr_spis = m->spi_count;
+
+		pr_info("ACPI overriding V2M MSI_TYPER (base:%u, num:%u)\n",
+			spi_start, nr_spis);
+	}
+
+	fwnode = irq_domain_alloc_fwnode((void *)m->base_address);
+	if (!fwnode) {
+		pr_err("Unable to allocate GICv2m domain token\n");
+		return -EINVAL;
+	}
+
+	ret = gicv2m_init_one(fwnode, spi_start, nr_spis, &res);
+	if (ret)
+		irq_domain_free_fwnode(fwnode);
+
+	return ret;
+}
+
+int __init gicv2m_acpi_init(struct irq_domain *parent)
+{
+	int ret;
+
+	if (acpi_num_msi > 0)
+		return 0;
+
+	acpi_num_msi = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_MSI_FRAME,
+				      acpi_parse_madt_msi, 0);
+
+	if (acpi_num_msi <= 0)
+		goto err_out;
+
+	ret = gicv2m_allocate_domains(parent);
+	if (ret)
+		goto err_out;
+
+	pci_msi_register_fwnode_provider(&gicv2m_get_fwnode);
+
+	return 0;
+
+err_out:
+	gicv2m_teardown();
+	return -EINVAL;
+}
+
+#endif /* CONFIG_ACPI */
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 6685b33..bb3e1f2 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -1329,6 +1329,9 @@ gic_v2_acpi_init(struct acpi_table_header *table)
 
 	__gic_init_bases(0, -1, dist_base, cpu_base, 0, domain_handle);
 
+	if (IS_ENABLED(CONFIG_ARM_GIC_V2M))
+		gicv2m_acpi_init(gic_data[0].domain);
+
 	acpi_set_irq_model(ACPI_IRQ_MODEL_GIC, domain_handle);
 	return 0;
 }
diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h
index bae69e5..30b2ccb 100644
--- a/include/linux/irqchip/arm-gic.h
+++ b/include/linux/irqchip/arm-gic.h
@@ -108,6 +108,10 @@ void gic_init(unsigned int nr, int start,
 
 int gicv2m_of_init(struct device_node *node, struct irq_domain *parent);
 
+#ifdef CONFIG_ACPI
+int gicv2m_acpi_init(struct irq_domain *parent);
+#endif
+
 void gic_send_sgi(unsigned int cpu_id, unsigned int irq);
 int gic_get_cpu_id(unsigned int cpu);
 void gic_migrate_target(unsigned int new_cpu_id);
-- 
2.1.0


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

* [PATCH V3 6/6] gicv2m: acpi: Introducing GICv2m ACPI support
@ 2015-10-21 18:47   ` Suravee Suthikulpanit
  0 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-21 18:47 UTC (permalink / raw)
  To: linux-arm-kernel

This patch introduces gicv2m_acpi_init(), which uses information
in MADT GIC MSI frames structure to initialize GICv2m driver.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
---
 drivers/irqchip/irq-gic-v2m.c   | 95 +++++++++++++++++++++++++++++++++++++++++
 drivers/irqchip/irq-gic.c       |  3 ++
 include/linux/irqchip/arm-gic.h |  4 ++
 3 files changed, 102 insertions(+)

diff --git a/drivers/irqchip/irq-gic-v2m.c b/drivers/irqchip/irq-gic-v2m.c
index 7e60f7e..4f52e9a 100644
--- a/drivers/irqchip/irq-gic-v2m.c
+++ b/drivers/irqchip/irq-gic-v2m.c
@@ -15,9 +15,11 @@
 
 #define pr_fmt(fmt) "GICv2m: " fmt
 
+#include <linux/acpi.h>
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
 #include <linux/kernel.h>
+#include <linux/msi.h>
 #include <linux/of_address.h>
 #include <linux/of_pci.h>
 #include <linux/slab.h>
@@ -138,6 +140,11 @@ static int gicv2m_irq_gic_domain_alloc(struct irq_domain *domain,
 		fwspec.param[0] = 0;
 		fwspec.param[1] = hwirq - 32;
 		fwspec.param[2] = IRQ_TYPE_EDGE_RISING;
+	} else if (is_fwnode_irqchip(domain->parent->fwnode)) {
+		fwspec.fwnode = domain->parent->fwnode;
+		fwspec.param_count = 2;
+		fwspec.param[0] = hwirq;
+		fwspec.param[1] = IRQ_TYPE_EDGE_RISING;
 	} else {
 		return -EINVAL;
 	}
@@ -255,6 +262,8 @@ static void gicv2m_teardown(void)
 		kfree(v2m->bm);
 		iounmap(v2m->base);
 		of_node_put(to_of_node(v2m->fwnode));
+		if (is_fwnode_irqchip(v2m->fwnode))
+			irq_domain_free_fwnode(v2m->fwnode);
 		kfree(v2m);
 	}
 }
@@ -359,6 +368,8 @@ static int __init gicv2m_init_one(struct fwnode_handle *fwnode,
 
 	if (to_of_node(fwnode))
 		name = to_of_node(fwnode)->name;
+	else
+		name = irq_domain_get_irqchip_fwnode_name(fwnode);
 
 	pr_info("Frame %s: range[%#lx:%#lx], SPI[%d:%d]\n", name,
 		(unsigned long)res->start, (unsigned long)res->end,
@@ -415,3 +426,87 @@ int __init gicv2m_of_init(struct device_node *node, struct irq_domain *parent)
 		gicv2m_teardown();
 	return ret;
 }
+
+#ifdef CONFIG_ACPI
+static int acpi_num_msi;
+
+static struct fwnode_handle *gicv2m_get_fwnode(struct device *dev)
+{
+	struct v2m_data *data;
+
+	if (WARN_ON(acpi_num_msi <= 0))
+		return NULL;
+
+	/* We only return the fwnode of the first MSI frame. */
+	data = list_first_entry_or_null(&v2m_nodes, struct v2m_data, entry);
+	if (!data)
+		return NULL;
+
+	return data->fwnode;
+}
+
+static int __init
+acpi_parse_madt_msi(struct acpi_subtable_header *header,
+		    const unsigned long end)
+{
+	int ret;
+	struct resource res;
+	u32 spi_start = 0, nr_spis = 0;
+	struct acpi_madt_generic_msi_frame *m;
+	struct fwnode_handle *fwnode = NULL;
+
+	m = (struct acpi_madt_generic_msi_frame *)header;
+	if (BAD_MADT_ENTRY(m, end))
+		return -EINVAL;
+
+	res.start = m->base_address;
+	res.end = m->base_address + 0x1000;
+
+	if (m->flags & ACPI_MADT_OVERRIDE_SPI_VALUES) {
+		spi_start = m->spi_base;
+		nr_spis = m->spi_count;
+
+		pr_info("ACPI overriding V2M MSI_TYPER (base:%u, num:%u)\n",
+			spi_start, nr_spis);
+	}
+
+	fwnode = irq_domain_alloc_fwnode((void *)m->base_address);
+	if (!fwnode) {
+		pr_err("Unable to allocate GICv2m domain token\n");
+		return -EINVAL;
+	}
+
+	ret = gicv2m_init_one(fwnode, spi_start, nr_spis, &res);
+	if (ret)
+		irq_domain_free_fwnode(fwnode);
+
+	return ret;
+}
+
+int __init gicv2m_acpi_init(struct irq_domain *parent)
+{
+	int ret;
+
+	if (acpi_num_msi > 0)
+		return 0;
+
+	acpi_num_msi = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_MSI_FRAME,
+				      acpi_parse_madt_msi, 0);
+
+	if (acpi_num_msi <= 0)
+		goto err_out;
+
+	ret = gicv2m_allocate_domains(parent);
+	if (ret)
+		goto err_out;
+
+	pci_msi_register_fwnode_provider(&gicv2m_get_fwnode);
+
+	return 0;
+
+err_out:
+	gicv2m_teardown();
+	return -EINVAL;
+}
+
+#endif /* CONFIG_ACPI */
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 6685b33..bb3e1f2 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -1329,6 +1329,9 @@ gic_v2_acpi_init(struct acpi_table_header *table)
 
 	__gic_init_bases(0, -1, dist_base, cpu_base, 0, domain_handle);
 
+	if (IS_ENABLED(CONFIG_ARM_GIC_V2M))
+		gicv2m_acpi_init(gic_data[0].domain);
+
 	acpi_set_irq_model(ACPI_IRQ_MODEL_GIC, domain_handle);
 	return 0;
 }
diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h
index bae69e5..30b2ccb 100644
--- a/include/linux/irqchip/arm-gic.h
+++ b/include/linux/irqchip/arm-gic.h
@@ -108,6 +108,10 @@ void gic_init(unsigned int nr, int start,
 
 int gicv2m_of_init(struct device_node *node, struct irq_domain *parent);
 
+#ifdef CONFIG_ACPI
+int gicv2m_acpi_init(struct irq_domain *parent);
+#endif
+
 void gic_send_sgi(unsigned int cpu_id, unsigned int irq);
 int gic_get_cpu_id(unsigned int cpu);
 void gic_migrate_target(unsigned int new_cpu_id);
-- 
2.1.0

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

* Re: [PATCH V3 0/6] gicv2m: acpi: Add ACPI support for GICv2m MSI
  2015-10-21 18:47 ` Suravee Suthikulpanit
@ 2015-10-29 21:25   ` Duc Dang
  -1 siblings, 0 replies; 41+ messages in thread
From: Duc Dang @ 2015-10-29 21:25 UTC (permalink / raw)
  To: Suravee Suthikulpanit
  Cc: Marc Zyngier, Thomas Gleixner, Jason Cooper, rjw,
	Lorenzo Pieralisi, Will Deacon, Catalin Marinas, hanjun.guo,
	tomasz.nowicki, graeme.gregory, linux-arm,
	Linux Kernel Mailing List, linux-acpi

Hi Suravee,
On Wed, Oct 21, 2015 at 11:47 AM, Suravee Suthikulpanit
<Suravee.Suthikulpanit@amd.com> wrote:
> This patch series has been forked from the following patch series since
> it no longer depends on the rest of the patches.
>
>   [PATCH v4 00/10] ACPI GIC Self-probing, GICv2m and GICv3 support
>   https://lkml.org/lkml/2015/7/29/234
>
> It has been ported to use the newly introduced device fwnode_handle
> for ACPI irqdmain introduced by Marc in the following patch series:
>
>   [PATCH v2 00/17] Divorcing irqdomain and device_node
>   http://git.kernel.org/cgit/linux/kernel/git/maz/arm-platforms.git irq/irq-domain-fwnode-v2
>
> The following git branch contains the submitted patches along with
> the pre-requsite patches (mainly for ARM64 PCI support for ACPI).
>
>   https://github.com/ssuthiku/linux.git v2m-multiframe-v3

I tried to clone your tree to test on my X-Gene platform but I didn't
see branch v2m-multiframe-v3.
I see similar patch set in origin/irq-domain-fwnode-v2-v2m-multiframe.
Can you please check?

>
> This has been tested on AMD Seattle (Overdrive) RevB system.
>
> NOTE: I have not tested ACPI GICv2m multiframe support since
> I don't have access to such system. Any helps are appreciated.
>
> Thanks,
> Suravee
>
> Changes from V2: (https://lkml.org/lkml/2015/10/14/1010)
>   - Minor clean up from Tomasz review comment in patch 6/6.
>
> Changes from V1: (https://lkml.org/lkml/2015/10/13/859)
>   - Rebase on top of Marc's patch to addng support for multiple MSI frames
>     (https://lkml.org/lkml/2015/10/14/271)
>   - Adding fwnode convenient functions (patch 3 and 4)
>
>
> Suravee Suthikulpanit (6):
>   pci: msi: Add support to query MSI domain for pci device
>   acpi: pci: Setup MSI domain for ACPI based pci devices
>   irqdomain: introduce is_fwnode_irqchip helper
>   irqdomain: Introduce irq_domain_get_irqchip_fwnode_name helper
>     function
>   gicv2m: Refactor to prepare for ACPI support
>   gicv2m: acpi: Introducing GICv2m ACPI support
>
>  drivers/irqchip/irq-gic-v2m.c   | 152 ++++++++++++++++++++++++++++++++++------
>  drivers/irqchip/irq-gic.c       |   5 +-
>  drivers/pci/msi.c               |  30 ++++++++
>  drivers/pci/pci-acpi.c          |  13 ++++
>  drivers/pci/probe.c             |   2 +
>  include/linux/irqchip/arm-gic.h |   4 ++
>  include/linux/irqdomain.h       |   6 ++
>  include/linux/msi.h             |   7 ++
>  include/linux/pci.h             |   7 ++
>  kernel/irq/irqdomain.c          |  20 +++++-
>  10 files changed, 223 insertions(+), 23 deletions(-)
>
> --
> 2.1.0
>

Regards,
Duc Dang.

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

* [PATCH V3 0/6] gicv2m: acpi: Add ACPI support for GICv2m MSI
@ 2015-10-29 21:25   ` Duc Dang
  0 siblings, 0 replies; 41+ messages in thread
From: Duc Dang @ 2015-10-29 21:25 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Suravee,
On Wed, Oct 21, 2015 at 11:47 AM, Suravee Suthikulpanit
<Suravee.Suthikulpanit@amd.com> wrote:
> This patch series has been forked from the following patch series since
> it no longer depends on the rest of the patches.
>
>   [PATCH v4 00/10] ACPI GIC Self-probing, GICv2m and GICv3 support
>   https://lkml.org/lkml/2015/7/29/234
>
> It has been ported to use the newly introduced device fwnode_handle
> for ACPI irqdmain introduced by Marc in the following patch series:
>
>   [PATCH v2 00/17] Divorcing irqdomain and device_node
>   http://git.kernel.org/cgit/linux/kernel/git/maz/arm-platforms.git irq/irq-domain-fwnode-v2
>
> The following git branch contains the submitted patches along with
> the pre-requsite patches (mainly for ARM64 PCI support for ACPI).
>
>   https://github.com/ssuthiku/linux.git v2m-multiframe-v3

I tried to clone your tree to test on my X-Gene platform but I didn't
see branch v2m-multiframe-v3.
I see similar patch set in origin/irq-domain-fwnode-v2-v2m-multiframe.
Can you please check?

>
> This has been tested on AMD Seattle (Overdrive) RevB system.
>
> NOTE: I have not tested ACPI GICv2m multiframe support since
> I don't have access to such system. Any helps are appreciated.
>
> Thanks,
> Suravee
>
> Changes from V2: (https://lkml.org/lkml/2015/10/14/1010)
>   - Minor clean up from Tomasz review comment in patch 6/6.
>
> Changes from V1: (https://lkml.org/lkml/2015/10/13/859)
>   - Rebase on top of Marc's patch to addng support for multiple MSI frames
>     (https://lkml.org/lkml/2015/10/14/271)
>   - Adding fwnode convenient functions (patch 3 and 4)
>
>
> Suravee Suthikulpanit (6):
>   pci: msi: Add support to query MSI domain for pci device
>   acpi: pci: Setup MSI domain for ACPI based pci devices
>   irqdomain: introduce is_fwnode_irqchip helper
>   irqdomain: Introduce irq_domain_get_irqchip_fwnode_name helper
>     function
>   gicv2m: Refactor to prepare for ACPI support
>   gicv2m: acpi: Introducing GICv2m ACPI support
>
>  drivers/irqchip/irq-gic-v2m.c   | 152 ++++++++++++++++++++++++++++++++++------
>  drivers/irqchip/irq-gic.c       |   5 +-
>  drivers/pci/msi.c               |  30 ++++++++
>  drivers/pci/pci-acpi.c          |  13 ++++
>  drivers/pci/probe.c             |   2 +
>  include/linux/irqchip/arm-gic.h |   4 ++
>  include/linux/irqdomain.h       |   6 ++
>  include/linux/msi.h             |   7 ++
>  include/linux/pci.h             |   7 ++
>  kernel/irq/irqdomain.c          |  20 +++++-
>  10 files changed, 223 insertions(+), 23 deletions(-)
>
> --
> 2.1.0
>

Regards,
Duc Dang.

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

* Re: [PATCH V3 0/6] gicv2m: acpi: Add ACPI support for GICv2m MSI
  2015-10-29 21:25   ` Duc Dang
  (?)
@ 2015-10-30 14:03     ` Suravee Suthikulpanit
  -1 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-30 14:03 UTC (permalink / raw)
  To: Duc Dang
  Cc: Marc Zyngier, Thomas Gleixner, Jason Cooper, rjw,
	Lorenzo Pieralisi, Will Deacon, Catalin Marinas, hanjun.guo,
	tomasz.nowicki, graeme.gregory, linux-arm,
	Linux Kernel Mailing List, linux-acpi

Hi Duc

On 10/29/15 16:25, Duc Dang wrote:
> Hi Suravee,
> On Wed, Oct 21, 2015 at 11:47 AM, Suravee Suthikulpanit
> <Suravee.Suthikulpanit@amd.com>  wrote:
>> >This patch series has been forked from the following patch series since
>> >it no longer depends on the rest of the patches.
>> >
>> >   [PATCH v4 00/10] ACPI GIC Self-probing, GICv2m and GICv3 support
>> >   https://lkml.org/lkml/2015/7/29/234
>> >
>> >It has been ported to use the newly introduced device fwnode_handle
>> >for ACPI irqdmain introduced by Marc in the following patch series:
>> >
>> >   [PATCH v2 00/17] Divorcing irqdomain and device_node
>> >   http://git.kernel.org/cgit/linux/kernel/git/maz/arm-platforms.git  irq/irq-domain-fwnode-v2
>> >
>> >The following git branch contains the submitted patches along with
>> >the pre-requsite patches (mainly for ARM64 PCI support for ACPI).
>> >
>> >   https://github.com/ssuthiku/linux.git  v2m-multiframe-v3
> I tried to clone your tree to test on my X-Gene platform but I didn't
> see branch v2m-multiframe-v3.
> I see similar patch set in origin/irq-domain-fwnode-v2-v2m-multiframe.
> Can you please check?
>

It should be there now. I might have forgotten to push it to my Github. 
Sorry for inconvenience, and thanks for testing.

Suravee

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

* Re: [PATCH V3 0/6] gicv2m: acpi: Add ACPI support for GICv2m MSI
@ 2015-10-30 14:03     ` Suravee Suthikulpanit
  0 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-30 14:03 UTC (permalink / raw)
  To: Duc Dang
  Cc: Marc Zyngier, Thomas Gleixner, Jason Cooper, rjw,
	Lorenzo Pieralisi, Will Deacon, Catalin Marinas, hanjun.guo,
	tomasz.nowicki, graeme.gregory, linux-arm,
	Linux Kernel Mailing List, linux-acpi

Hi Duc

On 10/29/15 16:25, Duc Dang wrote:
> Hi Suravee,
> On Wed, Oct 21, 2015 at 11:47 AM, Suravee Suthikulpanit
> <Suravee.Suthikulpanit@amd.com>  wrote:
>> >This patch series has been forked from the following patch series since
>> >it no longer depends on the rest of the patches.
>> >
>> >   [PATCH v4 00/10] ACPI GIC Self-probing, GICv2m and GICv3 support
>> >   https://lkml.org/lkml/2015/7/29/234
>> >
>> >It has been ported to use the newly introduced device fwnode_handle
>> >for ACPI irqdmain introduced by Marc in the following patch series:
>> >
>> >   [PATCH v2 00/17] Divorcing irqdomain and device_node
>> >   http://git.kernel.org/cgit/linux/kernel/git/maz/arm-platforms.git  irq/irq-domain-fwnode-v2
>> >
>> >The following git branch contains the submitted patches along with
>> >the pre-requsite patches (mainly for ARM64 PCI support for ACPI).
>> >
>> >   https://github.com/ssuthiku/linux.git  v2m-multiframe-v3
> I tried to clone your tree to test on my X-Gene platform but I didn't
> see branch v2m-multiframe-v3.
> I see similar patch set in origin/irq-domain-fwnode-v2-v2m-multiframe.
> Can you please check?
>

It should be there now. I might have forgotten to push it to my Github. 
Sorry for inconvenience, and thanks for testing.

Suravee

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

* [PATCH V3 0/6] gicv2m: acpi: Add ACPI support for GICv2m MSI
@ 2015-10-30 14:03     ` Suravee Suthikulpanit
  0 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-10-30 14:03 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Duc

On 10/29/15 16:25, Duc Dang wrote:
> Hi Suravee,
> On Wed, Oct 21, 2015 at 11:47 AM, Suravee Suthikulpanit
> <Suravee.Suthikulpanit@amd.com>  wrote:
>> >This patch series has been forked from the following patch series since
>> >it no longer depends on the rest of the patches.
>> >
>> >   [PATCH v4 00/10] ACPI GIC Self-probing, GICv2m and GICv3 support
>> >   https://lkml.org/lkml/2015/7/29/234
>> >
>> >It has been ported to use the newly introduced device fwnode_handle
>> >for ACPI irqdmain introduced by Marc in the following patch series:
>> >
>> >   [PATCH v2 00/17] Divorcing irqdomain and device_node
>> >   http://git.kernel.org/cgit/linux/kernel/git/maz/arm-platforms.git  irq/irq-domain-fwnode-v2
>> >
>> >The following git branch contains the submitted patches along with
>> >the pre-requsite patches (mainly for ARM64 PCI support for ACPI).
>> >
>> >   https://github.com/ssuthiku/linux.git  v2m-multiframe-v3
> I tried to clone your tree to test on my X-Gene platform but I didn't
> see branch v2m-multiframe-v3.
> I see similar patch set in origin/irq-domain-fwnode-v2-v2m-multiframe.
> Can you please check?
>

It should be there now. I might have forgotten to push it to my Github. 
Sorry for inconvenience, and thanks for testing.

Suravee

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

* Re: [PATCH V3 0/6] gicv2m: acpi: Add ACPI support for GICv2m MSI
  2015-10-30 14:03     ` Suravee Suthikulpanit
@ 2015-10-30 16:53       ` Duc Dang
  -1 siblings, 0 replies; 41+ messages in thread
From: Duc Dang @ 2015-10-30 16:53 UTC (permalink / raw)
  To: Suravee Suthikulpanit
  Cc: Marc Zyngier, Thomas Gleixner, Jason Cooper, rjw,
	Lorenzo Pieralisi, Will Deacon, Catalin Marinas, Hanjun Guo,
	Tomasz Nowicki, G Gregory, linux-arm, Linux Kernel Mailing List,
	linux-acpi

On Fri, Oct 30, 2015 at 7:03 AM, Suravee Suthikulpanit
<Suravee.Suthikulpanit@amd.com> wrote:
> Hi Duc
>
> On 10/29/15 16:25, Duc Dang wrote:
>>
>> Hi Suravee,
>> On Wed, Oct 21, 2015 at 11:47 AM, Suravee Suthikulpanit
>> <Suravee.Suthikulpanit@amd.com>  wrote:
>>>
>>> >This patch series has been forked from the following patch series since
>>> >it no longer depends on the rest of the patches.
>>> >
>>> >   [PATCH v4 00/10] ACPI GIC Self-probing, GICv2m and GICv3 support
>>> >   https://lkml.org/lkml/2015/7/29/234
>>> >
>>> >It has been ported to use the newly introduced device fwnode_handle
>>> >for ACPI irqdmain introduced by Marc in the following patch series:
>>> >
>>> >   [PATCH v2 00/17] Divorcing irqdomain and device_node
>>> >   http://git.kernel.org/cgit/linux/kernel/git/maz/arm-platforms.git
>>> > irq/irq-domain-fwnode-v2
>>> >
>>> >The following git branch contains the submitted patches along with
>>> >the pre-requsite patches (mainly for ARM64 PCI support for ACPI).
>>> >
>>> >   https://github.com/ssuthiku/linux.git  v2m-multiframe-v3
>>
>> I tried to clone your tree to test on my X-Gene platform but I didn't
>> see branch v2m-multiframe-v3.
>> I see similar patch set in origin/irq-domain-fwnode-v2-v2m-multiframe.
>> Can you please check?
>>
>
> It should be there now. I might have forgotten to push it to my Github.
> Sorry for inconvenience, and thanks for testing.

Thanks Suravee. I see branch v2m-multiframe-v3 now. I will test and
update you soon.

>
> Suravee

Regards,
Duc Dang.

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

* [PATCH V3 0/6] gicv2m: acpi: Add ACPI support for GICv2m MSI
@ 2015-10-30 16:53       ` Duc Dang
  0 siblings, 0 replies; 41+ messages in thread
From: Duc Dang @ 2015-10-30 16:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Oct 30, 2015 at 7:03 AM, Suravee Suthikulpanit
<Suravee.Suthikulpanit@amd.com> wrote:
> Hi Duc
>
> On 10/29/15 16:25, Duc Dang wrote:
>>
>> Hi Suravee,
>> On Wed, Oct 21, 2015 at 11:47 AM, Suravee Suthikulpanit
>> <Suravee.Suthikulpanit@amd.com>  wrote:
>>>
>>> >This patch series has been forked from the following patch series since
>>> >it no longer depends on the rest of the patches.
>>> >
>>> >   [PATCH v4 00/10] ACPI GIC Self-probing, GICv2m and GICv3 support
>>> >   https://lkml.org/lkml/2015/7/29/234
>>> >
>>> >It has been ported to use the newly introduced device fwnode_handle
>>> >for ACPI irqdmain introduced by Marc in the following patch series:
>>> >
>>> >   [PATCH v2 00/17] Divorcing irqdomain and device_node
>>> >   http://git.kernel.org/cgit/linux/kernel/git/maz/arm-platforms.git
>>> > irq/irq-domain-fwnode-v2
>>> >
>>> >The following git branch contains the submitted patches along with
>>> >the pre-requsite patches (mainly for ARM64 PCI support for ACPI).
>>> >
>>> >   https://github.com/ssuthiku/linux.git  v2m-multiframe-v3
>>
>> I tried to clone your tree to test on my X-Gene platform but I didn't
>> see branch v2m-multiframe-v3.
>> I see similar patch set in origin/irq-domain-fwnode-v2-v2m-multiframe.
>> Can you please check?
>>
>
> It should be there now. I might have forgotten to push it to my Github.
> Sorry for inconvenience, and thanks for testing.

Thanks Suravee. I see branch v2m-multiframe-v3 now. I will test and
update you soon.

>
> Suravee

Regards,
Duc Dang.

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

* Re: [PATCH V3 2/6] acpi: pci: Setup MSI domain for ACPI based pci devices
  2015-10-21 18:47   ` Suravee Suthikulpanit
  (?)
@ 2015-11-19 12:08     ` Marc Zyngier
  -1 siblings, 0 replies; 41+ messages in thread
From: Marc Zyngier @ 2015-11-19 12:08 UTC (permalink / raw)
  To: Suravee Suthikulpanit
  Cc: tglx, jason, rjw, Lorenzo Pieralisi, Will Deacon,
	Catalin Marinas, hanjun.guo, tomasz.nowicki, graeme.gregory,
	dhdang, linux-arm-kernel, linux-kernel, linux-acpi

On Wed, 21 Oct 2015 11:47:25 -0700
Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:

Hi Suravee,

Sorry it took so long to get to this series. Comments below.

> This patch introduces pci_host_bridge_acpi_msi_domain(), which returns
> the MSI domain of the specified PCI host bridge with DOMAIN_BUS_PCI_MSI
> bus token. Then, it is assigned to pci device.
> 
> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> ---
>  drivers/pci/pci-acpi.c | 13 +++++++++++++
>  drivers/pci/probe.c    |  2 ++
>  include/linux/pci.h    |  7 +++++++
>  3 files changed, 22 insertions(+)
> 
> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
> index a32ba75..0e21ef4 100644
> --- a/drivers/pci/pci-acpi.c
> +++ b/drivers/pci/pci-acpi.c
> @@ -9,7 +9,9 @@
>  
>  #include <linux/delay.h>
>  #include <linux/init.h>
> +#include <linux/irqdomain.h>
>  #include <linux/pci.h>
> +#include <linux/msi.h>
>  #include <linux/pci_hotplug.h>
>  #include <linux/module.h>
>  #include <linux/pci-aspm.h>
> @@ -689,6 +691,17 @@ static struct acpi_bus_type acpi_pci_bus = {
>  	.cleanup = pci_acpi_cleanup,
>  };
>  
> +struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
> +{
> +	struct irq_domain *dom = NULL;
> +	struct fwnode_handle *fwnode = pci_msi_get_fwnode(&bus->dev);
> +
> +	if (fwnode)
> +		dom = irq_find_matching_fwnode(fwnode,
> +					       DOMAIN_BUS_PCI_MSI);
> +	return dom;
> +}
> +

Given this, I really question the need for what you define in patch #1
to be standalone. It is only used by ACPI (DT has its own private
helpers), and it is so far unlikely that it will be of any use for
other firmware interfaces.

My suggestion is to get rid of pci_msi_get_fwnode() and move the
registration helper into this file. That'd be much simpler.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny.

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

* Re: [PATCH V3 2/6] acpi: pci: Setup MSI domain for ACPI based pci devices
@ 2015-11-19 12:08     ` Marc Zyngier
  0 siblings, 0 replies; 41+ messages in thread
From: Marc Zyngier @ 2015-11-19 12:08 UTC (permalink / raw)
  To: Suravee Suthikulpanit
  Cc: tglx, jason, rjw, Lorenzo Pieralisi, Will Deacon,
	Catalin Marinas, hanjun.guo, tomasz.nowicki, graeme.gregory,
	dhdang, linux-arm-kernel, linux-kernel, linux-acpi

On Wed, 21 Oct 2015 11:47:25 -0700
Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:

Hi Suravee,

Sorry it took so long to get to this series. Comments below.

> This patch introduces pci_host_bridge_acpi_msi_domain(), which returns
> the MSI domain of the specified PCI host bridge with DOMAIN_BUS_PCI_MSI
> bus token. Then, it is assigned to pci device.
> 
> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> ---
>  drivers/pci/pci-acpi.c | 13 +++++++++++++
>  drivers/pci/probe.c    |  2 ++
>  include/linux/pci.h    |  7 +++++++
>  3 files changed, 22 insertions(+)
> 
> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
> index a32ba75..0e21ef4 100644
> --- a/drivers/pci/pci-acpi.c
> +++ b/drivers/pci/pci-acpi.c
> @@ -9,7 +9,9 @@
>  
>  #include <linux/delay.h>
>  #include <linux/init.h>
> +#include <linux/irqdomain.h>
>  #include <linux/pci.h>
> +#include <linux/msi.h>
>  #include <linux/pci_hotplug.h>
>  #include <linux/module.h>
>  #include <linux/pci-aspm.h>
> @@ -689,6 +691,17 @@ static struct acpi_bus_type acpi_pci_bus = {
>  	.cleanup = pci_acpi_cleanup,
>  };
>  
> +struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
> +{
> +	struct irq_domain *dom = NULL;
> +	struct fwnode_handle *fwnode = pci_msi_get_fwnode(&bus->dev);
> +
> +	if (fwnode)
> +		dom = irq_find_matching_fwnode(fwnode,
> +					       DOMAIN_BUS_PCI_MSI);
> +	return dom;
> +}
> +

Given this, I really question the need for what you define in patch #1
to be standalone. It is only used by ACPI (DT has its own private
helpers), and it is so far unlikely that it will be of any use for
other firmware interfaces.

My suggestion is to get rid of pci_msi_get_fwnode() and move the
registration helper into this file. That'd be much simpler.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny.

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

* [PATCH V3 2/6] acpi: pci: Setup MSI domain for ACPI based pci devices
@ 2015-11-19 12:08     ` Marc Zyngier
  0 siblings, 0 replies; 41+ messages in thread
From: Marc Zyngier @ 2015-11-19 12:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 21 Oct 2015 11:47:25 -0700
Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:

Hi Suravee,

Sorry it took so long to get to this series. Comments below.

> This patch introduces pci_host_bridge_acpi_msi_domain(), which returns
> the MSI domain of the specified PCI host bridge with DOMAIN_BUS_PCI_MSI
> bus token. Then, it is assigned to pci device.
> 
> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> ---
>  drivers/pci/pci-acpi.c | 13 +++++++++++++
>  drivers/pci/probe.c    |  2 ++
>  include/linux/pci.h    |  7 +++++++
>  3 files changed, 22 insertions(+)
> 
> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
> index a32ba75..0e21ef4 100644
> --- a/drivers/pci/pci-acpi.c
> +++ b/drivers/pci/pci-acpi.c
> @@ -9,7 +9,9 @@
>  
>  #include <linux/delay.h>
>  #include <linux/init.h>
> +#include <linux/irqdomain.h>
>  #include <linux/pci.h>
> +#include <linux/msi.h>
>  #include <linux/pci_hotplug.h>
>  #include <linux/module.h>
>  #include <linux/pci-aspm.h>
> @@ -689,6 +691,17 @@ static struct acpi_bus_type acpi_pci_bus = {
>  	.cleanup = pci_acpi_cleanup,
>  };
>  
> +struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
> +{
> +	struct irq_domain *dom = NULL;
> +	struct fwnode_handle *fwnode = pci_msi_get_fwnode(&bus->dev);
> +
> +	if (fwnode)
> +		dom = irq_find_matching_fwnode(fwnode,
> +					       DOMAIN_BUS_PCI_MSI);
> +	return dom;
> +}
> +

Given this, I really question the need for what you define in patch #1
to be standalone. It is only used by ACPI (DT has its own private
helpers), and it is so far unlikely that it will be of any use for
other firmware interfaces.

My suggestion is to get rid of pci_msi_get_fwnode() and move the
registration helper into this file. That'd be much simpler.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny.

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

* Re: [PATCH V3 2/6] acpi: pci: Setup MSI domain for ACPI based pci devices
  2015-11-19 12:08     ` Marc Zyngier
  (?)
@ 2015-11-21 21:18       ` Suravee Suthikulpanit
  -1 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-11-21 21:18 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: tglx, jason, rjw, Lorenzo Pieralisi, Will Deacon,
	Catalin Marinas, hanjun.guo, tomasz.nowicki, graeme.gregory,
	dhdang, linux-arm-kernel, linux-kernel, linux-acpi

Hi Marc,

On 11/19/15 06:08, Marc Zyngier wrote:
> On Wed, 21 Oct 2015 11:47:25 -0700
> Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:
>
> Hi Suravee,
>
> Sorry it took so long to get to this series. Comments below.

No worry.

>
>> This patch introduces pci_host_bridge_acpi_msi_domain(), which returns
>> the MSI domain of the specified PCI host bridge with DOMAIN_BUS_PCI_MSI
>> bus token. Then, it is assigned to pci device.
>>
>> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
>> ---
>>   drivers/pci/pci-acpi.c | 13 +++++++++++++
>>   drivers/pci/probe.c    |  2 ++
>>   include/linux/pci.h    |  7 +++++++
>>   3 files changed, 22 insertions(+)
>>
>> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
>> index a32ba75..0e21ef4 100644
>> --- a/drivers/pci/pci-acpi.c
>> +++ b/drivers/pci/pci-acpi.c
>> @@ -9,7 +9,9 @@
>>
>>   #include <linux/delay.h>
>>   #include <linux/init.h>
>> +#include <linux/irqdomain.h>
>>   #include <linux/pci.h>
>> +#include <linux/msi.h>
>>   #include <linux/pci_hotplug.h>
>>   #include <linux/module.h>
>>   #include <linux/pci-aspm.h>
>> @@ -689,6 +691,17 @@ static struct acpi_bus_type acpi_pci_bus = {
>>   	.cleanup = pci_acpi_cleanup,
>>   };
>>
>> +struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
>> +{
>> +	struct irq_domain *dom = NULL;
>> +	struct fwnode_handle *fwnode = pci_msi_get_fwnode(&bus->dev);
>> +
>> +	if (fwnode)
>> +		dom = irq_find_matching_fwnode(fwnode,
>> +					       DOMAIN_BUS_PCI_MSI);
>> +	return dom;
>> +}
>> +
>
> Given this, I really question the need for what you define in patch #1
> to be standalone. It is only used by ACPI (DT has its own private
> helpers), and it is so far unlikely that it will be of any use for
> other firmware interfaces.
>
> My suggestion is to get rid of pci_msi_get_fwnode() and move the
> registration helper into this file. That'd be much simpler.
>
> Thanks,
>
> 	M.
>

Ok, I'll take care of this. I assume the rest of the patches looks ok.

Thanks,
Suravee

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

* Re: [PATCH V3 2/6] acpi: pci: Setup MSI domain for ACPI based pci devices
@ 2015-11-21 21:18       ` Suravee Suthikulpanit
  0 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-11-21 21:18 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: tglx, jason, rjw, Lorenzo Pieralisi, Will Deacon,
	Catalin Marinas, hanjun.guo, tomasz.nowicki, graeme.gregory,
	dhdang, linux-arm-kernel, linux-kernel, linux-acpi

Hi Marc,

On 11/19/15 06:08, Marc Zyngier wrote:
> On Wed, 21 Oct 2015 11:47:25 -0700
> Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:
>
> Hi Suravee,
>
> Sorry it took so long to get to this series. Comments below.

No worry.

>
>> This patch introduces pci_host_bridge_acpi_msi_domain(), which returns
>> the MSI domain of the specified PCI host bridge with DOMAIN_BUS_PCI_MSI
>> bus token. Then, it is assigned to pci device.
>>
>> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
>> ---
>>   drivers/pci/pci-acpi.c | 13 +++++++++++++
>>   drivers/pci/probe.c    |  2 ++
>>   include/linux/pci.h    |  7 +++++++
>>   3 files changed, 22 insertions(+)
>>
>> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
>> index a32ba75..0e21ef4 100644
>> --- a/drivers/pci/pci-acpi.c
>> +++ b/drivers/pci/pci-acpi.c
>> @@ -9,7 +9,9 @@
>>
>>   #include <linux/delay.h>
>>   #include <linux/init.h>
>> +#include <linux/irqdomain.h>
>>   #include <linux/pci.h>
>> +#include <linux/msi.h>
>>   #include <linux/pci_hotplug.h>
>>   #include <linux/module.h>
>>   #include <linux/pci-aspm.h>
>> @@ -689,6 +691,17 @@ static struct acpi_bus_type acpi_pci_bus = {
>>   	.cleanup = pci_acpi_cleanup,
>>   };
>>
>> +struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
>> +{
>> +	struct irq_domain *dom = NULL;
>> +	struct fwnode_handle *fwnode = pci_msi_get_fwnode(&bus->dev);
>> +
>> +	if (fwnode)
>> +		dom = irq_find_matching_fwnode(fwnode,
>> +					       DOMAIN_BUS_PCI_MSI);
>> +	return dom;
>> +}
>> +
>
> Given this, I really question the need for what you define in patch #1
> to be standalone. It is only used by ACPI (DT has its own private
> helpers), and it is so far unlikely that it will be of any use for
> other firmware interfaces.
>
> My suggestion is to get rid of pci_msi_get_fwnode() and move the
> registration helper into this file. That'd be much simpler.
>
> Thanks,
>
> 	M.
>

Ok, I'll take care of this. I assume the rest of the patches looks ok.

Thanks,
Suravee

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

* [PATCH V3 2/6] acpi: pci: Setup MSI domain for ACPI based pci devices
@ 2015-11-21 21:18       ` Suravee Suthikulpanit
  0 siblings, 0 replies; 41+ messages in thread
From: Suravee Suthikulpanit @ 2015-11-21 21:18 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Marc,

On 11/19/15 06:08, Marc Zyngier wrote:
> On Wed, 21 Oct 2015 11:47:25 -0700
> Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:
>
> Hi Suravee,
>
> Sorry it took so long to get to this series. Comments below.

No worry.

>
>> This patch introduces pci_host_bridge_acpi_msi_domain(), which returns
>> the MSI domain of the specified PCI host bridge with DOMAIN_BUS_PCI_MSI
>> bus token. Then, it is assigned to pci device.
>>
>> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
>> ---
>>   drivers/pci/pci-acpi.c | 13 +++++++++++++
>>   drivers/pci/probe.c    |  2 ++
>>   include/linux/pci.h    |  7 +++++++
>>   3 files changed, 22 insertions(+)
>>
>> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
>> index a32ba75..0e21ef4 100644
>> --- a/drivers/pci/pci-acpi.c
>> +++ b/drivers/pci/pci-acpi.c
>> @@ -9,7 +9,9 @@
>>
>>   #include <linux/delay.h>
>>   #include <linux/init.h>
>> +#include <linux/irqdomain.h>
>>   #include <linux/pci.h>
>> +#include <linux/msi.h>
>>   #include <linux/pci_hotplug.h>
>>   #include <linux/module.h>
>>   #include <linux/pci-aspm.h>
>> @@ -689,6 +691,17 @@ static struct acpi_bus_type acpi_pci_bus = {
>>   	.cleanup = pci_acpi_cleanup,
>>   };
>>
>> +struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
>> +{
>> +	struct irq_domain *dom = NULL;
>> +	struct fwnode_handle *fwnode = pci_msi_get_fwnode(&bus->dev);
>> +
>> +	if (fwnode)
>> +		dom = irq_find_matching_fwnode(fwnode,
>> +					       DOMAIN_BUS_PCI_MSI);
>> +	return dom;
>> +}
>> +
>
> Given this, I really question the need for what you define in patch #1
> to be standalone. It is only used by ACPI (DT has its own private
> helpers), and it is so far unlikely that it will be of any use for
> other firmware interfaces.
>
> My suggestion is to get rid of pci_msi_get_fwnode() and move the
> registration helper into this file. That'd be much simpler.
>
> Thanks,
>
> 	M.
>

Ok, I'll take care of this. I assume the rest of the patches looks ok.

Thanks,
Suravee

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

* Re: [PATCH V3 2/6] acpi: pci: Setup MSI domain for ACPI based pci devices
  2015-11-21 21:18       ` Suravee Suthikulpanit
  (?)
@ 2015-11-22 11:35         ` Marc Zyngier
  -1 siblings, 0 replies; 41+ messages in thread
From: Marc Zyngier @ 2015-11-22 11:35 UTC (permalink / raw)
  To: Suravee Suthikulpanit
  Cc: tglx, jason, rjw, Lorenzo Pieralisi, Will Deacon,
	Catalin Marinas, hanjun.guo, tomasz.nowicki, graeme.gregory,
	dhdang, linux-arm-kernel, linux-kernel, linux-acpi

On Sat, 21 Nov 2015 15:18:45 -0600
Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:

> Hi Marc,
> 
> On 11/19/15 06:08, Marc Zyngier wrote:
> > On Wed, 21 Oct 2015 11:47:25 -0700
> > Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:
> >
> > Hi Suravee,
> >
> > Sorry it took so long to get to this series. Comments below.
> 
> No worry.
> 
> >
> >> This patch introduces pci_host_bridge_acpi_msi_domain(), which returns
> >> the MSI domain of the specified PCI host bridge with DOMAIN_BUS_PCI_MSI
> >> bus token. Then, it is assigned to pci device.
> >>
> >> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> >> ---
> >>   drivers/pci/pci-acpi.c | 13 +++++++++++++
> >>   drivers/pci/probe.c    |  2 ++
> >>   include/linux/pci.h    |  7 +++++++
> >>   3 files changed, 22 insertions(+)
> >>
> >> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
> >> index a32ba75..0e21ef4 100644
> >> --- a/drivers/pci/pci-acpi.c
> >> +++ b/drivers/pci/pci-acpi.c
> >> @@ -9,7 +9,9 @@
> >>
> >>   #include <linux/delay.h>
> >>   #include <linux/init.h>
> >> +#include <linux/irqdomain.h>
> >>   #include <linux/pci.h>
> >> +#include <linux/msi.h>
> >>   #include <linux/pci_hotplug.h>
> >>   #include <linux/module.h>
> >>   #include <linux/pci-aspm.h>
> >> @@ -689,6 +691,17 @@ static struct acpi_bus_type acpi_pci_bus = {
> >>   	.cleanup = pci_acpi_cleanup,
> >>   };
> >>
> >> +struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
> >> +{
> >> +	struct irq_domain *dom = NULL;
> >> +	struct fwnode_handle *fwnode = pci_msi_get_fwnode(&bus->dev);
> >> +
> >> +	if (fwnode)
> >> +		dom = irq_find_matching_fwnode(fwnode,
> >> +					       DOMAIN_BUS_PCI_MSI);
> >> +	return dom;
> >> +}
> >> +
> >
> > Given this, I really question the need for what you define in patch #1
> > to be standalone. It is only used by ACPI (DT has its own private
> > helpers), and it is so far unlikely that it will be of any use for
> > other firmware interfaces.
> >
> > My suggestion is to get rid of pci_msi_get_fwnode() and move the
> > registration helper into this file. That'd be much simpler.
> >
> > Thanks,
> >
> > 	M.
> >
> 
> Ok, I'll take care of this. I assume the rest of the patches looks ok.

I still need to finish going through it (I have minor comments so far
on some of the other patches), but I want to get the core ACPI stuff in
shape before doing anything else.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny.

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

* Re: [PATCH V3 2/6] acpi: pci: Setup MSI domain for ACPI based pci devices
@ 2015-11-22 11:35         ` Marc Zyngier
  0 siblings, 0 replies; 41+ messages in thread
From: Marc Zyngier @ 2015-11-22 11:35 UTC (permalink / raw)
  To: Suravee Suthikulpanit
  Cc: tglx, jason, rjw, Lorenzo Pieralisi, Will Deacon,
	Catalin Marinas, hanjun.guo, tomasz.nowicki, graeme.gregory,
	dhdang, linux-arm-kernel, linux-kernel, linux-acpi

On Sat, 21 Nov 2015 15:18:45 -0600
Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:

> Hi Marc,
> 
> On 11/19/15 06:08, Marc Zyngier wrote:
> > On Wed, 21 Oct 2015 11:47:25 -0700
> > Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:
> >
> > Hi Suravee,
> >
> > Sorry it took so long to get to this series. Comments below.
> 
> No worry.
> 
> >
> >> This patch introduces pci_host_bridge_acpi_msi_domain(), which returns
> >> the MSI domain of the specified PCI host bridge with DOMAIN_BUS_PCI_MSI
> >> bus token. Then, it is assigned to pci device.
> >>
> >> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> >> ---
> >>   drivers/pci/pci-acpi.c | 13 +++++++++++++
> >>   drivers/pci/probe.c    |  2 ++
> >>   include/linux/pci.h    |  7 +++++++
> >>   3 files changed, 22 insertions(+)
> >>
> >> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
> >> index a32ba75..0e21ef4 100644
> >> --- a/drivers/pci/pci-acpi.c
> >> +++ b/drivers/pci/pci-acpi.c
> >> @@ -9,7 +9,9 @@
> >>
> >>   #include <linux/delay.h>
> >>   #include <linux/init.h>
> >> +#include <linux/irqdomain.h>
> >>   #include <linux/pci.h>
> >> +#include <linux/msi.h>
> >>   #include <linux/pci_hotplug.h>
> >>   #include <linux/module.h>
> >>   #include <linux/pci-aspm.h>
> >> @@ -689,6 +691,17 @@ static struct acpi_bus_type acpi_pci_bus = {
> >>   	.cleanup = pci_acpi_cleanup,
> >>   };
> >>
> >> +struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
> >> +{
> >> +	struct irq_domain *dom = NULL;
> >> +	struct fwnode_handle *fwnode = pci_msi_get_fwnode(&bus->dev);
> >> +
> >> +	if (fwnode)
> >> +		dom = irq_find_matching_fwnode(fwnode,
> >> +					       DOMAIN_BUS_PCI_MSI);
> >> +	return dom;
> >> +}
> >> +
> >
> > Given this, I really question the need for what you define in patch #1
> > to be standalone. It is only used by ACPI (DT has its own private
> > helpers), and it is so far unlikely that it will be of any use for
> > other firmware interfaces.
> >
> > My suggestion is to get rid of pci_msi_get_fwnode() and move the
> > registration helper into this file. That'd be much simpler.
> >
> > Thanks,
> >
> > 	M.
> >
> 
> Ok, I'll take care of this. I assume the rest of the patches looks ok.

I still need to finish going through it (I have minor comments so far
on some of the other patches), but I want to get the core ACPI stuff in
shape before doing anything else.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny.

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

* [PATCH V3 2/6] acpi: pci: Setup MSI domain for ACPI based pci devices
@ 2015-11-22 11:35         ` Marc Zyngier
  0 siblings, 0 replies; 41+ messages in thread
From: Marc Zyngier @ 2015-11-22 11:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, 21 Nov 2015 15:18:45 -0600
Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:

> Hi Marc,
> 
> On 11/19/15 06:08, Marc Zyngier wrote:
> > On Wed, 21 Oct 2015 11:47:25 -0700
> > Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:
> >
> > Hi Suravee,
> >
> > Sorry it took so long to get to this series. Comments below.
> 
> No worry.
> 
> >
> >> This patch introduces pci_host_bridge_acpi_msi_domain(), which returns
> >> the MSI domain of the specified PCI host bridge with DOMAIN_BUS_PCI_MSI
> >> bus token. Then, it is assigned to pci device.
> >>
> >> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> >> ---
> >>   drivers/pci/pci-acpi.c | 13 +++++++++++++
> >>   drivers/pci/probe.c    |  2 ++
> >>   include/linux/pci.h    |  7 +++++++
> >>   3 files changed, 22 insertions(+)
> >>
> >> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
> >> index a32ba75..0e21ef4 100644
> >> --- a/drivers/pci/pci-acpi.c
> >> +++ b/drivers/pci/pci-acpi.c
> >> @@ -9,7 +9,9 @@
> >>
> >>   #include <linux/delay.h>
> >>   #include <linux/init.h>
> >> +#include <linux/irqdomain.h>
> >>   #include <linux/pci.h>
> >> +#include <linux/msi.h>
> >>   #include <linux/pci_hotplug.h>
> >>   #include <linux/module.h>
> >>   #include <linux/pci-aspm.h>
> >> @@ -689,6 +691,17 @@ static struct acpi_bus_type acpi_pci_bus = {
> >>   	.cleanup = pci_acpi_cleanup,
> >>   };
> >>
> >> +struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
> >> +{
> >> +	struct irq_domain *dom = NULL;
> >> +	struct fwnode_handle *fwnode = pci_msi_get_fwnode(&bus->dev);
> >> +
> >> +	if (fwnode)
> >> +		dom = irq_find_matching_fwnode(fwnode,
> >> +					       DOMAIN_BUS_PCI_MSI);
> >> +	return dom;
> >> +}
> >> +
> >
> > Given this, I really question the need for what you define in patch #1
> > to be standalone. It is only used by ACPI (DT has its own private
> > helpers), and it is so far unlikely that it will be of any use for
> > other firmware interfaces.
> >
> > My suggestion is to get rid of pci_msi_get_fwnode() and move the
> > registration helper into this file. That'd be much simpler.
> >
> > Thanks,
> >
> > 	M.
> >
> 
> Ok, I'll take care of this. I assume the rest of the patches looks ok.

I still need to finish going through it (I have minor comments so far
on some of the other patches), but I want to get the core ACPI stuff in
shape before doing anything else.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny.

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

* Re: [PATCH V3 2/6] acpi: pci: Setup MSI domain for ACPI based pci devices
  2015-11-22 11:35         ` Marc Zyngier
@ 2015-12-06 18:03           ` Tomasz Nowicki
  -1 siblings, 0 replies; 41+ messages in thread
From: Tomasz Nowicki @ 2015-12-06 18:03 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Suravee Suthikulpanit, tglx, jason, rjw, Lorenzo Pieralisi,
	Will Deacon, Catalin Marinas, hanjun.guo, tomasz.nowicki,
	graeme.gregory, dhdang, linux-arm-kernel, linux-kernel,
	linux-acpi

Hi Marc,


On 11/22/2015 12:35 PM, Marc Zyngier wrote:
> On Sat, 21 Nov 2015 15:18:45 -0600
> Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:
>
>> Hi Marc,
>>
>> On 11/19/15 06:08, Marc Zyngier wrote:
>>> On Wed, 21 Oct 2015 11:47:25 -0700
>>> Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:
>>>
>>> Hi Suravee,
>>>
>>> Sorry it took so long to get to this series. Comments below.
>> No worry.
>>
>>>> This patch introduces pci_host_bridge_acpi_msi_domain(), which returns
>>>> the MSI domain of the specified PCI host bridge with DOMAIN_BUS_PCI_MSI
>>>> bus token. Then, it is assigned to pci device.
>>>>
>>>> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
>>>> ---
>>>>    drivers/pci/pci-acpi.c | 13 +++++++++++++
>>>>    drivers/pci/probe.c    |  2 ++
>>>>    include/linux/pci.h    |  7 +++++++
>>>>    3 files changed, 22 insertions(+)
>>>>
>>>> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
>>>> index a32ba75..0e21ef4 100644
>>>> --- a/drivers/pci/pci-acpi.c
>>>> +++ b/drivers/pci/pci-acpi.c
>>>> @@ -9,7 +9,9 @@
>>>>
>>>>    #include <linux/delay.h>
>>>>    #include <linux/init.h>
>>>> +#include <linux/irqdomain.h>
>>>>    #include <linux/pci.h>
>>>> +#include <linux/msi.h>
>>>>    #include <linux/pci_hotplug.h>
>>>>    #include <linux/module.h>
>>>>    #include <linux/pci-aspm.h>
>>>> @@ -689,6 +691,17 @@ static struct acpi_bus_type acpi_pci_bus = {
>>>>    	.cleanup = pci_acpi_cleanup,
>>>>    };
>>>>
>>>> +struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
>>>> +{
>>>> +	struct irq_domain *dom = NULL;
>>>> +	struct fwnode_handle *fwnode = pci_msi_get_fwnode(&bus->dev);
>>>> +
>>>> +	if (fwnode)
>>>> +		dom = irq_find_matching_fwnode(fwnode,
>>>> +					       DOMAIN_BUS_PCI_MSI);
>>>> +	return dom;
>>>> +}
>>>> +
>>> Given this, I really question the need for what you define in patch #1
>>> to be standalone. It is only used by ACPI (DT has its own private
>>> helpers), and it is so far unlikely that it will be of any use for
>>> other firmware interfaces.
>>>
>>> My suggestion is to get rid of pci_msi_get_fwnode() and move the
>>> registration helper into this file. That'd be much simpler.
>>>
>>> Thanks,
>>>
>>> 	M.
>>>
>> Ok, I'll take care of this. I assume the rest of the patches looks ok.
> I still need to finish going through it (I have minor comments so far
> on some of the other patches), but I want to get the core ACPI stuff in
> shape before doing anything else.
I am trying to do similar thing for GICv3 & ITS, can you please have a look:
http://lkml.iu.edu/hypermail/linux/kernel/1510.1/06139.html

Can you please explain what ACPI core changes do you mean?

Regards,
Tomasz

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

* [PATCH V3 2/6] acpi: pci: Setup MSI domain for ACPI based pci devices
@ 2015-12-06 18:03           ` Tomasz Nowicki
  0 siblings, 0 replies; 41+ messages in thread
From: Tomasz Nowicki @ 2015-12-06 18:03 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Marc,


On 11/22/2015 12:35 PM, Marc Zyngier wrote:
> On Sat, 21 Nov 2015 15:18:45 -0600
> Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:
>
>> Hi Marc,
>>
>> On 11/19/15 06:08, Marc Zyngier wrote:
>>> On Wed, 21 Oct 2015 11:47:25 -0700
>>> Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:
>>>
>>> Hi Suravee,
>>>
>>> Sorry it took so long to get to this series. Comments below.
>> No worry.
>>
>>>> This patch introduces pci_host_bridge_acpi_msi_domain(), which returns
>>>> the MSI domain of the specified PCI host bridge with DOMAIN_BUS_PCI_MSI
>>>> bus token. Then, it is assigned to pci device.
>>>>
>>>> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
>>>> ---
>>>>    drivers/pci/pci-acpi.c | 13 +++++++++++++
>>>>    drivers/pci/probe.c    |  2 ++
>>>>    include/linux/pci.h    |  7 +++++++
>>>>    3 files changed, 22 insertions(+)
>>>>
>>>> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
>>>> index a32ba75..0e21ef4 100644
>>>> --- a/drivers/pci/pci-acpi.c
>>>> +++ b/drivers/pci/pci-acpi.c
>>>> @@ -9,7 +9,9 @@
>>>>
>>>>    #include <linux/delay.h>
>>>>    #include <linux/init.h>
>>>> +#include <linux/irqdomain.h>
>>>>    #include <linux/pci.h>
>>>> +#include <linux/msi.h>
>>>>    #include <linux/pci_hotplug.h>
>>>>    #include <linux/module.h>
>>>>    #include <linux/pci-aspm.h>
>>>> @@ -689,6 +691,17 @@ static struct acpi_bus_type acpi_pci_bus = {
>>>>    	.cleanup = pci_acpi_cleanup,
>>>>    };
>>>>
>>>> +struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
>>>> +{
>>>> +	struct irq_domain *dom = NULL;
>>>> +	struct fwnode_handle *fwnode = pci_msi_get_fwnode(&bus->dev);
>>>> +
>>>> +	if (fwnode)
>>>> +		dom = irq_find_matching_fwnode(fwnode,
>>>> +					       DOMAIN_BUS_PCI_MSI);
>>>> +	return dom;
>>>> +}
>>>> +
>>> Given this, I really question the need for what you define in patch #1
>>> to be standalone. It is only used by ACPI (DT has its own private
>>> helpers), and it is so far unlikely that it will be of any use for
>>> other firmware interfaces.
>>>
>>> My suggestion is to get rid of pci_msi_get_fwnode() and move the
>>> registration helper into this file. That'd be much simpler.
>>>
>>> Thanks,
>>>
>>> 	M.
>>>
>> Ok, I'll take care of this. I assume the rest of the patches looks ok.
> I still need to finish going through it (I have minor comments so far
> on some of the other patches), but I want to get the core ACPI stuff in
> shape before doing anything else.
I am trying to do similar thing for GICv3 & ITS, can you please have a look:
http://lkml.iu.edu/hypermail/linux/kernel/1510.1/06139.html

Can you please explain what ACPI core changes do you mean?

Regards,
Tomasz

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

* Re: [PATCH V3 2/6] acpi: pci: Setup MSI domain for ACPI based pci devices
  2015-12-06 18:03           ` Tomasz Nowicki
@ 2015-12-07  8:55             ` Marc Zyngier
  -1 siblings, 0 replies; 41+ messages in thread
From: Marc Zyngier @ 2015-12-07  8:55 UTC (permalink / raw)
  To: Tomasz Nowicki
  Cc: Suravee Suthikulpanit, tglx, jason, rjw, Lorenzo Pieralisi,
	Will Deacon, Catalin Marinas, hanjun.guo, tomasz.nowicki,
	graeme.gregory, dhdang, linux-arm-kernel, linux-kernel,
	linux-acpi

Hi Tomasz,

On 06/12/15 18:03, Tomasz Nowicki wrote:
> Hi Marc,
> 
> 
> On 11/22/2015 12:35 PM, Marc Zyngier wrote:
>> On Sat, 21 Nov 2015 15:18:45 -0600
>> Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:
>>
>>> Hi Marc,
>>>
>>> On 11/19/15 06:08, Marc Zyngier wrote:
>>>> On Wed, 21 Oct 2015 11:47:25 -0700
>>>> Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:
>>>>
>>>> Hi Suravee,
>>>>
>>>> Sorry it took so long to get to this series. Comments below.
>>> No worry.
>>>
>>>>> This patch introduces pci_host_bridge_acpi_msi_domain(), which returns
>>>>> the MSI domain of the specified PCI host bridge with DOMAIN_BUS_PCI_MSI
>>>>> bus token. Then, it is assigned to pci device.
>>>>>
>>>>> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
>>>>> ---
>>>>>    drivers/pci/pci-acpi.c | 13 +++++++++++++
>>>>>    drivers/pci/probe.c    |  2 ++
>>>>>    include/linux/pci.h    |  7 +++++++
>>>>>    3 files changed, 22 insertions(+)
>>>>>
>>>>> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
>>>>> index a32ba75..0e21ef4 100644
>>>>> --- a/drivers/pci/pci-acpi.c
>>>>> +++ b/drivers/pci/pci-acpi.c
>>>>> @@ -9,7 +9,9 @@
>>>>>
>>>>>    #include <linux/delay.h>
>>>>>    #include <linux/init.h>
>>>>> +#include <linux/irqdomain.h>
>>>>>    #include <linux/pci.h>
>>>>> +#include <linux/msi.h>
>>>>>    #include <linux/pci_hotplug.h>
>>>>>    #include <linux/module.h>
>>>>>    #include <linux/pci-aspm.h>
>>>>> @@ -689,6 +691,17 @@ static struct acpi_bus_type acpi_pci_bus = {
>>>>>    	.cleanup = pci_acpi_cleanup,
>>>>>    };
>>>>>
>>>>> +struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
>>>>> +{
>>>>> +	struct irq_domain *dom = NULL;
>>>>> +	struct fwnode_handle *fwnode = pci_msi_get_fwnode(&bus->dev);
>>>>> +
>>>>> +	if (fwnode)
>>>>> +		dom = irq_find_matching_fwnode(fwnode,
>>>>> +					       DOMAIN_BUS_PCI_MSI);
>>>>> +	return dom;
>>>>> +}
>>>>> +
>>>> Given this, I really question the need for what you define in patch #1
>>>> to be standalone. It is only used by ACPI (DT has its own private
>>>> helpers), and it is so far unlikely that it will be of any use for
>>>> other firmware interfaces.
>>>>
>>>> My suggestion is to get rid of pci_msi_get_fwnode() and move the
>>>> registration helper into this file. That'd be much simpler.
>>>>
>>>> Thanks,
>>>>
>>>> 	M.
>>>>
>>> Ok, I'll take care of this. I assume the rest of the patches looks ok.
>> I still need to finish going through it (I have minor comments so far
>> on some of the other patches), but I want to get the core ACPI stuff in
>> shape before doing anything else.
> I am trying to do similar thing for GICv3 & ITS, can you please have a look:
> http://lkml.iu.edu/hypermail/linux/kernel/1510.1/06139.html
> 
> Can you please explain what ACPI core changes do you mean?

I mean the code in patches 1 and 2 in Suravee's series. This should form
the basics for being able to assign MSI domains to devices.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

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

* [PATCH V3 2/6] acpi: pci: Setup MSI domain for ACPI based pci devices
@ 2015-12-07  8:55             ` Marc Zyngier
  0 siblings, 0 replies; 41+ messages in thread
From: Marc Zyngier @ 2015-12-07  8:55 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Tomasz,

On 06/12/15 18:03, Tomasz Nowicki wrote:
> Hi Marc,
> 
> 
> On 11/22/2015 12:35 PM, Marc Zyngier wrote:
>> On Sat, 21 Nov 2015 15:18:45 -0600
>> Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:
>>
>>> Hi Marc,
>>>
>>> On 11/19/15 06:08, Marc Zyngier wrote:
>>>> On Wed, 21 Oct 2015 11:47:25 -0700
>>>> Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> wrote:
>>>>
>>>> Hi Suravee,
>>>>
>>>> Sorry it took so long to get to this series. Comments below.
>>> No worry.
>>>
>>>>> This patch introduces pci_host_bridge_acpi_msi_domain(), which returns
>>>>> the MSI domain of the specified PCI host bridge with DOMAIN_BUS_PCI_MSI
>>>>> bus token. Then, it is assigned to pci device.
>>>>>
>>>>> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
>>>>> ---
>>>>>    drivers/pci/pci-acpi.c | 13 +++++++++++++
>>>>>    drivers/pci/probe.c    |  2 ++
>>>>>    include/linux/pci.h    |  7 +++++++
>>>>>    3 files changed, 22 insertions(+)
>>>>>
>>>>> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
>>>>> index a32ba75..0e21ef4 100644
>>>>> --- a/drivers/pci/pci-acpi.c
>>>>> +++ b/drivers/pci/pci-acpi.c
>>>>> @@ -9,7 +9,9 @@
>>>>>
>>>>>    #include <linux/delay.h>
>>>>>    #include <linux/init.h>
>>>>> +#include <linux/irqdomain.h>
>>>>>    #include <linux/pci.h>
>>>>> +#include <linux/msi.h>
>>>>>    #include <linux/pci_hotplug.h>
>>>>>    #include <linux/module.h>
>>>>>    #include <linux/pci-aspm.h>
>>>>> @@ -689,6 +691,17 @@ static struct acpi_bus_type acpi_pci_bus = {
>>>>>    	.cleanup = pci_acpi_cleanup,
>>>>>    };
>>>>>
>>>>> +struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
>>>>> +{
>>>>> +	struct irq_domain *dom = NULL;
>>>>> +	struct fwnode_handle *fwnode = pci_msi_get_fwnode(&bus->dev);
>>>>> +
>>>>> +	if (fwnode)
>>>>> +		dom = irq_find_matching_fwnode(fwnode,
>>>>> +					       DOMAIN_BUS_PCI_MSI);
>>>>> +	return dom;
>>>>> +}
>>>>> +
>>>> Given this, I really question the need for what you define in patch #1
>>>> to be standalone. It is only used by ACPI (DT has its own private
>>>> helpers), and it is so far unlikely that it will be of any use for
>>>> other firmware interfaces.
>>>>
>>>> My suggestion is to get rid of pci_msi_get_fwnode() and move the
>>>> registration helper into this file. That'd be much simpler.
>>>>
>>>> Thanks,
>>>>
>>>> 	M.
>>>>
>>> Ok, I'll take care of this. I assume the rest of the patches looks ok.
>> I still need to finish going through it (I have minor comments so far
>> on some of the other patches), but I want to get the core ACPI stuff in
>> shape before doing anything else.
> I am trying to do similar thing for GICv3 & ITS, can you please have a look:
> http://lkml.iu.edu/hypermail/linux/kernel/1510.1/06139.html
> 
> Can you please explain what ACPI core changes do you mean?

I mean the code in patches 1 and 2 in Suravee's series. This should form
the basics for being able to assign MSI domains to devices.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

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

end of thread, other threads:[~2015-12-07  8:55 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-21 18:47 [PATCH V3 0/6] gicv2m: acpi: Add ACPI support for GICv2m MSI Suravee Suthikulpanit
2015-10-21 18:47 ` Suravee Suthikulpanit
2015-10-21 18:47 ` Suravee Suthikulpanit
2015-10-21 18:47 ` [PATCH V3 1/6] pci: msi: Add support to query MSI domain for pci device Suravee Suthikulpanit
2015-10-21 18:47   ` Suravee Suthikulpanit
2015-10-21 18:47   ` Suravee Suthikulpanit
2015-10-21 18:47 ` [PATCH V3 2/6] acpi: pci: Setup MSI domain for ACPI based pci devices Suravee Suthikulpanit
2015-10-21 18:47   ` Suravee Suthikulpanit
2015-10-21 18:47   ` Suravee Suthikulpanit
2015-11-19 12:08   ` Marc Zyngier
2015-11-19 12:08     ` Marc Zyngier
2015-11-19 12:08     ` Marc Zyngier
2015-11-21 21:18     ` Suravee Suthikulpanit
2015-11-21 21:18       ` Suravee Suthikulpanit
2015-11-21 21:18       ` Suravee Suthikulpanit
2015-11-22 11:35       ` Marc Zyngier
2015-11-22 11:35         ` Marc Zyngier
2015-11-22 11:35         ` Marc Zyngier
2015-12-06 18:03         ` Tomasz Nowicki
2015-12-06 18:03           ` Tomasz Nowicki
2015-12-07  8:55           ` Marc Zyngier
2015-12-07  8:55             ` Marc Zyngier
2015-10-21 18:47 ` [PATCH V3 3/6] irqdomain: introduce is_fwnode_irqchip helper Suravee Suthikulpanit
2015-10-21 18:47   ` Suravee Suthikulpanit
2015-10-21 18:47   ` Suravee Suthikulpanit
2015-10-21 18:47 ` [PATCH V3 4/6] irqdomain: Introduce irq_domain_get_irqchip_fwnode_name helper function Suravee Suthikulpanit
2015-10-21 18:47   ` Suravee Suthikulpanit
2015-10-21 18:47   ` Suravee Suthikulpanit
2015-10-21 18:47 ` [PATCH V3 5/6] gicv2m: Refactor to prepare for ACPI support Suravee Suthikulpanit
2015-10-21 18:47   ` Suravee Suthikulpanit
2015-10-21 18:47   ` Suravee Suthikulpanit
2015-10-21 18:47 ` [PATCH V3 6/6] gicv2m: acpi: Introducing GICv2m " Suravee Suthikulpanit
2015-10-21 18:47   ` Suravee Suthikulpanit
2015-10-21 18:47   ` Suravee Suthikulpanit
2015-10-29 21:25 ` [PATCH V3 0/6] gicv2m: acpi: Add ACPI support for GICv2m MSI Duc Dang
2015-10-29 21:25   ` Duc Dang
2015-10-30 14:03   ` Suravee Suthikulpanit
2015-10-30 14:03     ` Suravee Suthikulpanit
2015-10-30 14:03     ` Suravee Suthikulpanit
2015-10-30 16:53     ` Duc Dang
2015-10-30 16:53       ` Duc Dang

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.