linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/9] Making the generic ACPI GSI layer irqdomain aware
@ 2015-09-28 16:42 Marc Zyngier
  2015-09-28 16:42 ` [PATCH v4 1/9] drivers/of: Introduce of_node_alloc Marc Zyngier
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Marc Zyngier @ 2015-09-28 16:42 UTC (permalink / raw)
  To: Thomas Gleixner, Jiang Liu, Jason Cooper, Rafael J. Wysocki,
	Mark Rutland, Rob Herring, Frank Rowand
  Cc: linux-acpi, linux-arm-kernel, linux-kernel, devicetree,
	Lorenzo Pieralisi, Tomasz Nowicki, Hanjun Guo,
	Suravee Suthikulpanit, Graeme Gregory, Jake Oshins

The irqdomain code is not entierely ACPI friendly, as it has some
built-in knowledge of the device-tree. Nothing too harmful, but enough
to scare the ARM ACPI developpers which end up with their own version
of the square wheel.

This small patch series adapts the irqdomain code to remove the
hurdles that prevent the full blown irqdomain subsystem to be used on
ACPI, creates an interface between the GSI layer and the irqdomain,
and as an example, convert the ARM GIC ACPI support to use irqdomains
as originally intended.

Overall, this gives us a way to use irqdomains on both DT and ACPI
enabled platforms, having very little changes made to the actual
drivers (other than the probing infrastructure). Because we keep the
flow of information between the various layers identical between ACPI
and DT, we immediately benefit from the existing infrastructure. The
"convert the GSI information to be DT friendly" is admitedly not very
pretty, but I see it as a stepping stone towards unifying the two
structures.

This has been test-booted on Juno, is based on 4.3-rc3, and available at:

git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git irq/gsi-irq-domain-v4

* From v3:
   - Got rid of the whole "void *" malarchy, and introduce a DT-based
     fwnode_handle allocator. Much smaller patch, better type checking,
     and a path forward to introduce fwnode_handle as the irqdomain
     identifier.
   - Small rework of the GIC stuff (cleanup, mostly).

* From v2:
   - Rebased on vanilla 4.3-rc1
   - Added the IDR infrastructure to irqdomain.c so that drivers don't
     have to come up with their own way of allocating identifiers
   - Changed the acpi_set_irq_model() signature to directly take a
     void *domain_token

* From v1:
  - Improved my Coccinelle foo and hopefully caught all the
    irq_domain.of_node users this time
  - Decoupled acpi_irq_model from domain_token. These are now two
    separate values that can be set independently
  - Moved the duty of populating acpi_gsi_descriptor to the interrupt
    controller, as it keeps the knowledge of the mapping with
    of_phandle_args in a single location
  - Generic accessor to set acpi_irq_model, domain_token and the
    populate function all in one go from the interrupt controller
  - General cleanup

Marc Zyngier (9):
  drivers/of: Introduce of_node_alloc
  genirq/irqdomain: Add irq_create_acpi_mapping
  genirq/irqdomain: Add a fwnode_handle allocator
  acpi/gsi: Always perform an irq domain lookup
  acpi/gsi: Add acpi_set_irq_model to initialize the GSI layer
  acpi/gsi: Select OF_DYNAMIC when ACPI_GENERIC_GSI is selected
  irqchip/GIC: Get rid of gic_init_bases()
  irqchip/GIC: Switch ACPI support to stacked domains
  acpi/gsi: Cleanup acpi_register_gsi

 drivers/acpi/Kconfig            |  1 +
 drivers/acpi/gsi.c              | 61 ++++++++++++++++++++++++-------------
 drivers/irqchip/irq-gic.c       | 66 ++++++++++++++++++++++++++++++-----------
 drivers/of/dynamic.c            | 22 ++++++++++++++
 include/linux/acpi.h            | 14 +++++++++
 include/linux/irqchip/arm-gic.h |  9 ++----
 include/linux/irqdomain.h       |  2 ++
 include/linux/of.h              |  5 ++++
 kernel/irq/irqdomain.c          | 48 ++++++++++++++++++++++++++++++
 9 files changed, 183 insertions(+), 45 deletions(-)

-- 
2.1.4


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

* [PATCH v4 1/9] drivers/of: Introduce of_node_alloc
  2015-09-28 16:42 [PATCH v4 0/9] Making the generic ACPI GSI layer irqdomain aware Marc Zyngier
@ 2015-09-28 16:42 ` Marc Zyngier
  2015-09-28 22:50   ` Frank Rowand
  2015-09-28 16:42 ` [PATCH v4 2/9] genirq/irqdomain: Add irq_create_acpi_mapping Marc Zyngier
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 14+ messages in thread
From: Marc Zyngier @ 2015-09-28 16:42 UTC (permalink / raw)
  To: Thomas Gleixner, Jiang Liu, Jason Cooper, Rafael J. Wysocki,
	Mark Rutland, Rob Herring, Frank Rowand
  Cc: linux-acpi, linux-arm-kernel, linux-kernel, devicetree,
	Lorenzo Pieralisi, Tomasz Nowicki, Hanjun Guo,
	Suravee Suthikulpanit, Graeme Gregory, Jake Oshins

We want to be able to generate "fake" device nodes that can be
used as an identifier for irq domains. For that, we reuse the
dynamic DT layer in order to generate DT nodes in a detached state
(so that it doesn't interfere with the rest of the tree).

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 drivers/of/dynamic.c | 22 ++++++++++++++++++++++
 include/linux/of.h   |  5 +++++
 2 files changed, 27 insertions(+)

diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c
index 53826b8..709d363 100644
--- a/drivers/of/dynamic.c
+++ b/drivers/of/dynamic.c
@@ -445,6 +445,28 @@ struct device_node *__of_node_dup(const struct device_node *np, const char *fmt,
 	return NULL;
 }
 
+/**
+ * of_node_alloc() - Allocate an empty device node dynamically.
+ * @fmt: Format string (plus vargs) for new full name of the device node
+ *
+ * Create an device tree node, either by by allocating an empty one
+ * suitable for further modification.  The node data are dynamically
+ * allocated and all the node flags have the OF_DYNAMIC & OF_DETACHED
+ * bits set. Returns the newly allocated node or NULL on out of memory
+ * error.
+ */
+struct device_node *of_node_alloc(const char *fmt, ...)
+{
+	struct device_node *np;
+	va_list vargs;
+
+	va_start(vargs, fmt);
+	np = __of_node_dup(NULL, fmt, vargs);
+	va_end(vargs);
+
+	return np;
+}
+
 static void __of_changeset_entry_destroy(struct of_changeset_entry *ce)
 {
 	of_node_put(ce->np);
diff --git a/include/linux/of.h b/include/linux/of.h
index 2194b8c..f7f11f7 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -104,6 +104,7 @@ static inline int of_node_is_attached(struct device_node *node)
 #ifdef CONFIG_OF_DYNAMIC
 extern struct device_node *of_node_get(struct device_node *node);
 extern void of_node_put(struct device_node *node);
+extern struct device_node *of_node_alloc(const char *fmt, ...);
 #else /* CONFIG_OF_DYNAMIC */
 /* Dummy ref counting routines - to be implemented later */
 static inline struct device_node *of_node_get(struct device_node *node)
@@ -111,6 +112,10 @@ static inline struct device_node *of_node_get(struct device_node *node)
 	return node;
 }
 static inline void of_node_put(struct device_node *node) { }
+static inline struct device_node *of_node_alloc(const char *fmt, ...)
+{
+	return NULL;
+}
 #endif /* !CONFIG_OF_DYNAMIC */
 
 /* Pointer for first entry in chain of all nodes. */
-- 
2.1.4


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

* [PATCH v4 2/9] genirq/irqdomain: Add irq_create_acpi_mapping
  2015-09-28 16:42 [PATCH v4 0/9] Making the generic ACPI GSI layer irqdomain aware Marc Zyngier
  2015-09-28 16:42 ` [PATCH v4 1/9] drivers/of: Introduce of_node_alloc Marc Zyngier
@ 2015-09-28 16:42 ` Marc Zyngier
  2015-09-28 16:42 ` [PATCH v4 3/9] genirq/irqdomain: Add a fwnode_handle allocator Marc Zyngier
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Marc Zyngier @ 2015-09-28 16:42 UTC (permalink / raw)
  To: Thomas Gleixner, Jiang Liu, Jason Cooper, Rafael J. Wysocki,
	Mark Rutland, Rob Herring, Frank Rowand
  Cc: linux-acpi, linux-arm-kernel, linux-kernel, devicetree,
	Lorenzo Pieralisi, Tomasz Nowicki, Hanjun Guo,
	Suravee Suthikulpanit, Graeme Gregory, Jake Oshins

In order to help ACPI on arm64 to make use of most of the irqdomain
goodies, add a new entry point (irq_create_acpi_mapping) which
mimics irq_create_of_mapping, except that it takes a new
struct acpi_gsi_descriptor, which is the pendent of of_phandle_args
in the OF world.

We assume that the way the acpi_gsi_descriptor is populated matches
that of of_phandle_args, as the latter is still the building block
for interrupt descriptor in the whole kernel.

Eventually, these two representations should be merged in a single
structure, but that's probably for another day.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 include/linux/acpi.h   |  9 +++++++++
 kernel/irq/irqdomain.c | 18 ++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 7235c48..4db2f01 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -201,6 +201,15 @@ int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int polarity
 int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
 int acpi_isa_irq_to_gsi (unsigned isa_irq, u32 *gsi);
 
+#define MAX_GSI_DESC_PARAMS 16
+struct acpi_gsi_descriptor {
+	int param_count;
+	u32 param[MAX_GSI_DESC_PARAMS];
+};
+
+unsigned int irq_create_acpi_mapping(struct irq_domain *d,
+				     struct acpi_gsi_descriptor *irq_data);
+
 #ifdef CONFIG_X86_IO_APIC
 extern int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity);
 #else
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index dc9d27c..e5c1e4c 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -1,5 +1,6 @@
 #define pr_fmt(fmt)  "irq: " fmt
 
+#include <linux/acpi.h>
 #include <linux/debugfs.h>
 #include <linux/hardirq.h>
 #include <linux/interrupt.h>
@@ -522,6 +523,23 @@ unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data)
 }
 EXPORT_SYMBOL_GPL(irq_create_of_mapping);
 
+#ifdef CONFIG_ACPI
+unsigned int irq_create_acpi_mapping(struct irq_domain *d,
+				     struct acpi_gsi_descriptor *irq_data)
+{
+	struct of_phandle_args args;
+	int i;
+
+	for (i = 0; i < min(irq_data->param_count, MAX_PHANDLE_ARGS); i++)
+		args.args[i] = irq_data->param[i];
+
+	args.np = d->of_node;
+	args.args_count = i;
+
+	return irq_create_of_mapping(&args);
+}
+#endif
+
 /**
  * irq_dispose_mapping() - Unmap an interrupt
  * @virq: linux irq number of the interrupt to unmap
-- 
2.1.4


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

* [PATCH v4 3/9] genirq/irqdomain: Add a fwnode_handle allocator
  2015-09-28 16:42 [PATCH v4 0/9] Making the generic ACPI GSI layer irqdomain aware Marc Zyngier
  2015-09-28 16:42 ` [PATCH v4 1/9] drivers/of: Introduce of_node_alloc Marc Zyngier
  2015-09-28 16:42 ` [PATCH v4 2/9] genirq/irqdomain: Add irq_create_acpi_mapping Marc Zyngier
@ 2015-09-28 16:42 ` Marc Zyngier
  2015-09-28 16:42 ` [PATCH v4 4/9] acpi/gsi: Always perform an irq domain lookup Marc Zyngier
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Marc Zyngier @ 2015-09-28 16:42 UTC (permalink / raw)
  To: Thomas Gleixner, Jiang Liu, Jason Cooper, Rafael J. Wysocki,
	Mark Rutland, Rob Herring, Frank Rowand
  Cc: linux-acpi, linux-arm-kernel, linux-kernel, devicetree,
	Lorenzo Pieralisi, Tomasz Nowicki, Hanjun Guo,
	Suravee Suthikulpanit, Graeme Gregory, Jake Oshins

In order to be able to reference an irqdomain from ACPI, we need
to be able to create an identifier, which is a struct device_node.

This device node does't really fit the ACPI infrastructure, so
we cunningly hide it by returning the contained fwnode_handle.
This will help a (still hypothetical) further migration of
irqdomain from device_node to fwnode_handle.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 include/linux/irqdomain.h |  2 ++
 kernel/irq/irqdomain.c    | 30 ++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index d3ca792..3193c61 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -162,6 +162,8 @@ enum {
 };
 
 #ifdef CONFIG_IRQ_DOMAIN
+struct fwnode_handle *irq_domain_alloc_fwnode(void *data);
+void irq_domain_free_fwnode(struct fwnode_handle *fwnode);
 struct irq_domain *__irq_domain_add(struct device_node *of_node, 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 e5c1e4c..5e7214a 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -29,6 +29,36 @@ static int irq_domain_alloc_descs(int virq, unsigned int nr_irqs,
 static void irq_domain_check_hierarchy(struct irq_domain *domain);
 
 /**
+ * irq_domain_alloc_fwnode - Allocate a OF-backed fwnode_handle suitable for
+ *                           identifying an irq domain
+ * @data: optional user-provided data
+ *
+ * Allocate a struct device_node, and return a poiner to the embedded
+ * fwnode_handle (or NULL on failure).
+ */
+struct fwnode_handle *irq_domain_alloc_fwnode(void *data)
+{
+	struct device_node *of_node;
+
+	of_node = of_node_alloc("irqdomain@%p", data);
+	if (!of_node)
+		return NULL;
+
+	of_node->data = data;
+	return &of_node->fwnode;
+}
+
+/**
+ * irq_domain_free_fwnode - Free a OF-backed fwnode_handle
+ *
+ * Free a fwnode_handle allocated with irq_domain_alloc_fwnode.
+ */
+void irq_domain_free_fwnode(struct fwnode_handle *fwnode)
+{
+	of_node_put(to_of_node(fwnode));
+}
+
+/**
  * __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.4


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

* [PATCH v4 4/9] acpi/gsi: Always perform an irq domain lookup
  2015-09-28 16:42 [PATCH v4 0/9] Making the generic ACPI GSI layer irqdomain aware Marc Zyngier
                   ` (2 preceding siblings ...)
  2015-09-28 16:42 ` [PATCH v4 3/9] genirq/irqdomain: Add a fwnode_handle allocator Marc Zyngier
@ 2015-09-28 16:42 ` Marc Zyngier
  2015-09-28 16:42 ` [PATCH v4 5/9] acpi/gsi: Add acpi_set_irq_model to initialize the GSI layer Marc Zyngier
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Marc Zyngier @ 2015-09-28 16:42 UTC (permalink / raw)
  To: Thomas Gleixner, Jiang Liu, Jason Cooper, Rafael J. Wysocki,
	Mark Rutland, Rob Herring, Frank Rowand
  Cc: linux-acpi, linux-arm-kernel, linux-kernel, devicetree,
	Lorenzo Pieralisi, Tomasz Nowicki, Hanjun Guo,
	Suravee Suthikulpanit, Graeme Gregory, Jake Oshins

Instead of directly passing NULL to the various irq_domain functions,
start by looking up the domain with a domain identifier..

As this identifier is permanently set to NULL, the lookup function will
return the same value (no domain found) and the default will be used,
preserving the current behaviour.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 drivers/acpi/gsi.c | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/drivers/acpi/gsi.c b/drivers/acpi/gsi.c
index 38208f2..6232d55 100644
--- a/drivers/acpi/gsi.c
+++ b/drivers/acpi/gsi.c
@@ -11,9 +11,12 @@
 #include <linux/acpi.h>
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
+#include <linux/of.h>
 
 enum acpi_irq_model_id acpi_irq_model;
 
+static struct device_node *acpi_gsi_domain_id;
+
 static unsigned int acpi_gsi_get_irq_type(int trigger, int polarity)
 {
 	switch (polarity) {
@@ -45,12 +48,9 @@ static unsigned int acpi_gsi_get_irq_type(int trigger, int polarity)
  */
 int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
 {
-	/*
-	 * Only default domain is supported at present, always find
-	 * the mapping corresponding to default domain by passing NULL
-	 * as irq_domain parameter
-	 */
-	*irq = irq_find_mapping(NULL, gsi);
+	struct irq_domain *d = irq_find_host(acpi_gsi_domain_id);
+
+	*irq = irq_find_mapping(d, gsi);
 	/*
 	 * *irq == 0 means no mapping, that should
 	 * be reported as a failure
@@ -74,13 +74,9 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger,
 {
 	unsigned int irq;
 	unsigned int irq_type = acpi_gsi_get_irq_type(trigger, polarity);
+	struct irq_domain *d = irq_find_host(acpi_gsi_domain_id);
 
-	/*
-	 * There is no way at present to look-up the IRQ domain on ACPI,
-	 * hence always create mapping referring to the default domain
-	 * by passing NULL as irq_domain parameter
-	 */
-	irq = irq_create_mapping(NULL, gsi);
+	irq = irq_create_mapping(d, gsi);
 	if (!irq)
 		return -EINVAL;
 
@@ -98,7 +94,8 @@ EXPORT_SYMBOL_GPL(acpi_register_gsi);
  */
 void acpi_unregister_gsi(u32 gsi)
 {
-	int irq = irq_find_mapping(NULL, gsi);
+	struct irq_domain *d = irq_find_host(acpi_gsi_domain_id);
+	int irq = irq_find_mapping(d, gsi);
 
 	irq_dispose_mapping(irq);
 }
-- 
2.1.4


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

* [PATCH v4 5/9] acpi/gsi: Add acpi_set_irq_model to initialize the GSI layer
  2015-09-28 16:42 [PATCH v4 0/9] Making the generic ACPI GSI layer irqdomain aware Marc Zyngier
                   ` (3 preceding siblings ...)
  2015-09-28 16:42 ` [PATCH v4 4/9] acpi/gsi: Always perform an irq domain lookup Marc Zyngier
@ 2015-09-28 16:42 ` Marc Zyngier
  2015-09-28 16:42 ` [PATCH v4 6/9] acpi/gsi: Select OF_DYNAMIC when ACPI_GENERIC_GSI is selected Marc Zyngier
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Marc Zyngier @ 2015-09-28 16:42 UTC (permalink / raw)
  To: Thomas Gleixner, Jiang Liu, Jason Cooper, Rafael J. Wysocki,
	Mark Rutland, Rob Herring, Frank Rowand
  Cc: linux-acpi, linux-arm-kernel, linux-kernel, devicetree,
	Lorenzo Pieralisi, Tomasz Nowicki, Hanjun Guo,
	Suravee Suthikulpanit, Graeme Gregory, Jake Oshins

In order to start embrassing irqdomains at the GSI level, introduce
a new initializer:

void acpi_set_irq_model(enum acpi_irq_model_id model,
			struct fwnode_handle *fwnode,
			int (*populate)(struct acpi_gsi_descriptor *,
					u32, unsigned int));

where:
- model is the value assigned to acpi_irq_model
- fwnode is the identifier for the irqdomain mapping
  GSI interrupts
- populate is a function provided by the interrupt controller,
  populating a struct acpi_gsi_descriptor based on a GSI and
  the interrupt trigger information

As nobody calls this code yet, the current code is left in place.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 drivers/acpi/gsi.c   | 32 ++++++++++++++++++++++++++++++++
 include/linux/acpi.h |  5 +++++
 2 files changed, 37 insertions(+)

diff --git a/drivers/acpi/gsi.c b/drivers/acpi/gsi.c
index 6232d55..7905840 100644
--- a/drivers/acpi/gsi.c
+++ b/drivers/acpi/gsi.c
@@ -17,6 +17,9 @@ enum acpi_irq_model_id acpi_irq_model;
 
 static struct device_node *acpi_gsi_domain_id;
 
+static int (*acpi_gsi_descriptor_populate)(struct acpi_gsi_descriptor *data,
+					   u32 gsi, unsigned int irq_type);
+
 static unsigned int acpi_gsi_get_irq_type(int trigger, int polarity)
 {
 	switch (polarity) {
@@ -72,10 +75,20 @@ EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
 int acpi_register_gsi(struct device *dev, u32 gsi, int trigger,
 		      int polarity)
 {
+	int err;
 	unsigned int irq;
 	unsigned int irq_type = acpi_gsi_get_irq_type(trigger, polarity);
 	struct irq_domain *d = irq_find_host(acpi_gsi_domain_id);
 
+	if (acpi_gsi_descriptor_populate) {
+		struct acpi_gsi_descriptor data;
+		err = acpi_gsi_descriptor_populate(&data, gsi, irq_type);
+		if (err)
+			return err;
+
+		return irq_create_acpi_mapping(d, &data);
+	}
+
 	irq = irq_create_mapping(d, gsi);
 	if (!irq)
 		return -EINVAL;
@@ -100,3 +113,22 @@ void acpi_unregister_gsi(u32 gsi)
 	irq_dispose_mapping(irq);
 }
 EXPORT_SYMBOL_GPL(acpi_unregister_gsi);
+
+/**
+ * acpi_set_irq_model - Setup the GSI irqdomain information
+ * @model: the value assigned to acpi_irq_model
+ * @fwnode: the irq_domain identifier for mapping and looking up
+ *          GSI interrupts
+ * @populate: provided by the interrupt controller, populating a
+ *            struct acpi_gsi_descriptor based on a GSI and
+ *            the interrupt trigger information
+ */
+void __init acpi_set_irq_model(enum acpi_irq_model_id model,
+			       struct fwnode_handle *fwnode,
+			       int (*populate)(struct acpi_gsi_descriptor *,
+					       u32, unsigned int))
+{
+	acpi_irq_model = model;
+	acpi_gsi_domain_id = to_of_node(fwnode);
+	acpi_gsi_descriptor_populate = populate;
+}
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 4db2f01..1423b21 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -210,6 +210,11 @@ struct acpi_gsi_descriptor {
 unsigned int irq_create_acpi_mapping(struct irq_domain *d,
 				     struct acpi_gsi_descriptor *irq_data);
 
+void acpi_set_irq_model(enum acpi_irq_model_id model,
+			struct fwnode_handle *fwnode,
+			int (*populate)(struct acpi_gsi_descriptor *,
+					u32, unsigned int));
+
 #ifdef CONFIG_X86_IO_APIC
 extern int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity);
 #else
-- 
2.1.4


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

* [PATCH v4 6/9] acpi/gsi: Select OF_DYNAMIC when ACPI_GENERIC_GSI is selected
  2015-09-28 16:42 [PATCH v4 0/9] Making the generic ACPI GSI layer irqdomain aware Marc Zyngier
                   ` (4 preceding siblings ...)
  2015-09-28 16:42 ` [PATCH v4 5/9] acpi/gsi: Add acpi_set_irq_model to initialize the GSI layer Marc Zyngier
@ 2015-09-28 16:42 ` Marc Zyngier
  2015-09-28 16:43 ` [PATCH v4 7/9] irqchip/GIC: Get rid of gic_init_bases() Marc Zyngier
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Marc Zyngier @ 2015-09-28 16:42 UTC (permalink / raw)
  To: Thomas Gleixner, Jiang Liu, Jason Cooper, Rafael J. Wysocki,
	Mark Rutland, Rob Herring, Frank Rowand
  Cc: linux-acpi, linux-arm-kernel, linux-kernel, devicetree,
	Lorenzo Pieralisi, Tomasz Nowicki, Hanjun Guo,
	Suravee Suthikulpanit, Graeme Gregory, Jake Oshins

As we're now dynamically creating device nodes to identify
irqdomains, it is necessary to enable CONFIG_OF_DYNAMIC, enabling
the use of of_node_alloc().

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 drivers/acpi/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 5d1015c..8bbfe0b 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -49,6 +49,7 @@ config ARCH_MIGHT_HAVE_ACPI_PDC
 	bool
 
 config ACPI_GENERIC_GSI
+	select OF_DYNAMIC
 	bool
 
 config ACPI_SYSTEM_POWER_STATES_SUPPORT
-- 
2.1.4


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

* [PATCH v4 7/9] irqchip/GIC: Get rid of gic_init_bases()
  2015-09-28 16:42 [PATCH v4 0/9] Making the generic ACPI GSI layer irqdomain aware Marc Zyngier
                   ` (5 preceding siblings ...)
  2015-09-28 16:42 ` [PATCH v4 6/9] acpi/gsi: Select OF_DYNAMIC when ACPI_GENERIC_GSI is selected Marc Zyngier
@ 2015-09-28 16:43 ` Marc Zyngier
  2015-09-28 16:43 ` [PATCH v4 8/9] irqchip/GIC: Switch ACPI support to stacked domains Marc Zyngier
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Marc Zyngier @ 2015-09-28 16:43 UTC (permalink / raw)
  To: Thomas Gleixner, Jiang Liu, Jason Cooper, Rafael J. Wysocki,
	Mark Rutland, Rob Herring, Frank Rowand
  Cc: linux-acpi, linux-arm-kernel, linux-kernel, devicetree,
	Lorenzo Pieralisi, Tomasz Nowicki, Hanjun Guo,
	Suravee Suthikulpanit, Graeme Gregory, Jake Oshins

Since nobody is using gic_init_bases anymore outside of the GIC
driver itself, let's do a bit of housekeeping and remove the now
useless entry point.

Only gic_init() is now exposed to the rest of the kernel for the
benefit of non DT/ACPI system.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 drivers/irqchip/irq-gic.c       | 8 +++-----
 include/linux/irqchip/arm-gic.h | 9 ++-------
 2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 982c09c..0e4142d 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -1087,17 +1087,15 @@ static void __init __gic_init_bases(unsigned int gic_nr, int irq_start,
 	gic_pm_init(gic);
 }
 
-void __init gic_init_bases(unsigned int gic_nr, int irq_start,
-			   void __iomem *dist_base, void __iomem *cpu_base,
-			   u32 percpu_offset, struct device_node *node)
+void __init gic_init(unsigned int gic_nr, int irq_start,
+		     void __iomem *dist_base, void __iomem *cpu_base)
 {
 	/*
 	 * Non-DT/ACPI systems won't run a hypervisor, so let's not
 	 * bother with these...
 	 */
 	static_key_slow_dec(&supports_deactivate);
-	__gic_init_bases(gic_nr, irq_start, dist_base, cpu_base,
-			 percpu_offset, node);
+	__gic_init_bases(gic_nr, irq_start, dist_base, cpu_base, 0, NULL);
 }
 
 #ifdef CONFIG_OF
diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h
index b8901df..bae69e5 100644
--- a/include/linux/irqchip/arm-gic.h
+++ b/include/linux/irqchip/arm-gic.h
@@ -100,16 +100,11 @@
 
 struct device_node;
 
-void gic_init_bases(unsigned int, int, void __iomem *, void __iomem *,
-		    u32 offset, struct device_node *);
 void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
 int gic_cpu_if_down(unsigned int gic_nr);
 
-static inline void gic_init(unsigned int nr, int start,
-			    void __iomem *dist , void __iomem *cpu)
-{
-	gic_init_bases(nr, start, dist, cpu, 0, NULL);
-}
+void gic_init(unsigned int nr, int start,
+	      void __iomem *dist , void __iomem *cpu);
 
 int gicv2m_of_init(struct device_node *node, struct irq_domain *parent);
 
-- 
2.1.4


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

* [PATCH v4 8/9] irqchip/GIC: Switch ACPI support to stacked domains
  2015-09-28 16:42 [PATCH v4 0/9] Making the generic ACPI GSI layer irqdomain aware Marc Zyngier
                   ` (6 preceding siblings ...)
  2015-09-28 16:43 ` [PATCH v4 7/9] irqchip/GIC: Get rid of gic_init_bases() Marc Zyngier
@ 2015-09-28 16:43 ` Marc Zyngier
  2015-09-28 16:43 ` [PATCH v4 9/9] acpi/gsi: Cleanup acpi_register_gsi Marc Zyngier
  2015-09-29 17:11 ` [PATCH v4 0/9] Making the generic ACPI GSI layer irqdomain aware Rob Herring
  9 siblings, 0 replies; 14+ messages in thread
From: Marc Zyngier @ 2015-09-28 16:43 UTC (permalink / raw)
  To: Thomas Gleixner, Jiang Liu, Jason Cooper, Rafael J. Wysocki,
	Mark Rutland, Rob Herring, Frank Rowand
  Cc: linux-acpi, linux-arm-kernel, linux-kernel, devicetree,
	Lorenzo Pieralisi, Tomasz Nowicki, Hanjun Guo,
	Suravee Suthikulpanit, Graeme Gregory, Jake Oshins

Now that the basic ACPI GSI code is irq domain aware, make sure
that the ACPI support in the GIC doesn't pointlessly deviate from
the DT path.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 drivers/irqchip/irq-gic.c | 58 ++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 45 insertions(+), 13 deletions(-)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 0e4142d..4f5772d 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -910,8 +910,6 @@ static int gic_irq_domain_xlate(struct irq_domain *d,
 {
 	unsigned long ret = 0;
 
-	if (d->of_node != controller)
-		return -EINVAL;
 	if (intsize < 3)
 		return -EINVAL;
 
@@ -979,7 +977,7 @@ static const struct irq_domain_ops gic_irq_domain_ops = {
 
 static void __init __gic_init_bases(unsigned int gic_nr, int irq_start,
 			   void __iomem *dist_base, void __iomem *cpu_base,
-			   u32 percpu_offset, struct device_node *node)
+			   u32 percpu_offset, struct fwnode_handle *handle)
 {
 	irq_hw_number_t hwirq_base;
 	struct gic_chip_data *gic;
@@ -1031,11 +1029,12 @@ static void __init __gic_init_bases(unsigned int gic_nr, int irq_start,
 		gic_irqs = 1020;
 	gic->gic_irqs = gic_irqs;
 
-	if (node) {		/* DT case */
+	if (handle) {		/* DT/ACPI */
+		struct device_node *node = to_of_node(handle);
 		gic->domain = irq_domain_add_linear(node, gic_irqs,
 						    &gic_irq_domain_hierarchy_ops,
 						    gic);
-	} else {		/* Non-DT case */
+	} else {		/* Legacy support */
 		/*
 		 * For primary GICs, skip over SGIs.
 		 * For secondary GICs, skip over PPIs, too.
@@ -1058,7 +1057,7 @@ static void __init __gic_init_bases(unsigned int gic_nr, int irq_start,
 			irq_base = irq_start;
 		}
 
-		gic->domain = irq_domain_add_legacy(node, gic_irqs, irq_base,
+		gic->domain = irq_domain_add_legacy(NULL, gic_irqs, irq_base,
 					hwirq_base, &gic_irq_domain_ops, gic);
 	}
 
@@ -1166,7 +1165,8 @@ gic_of_init(struct device_node *node, struct device_node *parent)
 	if (of_property_read_u32(node, "cpu-offset", &percpu_offset))
 		percpu_offset = 0;
 
-	__gic_init_bases(gic_cnt, -1, dist_base, cpu_base, percpu_offset, node);
+	__gic_init_bases(gic_cnt, -1, dist_base, cpu_base, percpu_offset,
+			 &node->fwnode);
 	if (!gic_cnt)
 		gic_init_physaddr(node);
 
@@ -1236,10 +1236,36 @@ gic_acpi_parse_madt_distributor(struct acpi_subtable_header *header,
 	return 0;
 }
 
+static int gic_acpi_gsi_desc_populate(struct acpi_gsi_descriptor *data,
+				      u32 gsi, unsigned int irq_type)
+{
+	/*
+	 * Encode GSI and triggering information the way the GIC likes
+	 * them.
+	 */
+	if (WARN_ON(gsi < 16))
+		return -EINVAL;
+
+	if (gsi >= 32) {
+		data->param[0] = 0;		/* SPI */
+		data->param[1] = gsi - 32;
+		data->param[2] = irq_type;
+	} else {
+		data->param[0] = 1; 		/* PPI */
+		data->param[1] = gsi - 16;
+		data->param[2] = 0xff << 4 | irq_type;
+	}
+
+	data->param_count = 3;
+
+	return 0;
+}
+
 int __init
 gic_v2_acpi_init(struct acpi_table_header *table)
 {
 	void __iomem *cpu_base, *dist_base;
+	struct fwnode_handle *domain_handle;
 	int count;
 
 	/* Collect CPU base addresses */
@@ -1290,14 +1316,20 @@ gic_v2_acpi_init(struct acpi_table_header *table)
 		static_key_slow_dec(&supports_deactivate);
 
 	/*
-	 * Initialize zero GIC instance (no multi-GIC support). Also, set GIC
-	 * as default IRQ domain to allow for GSI registration and GSI to IRQ
-	 * number translation (see acpi_register_gsi() and acpi_gsi_to_irq()).
+	 * Initialize GIC instance zero (no multi-GIC support).
 	 */
-	__gic_init_bases(0, -1, dist_base, cpu_base, 0, NULL);
-	irq_set_default_host(gic_data[0].domain);
+	domain_handle = irq_domain_alloc_fwnode(NULL);
+	if (!domain_handle) {
+		pr_err("Unable to allocate domain handle\n");
+		iounmap(cpu_base);
+		iounmap(dist_base);
+		return -ENOMEM;
+	}
+
+	__gic_init_bases(0, -1, dist_base, cpu_base, 0, domain_handle);
 
-	acpi_irq_model = ACPI_IRQ_MODEL_GIC;
+	acpi_set_irq_model(ACPI_IRQ_MODEL_GIC, domain_handle,
+			   gic_acpi_gsi_desc_populate);
 	return 0;
 }
 #endif
-- 
2.1.4


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

* [PATCH v4 9/9] acpi/gsi: Cleanup acpi_register_gsi
  2015-09-28 16:42 [PATCH v4 0/9] Making the generic ACPI GSI layer irqdomain aware Marc Zyngier
                   ` (7 preceding siblings ...)
  2015-09-28 16:43 ` [PATCH v4 8/9] irqchip/GIC: Switch ACPI support to stacked domains Marc Zyngier
@ 2015-09-28 16:43 ` Marc Zyngier
  2015-09-29 17:11 ` [PATCH v4 0/9] Making the generic ACPI GSI layer irqdomain aware Rob Herring
  9 siblings, 0 replies; 14+ messages in thread
From: Marc Zyngier @ 2015-09-28 16:43 UTC (permalink / raw)
  To: Thomas Gleixner, Jiang Liu, Jason Cooper, Rafael J. Wysocki,
	Mark Rutland, Rob Herring, Frank Rowand
  Cc: linux-acpi, linux-arm-kernel, linux-kernel, devicetree,
	Lorenzo Pieralisi, Tomasz Nowicki, Hanjun Guo,
	Suravee Suthikulpanit, Graeme Gregory, Jake Oshins

As the only user of drivers/acpi/gsi.c is now using acpi_set_irq_model
to set acpi_gsi_descriptor_populate to something meaningful, we can
always rely on that information to be present (its absence is an error),
and guarantee that new interrupt controllers will use this API.

Take this opportunity to cleanup acpi_register_gsi.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 drivers/acpi/gsi.c | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/drivers/acpi/gsi.c b/drivers/acpi/gsi.c
index 7905840..29e994d 100644
--- a/drivers/acpi/gsi.c
+++ b/drivers/acpi/gsi.c
@@ -76,28 +76,20 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger,
 		      int polarity)
 {
 	int err;
-	unsigned int irq;
+	struct acpi_gsi_descriptor data;
 	unsigned int irq_type = acpi_gsi_get_irq_type(trigger, polarity);
 	struct irq_domain *d = irq_find_host(acpi_gsi_domain_id);
 
-	if (acpi_gsi_descriptor_populate) {
-		struct acpi_gsi_descriptor data;
-		err = acpi_gsi_descriptor_populate(&data, gsi, irq_type);
-		if (err)
-			return err;
-
-		return irq_create_acpi_mapping(d, &data);
+	if (WARN_ON(!acpi_gsi_descriptor_populate)) {
+		pr_warn("GSI: No registered irqchip, giving up\n");
+		return -EINVAL;
 	}
 
-	irq = irq_create_mapping(d, gsi);
-	if (!irq)
-		return -EINVAL;
+	err = acpi_gsi_descriptor_populate(&data, gsi, irq_type);
+	if (err)
+		return err;
 
-	/* Set irq type if specified and different than the current one */
-	if (irq_type != IRQ_TYPE_NONE &&
-		irq_type != irq_get_trigger_type(irq))
-		irq_set_irq_type(irq, irq_type);
-	return irq;
+	return irq_create_acpi_mapping(d, &data);
 }
 EXPORT_SYMBOL_GPL(acpi_register_gsi);
 
-- 
2.1.4


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

* Re: [PATCH v4 1/9] drivers/of: Introduce of_node_alloc
  2015-09-28 16:42 ` [PATCH v4 1/9] drivers/of: Introduce of_node_alloc Marc Zyngier
@ 2015-09-28 22:50   ` Frank Rowand
  2015-09-29  8:01     ` Marc Zyngier
  0 siblings, 1 reply; 14+ messages in thread
From: Frank Rowand @ 2015-09-28 22:50 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Thomas Gleixner, Jiang Liu, Jason Cooper, Rafael J. Wysocki,
	Mark Rutland, Rob Herring, linux-acpi, linux-arm-kernel,
	linux-kernel, devicetree, Lorenzo Pieralisi, Tomasz Nowicki,
	Hanjun Guo, Suravee Suthikulpanit, Graeme Gregory, Jake Oshins

On 9/28/2015 9:42 AM, Marc Zyngier wrote:
> We want to be able to generate "fake" device nodes that can be
> used as an identifier for irq domains. For that, we reuse the
> dynamic DT layer in order to generate DT nodes in a detached state
> (so that it doesn't interfere with the rest of the tree).
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
>  drivers/of/dynamic.c | 22 ++++++++++++++++++++++
>  include/linux/of.h   |  5 +++++
>  2 files changed, 27 insertions(+)
> 
> diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c
> index 53826b8..709d363 100644
> --- a/drivers/of/dynamic.c
> +++ b/drivers/of/dynamic.c
> @@ -445,6 +445,28 @@ struct device_node *__of_node_dup(const struct device_node *np, const char *fmt,
>  	return NULL;
>  }
>  
> +/**
> + * of_node_alloc() - Allocate an empty device node dynamically.
> + * @fmt: Format string (plus vargs) for new full name of the device node
> + *
> + * Create an device tree node, either by by allocating an empty one

      Create a device tree node by allocating an empty one

> + * suitable for further modification.  The node data are dynamically
> + * allocated and all the node flags have the OF_DYNAMIC & OF_DETACHED
> + * bits set. Returns the newly allocated node or NULL on out of memory
> + * error.
> + */
> +struct device_node *of_node_alloc(const char *fmt, ...)

< snip >


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

* Re: [PATCH v4 1/9] drivers/of: Introduce of_node_alloc
  2015-09-28 22:50   ` Frank Rowand
@ 2015-09-29  8:01     ` Marc Zyngier
  0 siblings, 0 replies; 14+ messages in thread
From: Marc Zyngier @ 2015-09-29  8:01 UTC (permalink / raw)
  To: Frank Rowand
  Cc: Thomas Gleixner, Jiang Liu, Jason Cooper, Rafael J. Wysocki,
	Mark Rutland, Rob Herring, linux-acpi, linux-arm-kernel,
	linux-kernel, devicetree, Lorenzo Pieralisi, Tomasz Nowicki,
	Hanjun Guo, Suravee Suthikulpanit, Graeme Gregory, Jake Oshins

On Mon, 28 Sep 2015 15:50:38 -0700
Frank Rowand <frowand.list@gmail.com> wrote:

> On 9/28/2015 9:42 AM, Marc Zyngier wrote:
> > We want to be able to generate "fake" device nodes that can be
> > used as an identifier for irq domains. For that, we reuse the
> > dynamic DT layer in order to generate DT nodes in a detached state
> > (so that it doesn't interfere with the rest of the tree).
> > 
> > Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> > ---
> >  drivers/of/dynamic.c | 22 ++++++++++++++++++++++
> >  include/linux/of.h   |  5 +++++
> >  2 files changed, 27 insertions(+)
> > 
> > diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c
> > index 53826b8..709d363 100644
> > --- a/drivers/of/dynamic.c
> > +++ b/drivers/of/dynamic.c
> > @@ -445,6 +445,28 @@ struct device_node *__of_node_dup(const struct device_node *np, const char *fmt,
> >  	return NULL;
> >  }
> >  
> > +/**
> > + * of_node_alloc() - Allocate an empty device node dynamically.
> > + * @fmt: Format string (plus vargs) for new full name of the device node
> > + *
> > + * Create an device tree node, either by by allocating an empty one
> 
>       Create a device tree node by allocating an empty one

Ah! Thanks!

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

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

* Re: [PATCH v4 0/9] Making the generic ACPI GSI layer irqdomain aware
  2015-09-28 16:42 [PATCH v4 0/9] Making the generic ACPI GSI layer irqdomain aware Marc Zyngier
                   ` (8 preceding siblings ...)
  2015-09-28 16:43 ` [PATCH v4 9/9] acpi/gsi: Cleanup acpi_register_gsi Marc Zyngier
@ 2015-09-29 17:11 ` Rob Herring
  2015-09-29 17:17   ` Marc Zyngier
  9 siblings, 1 reply; 14+ messages in thread
From: Rob Herring @ 2015-09-29 17:11 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Thomas Gleixner, Jiang Liu, Jason Cooper, Rafael J. Wysocki,
	Mark Rutland, Rob Herring, Frank Rowand, linux-acpi,
	linux-arm-kernel, linux-kernel, devicetree, Lorenzo Pieralisi,
	Tomasz Nowicki, Hanjun Guo, Suravee Suthikulpanit,
	Graeme Gregory, Jake Oshins

On Mon, Sep 28, 2015 at 11:42 AM, Marc Zyngier <marc.zyngier@arm.com> wrote:
> The irqdomain code is not entierely ACPI friendly, as it has some
> built-in knowledge of the device-tree. Nothing too harmful, but enough
> to scare the ARM ACPI developpers which end up with their own version
> of the square wheel.
>
> This small patch series adapts the irqdomain code to remove the
> hurdles that prevent the full blown irqdomain subsystem to be used on
> ACPI, creates an interface between the GSI layer and the irqdomain,
> and as an example, convert the ARM GIC ACPI support to use irqdomains
> as originally intended.
>
> Overall, this gives us a way to use irqdomains on both DT and ACPI
> enabled platforms, having very little changes made to the actual
> drivers (other than the probing infrastructure). Because we keep the
> flow of information between the various layers identical between ACPI
> and DT, we immediately benefit from the existing infrastructure. The
> "convert the GSI information to be DT friendly" is admitedly not very
> pretty, but I see it as a stepping stone towards unifying the two
> structures.

Did I miss v1-v3 or did the DT change just show up? I probably tuned
out with ACPI in the subject.

Needing fake DT nodes for ACPI is just wrong. There's got to be
another, better way.

Rob

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

* Re: [PATCH v4 0/9] Making the generic ACPI GSI layer irqdomain aware
  2015-09-29 17:11 ` [PATCH v4 0/9] Making the generic ACPI GSI layer irqdomain aware Rob Herring
@ 2015-09-29 17:17   ` Marc Zyngier
  0 siblings, 0 replies; 14+ messages in thread
From: Marc Zyngier @ 2015-09-29 17:17 UTC (permalink / raw)
  To: Rob Herring
  Cc: Thomas Gleixner, Jiang Liu, Jason Cooper, Rafael J. Wysocki,
	Mark Rutland, Rob Herring, Frank Rowand, linux-acpi,
	linux-arm-kernel, linux-kernel, devicetree, Lorenzo Pieralisi,
	Tomasz Nowicki, Hanjun Guo, Suravee Suthikulpanit,
	Graeme Gregory, Jake Oshins

On 29/09/15 18:11, Rob Herring wrote:
> On Mon, Sep 28, 2015 at 11:42 AM, Marc Zyngier <marc.zyngier@arm.com> wrote:
>> The irqdomain code is not entierely ACPI friendly, as it has some
>> built-in knowledge of the device-tree. Nothing too harmful, but enough
>> to scare the ARM ACPI developpers which end up with their own version
>> of the square wheel.
>>
>> This small patch series adapts the irqdomain code to remove the
>> hurdles that prevent the full blown irqdomain subsystem to be used on
>> ACPI, creates an interface between the GSI layer and the irqdomain,
>> and as an example, convert the ARM GIC ACPI support to use irqdomains
>> as originally intended.
>>
>> Overall, this gives us a way to use irqdomains on both DT and ACPI
>> enabled platforms, having very little changes made to the actual
>> drivers (other than the probing infrastructure). Because we keep the
>> flow of information between the various layers identical between ACPI
>> and DT, we immediately benefit from the existing infrastructure. The
>> "convert the GSI information to be DT friendly" is admitedly not very
>> pretty, but I see it as a stepping stone towards unifying the two
>> structures.
> 
> Did I miss v1-v3 or did the DT change just show up? I probably tuned
> out with ACPI in the subject.

No, that's new. It was far worse before.

> Needing fake DT nodes for ACPI is just wrong. There's got to be
> another, better way.

Well, the alternative is to rewrite the whole of irqdomain and
everything that gets called from there in terms of fwnode_handle. Which
will trickle in the whole of OF as well.

Note that the fake DT node doesn't represent an ACPI object at all. It
is an identifier for an irqdomain, and that's where it stops.

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

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

end of thread, other threads:[~2015-09-29 17:18 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-28 16:42 [PATCH v4 0/9] Making the generic ACPI GSI layer irqdomain aware Marc Zyngier
2015-09-28 16:42 ` [PATCH v4 1/9] drivers/of: Introduce of_node_alloc Marc Zyngier
2015-09-28 22:50   ` Frank Rowand
2015-09-29  8:01     ` Marc Zyngier
2015-09-28 16:42 ` [PATCH v4 2/9] genirq/irqdomain: Add irq_create_acpi_mapping Marc Zyngier
2015-09-28 16:42 ` [PATCH v4 3/9] genirq/irqdomain: Add a fwnode_handle allocator Marc Zyngier
2015-09-28 16:42 ` [PATCH v4 4/9] acpi/gsi: Always perform an irq domain lookup Marc Zyngier
2015-09-28 16:42 ` [PATCH v4 5/9] acpi/gsi: Add acpi_set_irq_model to initialize the GSI layer Marc Zyngier
2015-09-28 16:42 ` [PATCH v4 6/9] acpi/gsi: Select OF_DYNAMIC when ACPI_GENERIC_GSI is selected Marc Zyngier
2015-09-28 16:43 ` [PATCH v4 7/9] irqchip/GIC: Get rid of gic_init_bases() Marc Zyngier
2015-09-28 16:43 ` [PATCH v4 8/9] irqchip/GIC: Switch ACPI support to stacked domains Marc Zyngier
2015-09-28 16:43 ` [PATCH v4 9/9] acpi/gsi: Cleanup acpi_register_gsi Marc Zyngier
2015-09-29 17:11 ` [PATCH v4 0/9] Making the generic ACPI GSI layer irqdomain aware Rob Herring
2015-09-29 17:17   ` Marc Zyngier

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