* [PATCH 0/4] irqdomain: Improve irq_domain_mapping facility
@ 2017-05-12 11:55 Marc Zyngier
2017-05-12 11:55 ` [PATCH 1/4] irqdomain: Let irq_domain_mapping display hierarchical domains Marc Zyngier
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Marc Zyngier @ 2017-05-12 11:55 UTC (permalink / raw)
To: linux-kernel; +Cc: Thomas Gleixner
/sys/kernel/debug/irq_domain_mapping is a pretty useful tool to find
out how irqdomains (and individual interrupts) are setup, but it lacks
an understanding of hierarchical domains, and is not documented at
all.
Let's start to remedy this, as people seem incredibly puzzled by the
whole stacked domain thing, wasting too much time reverse-engineering
the core code while just peeking at a debugfs file could give them an
insight on what's going on.
Marc Zyngier (4):
irqdomain: Let irq_domain_mapping display hierarchical domains
irqdomain: Let irq_domain_mapping display ACPI fwnode attributes
genirq/msi: Populate the domain name if provided by the irqchip
Documentation: Update IRQ-domain.txt to document irq_domain_mapping
Documentation/IRQ-domain.txt | 41 ++++++++++++++++++++--
kernel/irq/irqdomain.c | 81 ++++++++++++++++++++++++++++++--------------
kernel/irq/msi.c | 10 ++++--
3 files changed, 102 insertions(+), 30 deletions(-)
--
2.11.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/4] irqdomain: Let irq_domain_mapping display hierarchical domains
2017-05-12 11:55 [PATCH 0/4] irqdomain: Improve irq_domain_mapping facility Marc Zyngier
@ 2017-05-12 11:55 ` Marc Zyngier
2017-05-22 20:33 ` [tip:irq/core] " tip-bot for Marc Zyngier
2017-05-12 11:55 ` [PATCH 2/4] irqdomain: Let irq_domain_mapping display ACPI fwnode attributes Marc Zyngier
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Marc Zyngier @ 2017-05-12 11:55 UTC (permalink / raw)
To: linux-kernel; +Cc: Thomas Gleixner
Hierarchical domains seem to be hard to grasp, and a number of
aspiring kernel hackers find them utterly discombobulating.
In order to ease their pain, let's make them appear in
/sys/kernel/debug/irq_domain_mapping, such as the following:
96 0x81808 MSI 0x (null) RADIX MSI
96+ 0x00063 GICv2m 0xffff8003ee116980 RADIX GICv2m
96+ 0x00063 GICv2 0xffff00000916bfd8 LINEAR GICv2
[output compressed to fit in a commit log]
This shows that IRQ96 is implemented by a stack of three domains,
the + sign indicating the stacking.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
kernel/irq/irqdomain.c | 68 +++++++++++++++++++++++++++++++-------------------
1 file changed, 43 insertions(+), 25 deletions(-)
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 31805f237396..1f6cd2cacf74 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -746,13 +746,54 @@ unsigned int irq_find_mapping(struct irq_domain *domain,
EXPORT_SYMBOL_GPL(irq_find_mapping);
#ifdef CONFIG_IRQ_DOMAIN_DEBUG
+static void virq_debug_show_one(struct seq_file *m, struct irq_desc *desc)
+{
+ struct irq_domain *domain;
+ struct irq_data *data;
+
+ domain = desc->irq_data.domain;
+ data = &desc->irq_data;
+
+ while (domain) {
+ unsigned int irq = data->irq;
+ unsigned long hwirq = data->hwirq;
+ struct irq_chip *chip;
+ bool direct;
+
+ if (data == &desc->irq_data)
+ seq_printf(m, "%5d ", irq);
+ else
+ seq_printf(m, "%5d+ ", irq);
+ seq_printf(m, "0x%05lx ", hwirq);
+
+ chip = irq_data_get_irq_chip(data);
+ seq_printf(m, "%-15s ", (chip && chip->name) ? chip->name : "none");
+
+ seq_printf(m, data ? "0x%p " : " %p ",
+ irq_data_get_irq_chip_data(data));
+
+ seq_printf(m, " %c ", (desc->action && desc->action->handler) ? '*' : ' ');
+ direct = (irq == hwirq) && (irq < domain->revmap_direct_max_irq);
+ seq_printf(m, "%6s%-8s ",
+ (hwirq < domain->revmap_size) ? "LINEAR" : "RADIX",
+ direct ? "(DIRECT)" : "");
+ seq_printf(m, "%s\n", domain->name);
+#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
+ domain = domain->parent;
+ data = data->parent_data;
+#else
+ domain = NULL;
+#endif
+ }
+}
+
static int virq_debug_show(struct seq_file *m, void *private)
{
unsigned long flags;
struct irq_desc *desc;
struct irq_domain *domain;
struct radix_tree_iter iter;
- void *data, **slot;
+ void **slot;
int i;
seq_printf(m, " %-16s %-6s %-10s %-10s %s\n",
@@ -782,30 +823,7 @@ static int virq_debug_show(struct seq_file *m, void *private)
continue;
raw_spin_lock_irqsave(&desc->lock, flags);
- domain = desc->irq_data.domain;
-
- if (domain) {
- struct irq_chip *chip;
- int hwirq = desc->irq_data.hwirq;
- bool direct;
-
- seq_printf(m, "%5d ", i);
- seq_printf(m, "0x%05x ", hwirq);
-
- chip = irq_desc_get_chip(desc);
- seq_printf(m, "%-15s ", (chip && chip->name) ? chip->name : "none");
-
- data = irq_desc_get_chip_data(desc);
- seq_printf(m, data ? "0x%p " : " %p ", data);
-
- seq_printf(m, " %c ", (desc->action && desc->action->handler) ? '*' : ' ');
- direct = (i == hwirq) && (i < domain->revmap_direct_max_irq);
- seq_printf(m, "%6s%-8s ",
- (hwirq < domain->revmap_size) ? "LINEAR" : "RADIX",
- direct ? "(DIRECT)" : "");
- seq_printf(m, "%s\n", desc->irq_data.domain->name);
- }
-
+ virq_debug_show_one(m, desc);
raw_spin_unlock_irqrestore(&desc->lock, flags);
}
--
2.11.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/4] irqdomain: Let irq_domain_mapping display ACPI fwnode attributes
2017-05-12 11:55 [PATCH 0/4] irqdomain: Improve irq_domain_mapping facility Marc Zyngier
2017-05-12 11:55 ` [PATCH 1/4] irqdomain: Let irq_domain_mapping display hierarchical domains Marc Zyngier
@ 2017-05-12 11:55 ` Marc Zyngier
2017-05-22 20:34 ` [tip:irq/core] " tip-bot for Marc Zyngier
2017-05-12 11:55 ` [PATCH 3/4] genirq/msi: Populate the domain name if provided by the irqchip Marc Zyngier
2017-05-12 11:55 ` [PATCH 4/4] Documentation: Update IRQ-domain.txt to document irq_domain_mapping Marc Zyngier
3 siblings, 1 reply; 9+ messages in thread
From: Marc Zyngier @ 2017-05-12 11:55 UTC (permalink / raw)
To: linux-kernel; +Cc: Thomas Gleixner
If we're using ACPI, there is no of_node to display. But ACPI can
use a struct irqchip_fwid as a domain identifier, and we can
display the name contained in that structure.
We end-up with something like this:
pMSI 0 0 0 irqchip@00000000e1180000
MSI 37 0 0 irqchip@00000000e1180000
GICv2m 37 0 0 irqchip@00000000e1180000
GICv2 448 448 0 irqchip@ffff000008003000
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
kernel/irq/irqdomain.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 1f6cd2cacf74..70b9da72018b 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -801,15 +801,26 @@ static int virq_debug_show(struct seq_file *m, void *private)
mutex_lock(&irq_domain_mutex);
list_for_each_entry(domain, &irq_domain_list, link) {
struct device_node *of_node;
+ const char *name;
+
int count = 0;
+
of_node = irq_domain_get_of_node(domain);
+ if (of_node)
+ name = of_node_full_name(of_node);
+ else if (is_fwnode_irqchip(domain->fwnode))
+ name = container_of(domain->fwnode, struct irqchip_fwid,
+ fwnode)->name;
+ else
+ name = "";
+
radix_tree_for_each_slot(slot, &domain->revmap_tree, &iter, 0)
count++;
seq_printf(m, "%c%-16s %6u %10u %10u %s\n",
domain == irq_default_domain ? '*' : ' ', domain->name,
domain->revmap_size + count, domain->revmap_size,
domain->revmap_direct_max_irq,
- of_node ? of_node_full_name(of_node) : "");
+ name);
}
mutex_unlock(&irq_domain_mutex);
--
2.11.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/4] genirq/msi: Populate the domain name if provided by the irqchip
2017-05-12 11:55 [PATCH 0/4] irqdomain: Improve irq_domain_mapping facility Marc Zyngier
2017-05-12 11:55 ` [PATCH 1/4] irqdomain: Let irq_domain_mapping display hierarchical domains Marc Zyngier
2017-05-12 11:55 ` [PATCH 2/4] irqdomain: Let irq_domain_mapping display ACPI fwnode attributes Marc Zyngier
@ 2017-05-12 11:55 ` Marc Zyngier
2017-05-22 20:35 ` [tip:irq/core] " tip-bot for Marc Zyngier
2017-05-12 11:55 ` [PATCH 4/4] Documentation: Update IRQ-domain.txt to document irq_domain_mapping Marc Zyngier
3 siblings, 1 reply; 9+ messages in thread
From: Marc Zyngier @ 2017-05-12 11:55 UTC (permalink / raw)
To: linux-kernel; +Cc: Thomas Gleixner
In order to ease debug, let's populate the domain name upfront,
before any MSI gets requested. This allows the domain to appear
in the irq_domain_mapping, and the user to easily find the expected
data.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
kernel/irq/msi.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index ddc2f5427f75..fe4d48ec5bc4 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -265,13 +265,19 @@ struct irq_domain *msi_create_irq_domain(struct fwnode_handle *fwnode,
struct msi_domain_info *info,
struct irq_domain *parent)
{
+ struct irq_domain *domain;
+
if (info->flags & MSI_FLAG_USE_DEF_DOM_OPS)
msi_domain_update_dom_ops(info);
if (info->flags & MSI_FLAG_USE_DEF_CHIP_OPS)
msi_domain_update_chip_ops(info);
- return irq_domain_create_hierarchy(parent, IRQ_DOMAIN_FLAG_MSI, 0,
- fwnode, &msi_domain_ops, info);
+ domain = irq_domain_create_hierarchy(parent, IRQ_DOMAIN_FLAG_MSI, 0,
+ fwnode, &msi_domain_ops, info);
+ if (domain && info->chip && info->chip->name)
+ domain->name = info->chip->name;
+
+ return domain;
}
int msi_domain_prepare_irqs(struct irq_domain *domain, struct device *dev,
--
2.11.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/4] Documentation: Update IRQ-domain.txt to document irq_domain_mapping
2017-05-12 11:55 [PATCH 0/4] irqdomain: Improve irq_domain_mapping facility Marc Zyngier
` (2 preceding siblings ...)
2017-05-12 11:55 ` [PATCH 3/4] genirq/msi: Populate the domain name if provided by the irqchip Marc Zyngier
@ 2017-05-12 11:55 ` Marc Zyngier
2017-05-22 20:35 ` [tip:irq/core] " tip-bot for Marc Zyngier
3 siblings, 1 reply; 9+ messages in thread
From: Marc Zyngier @ 2017-05-12 11:55 UTC (permalink / raw)
To: linux-kernel; +Cc: Thomas Gleixner
irq_domain_mapping is a rather useful tool to understand how IRqs
are mapped in irqdomains, and yet it is not documented anywhere.
Let's address this.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
Documentation/IRQ-domain.txt | 41 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 39 insertions(+), 2 deletions(-)
diff --git a/Documentation/IRQ-domain.txt b/Documentation/IRQ-domain.txt
index 82001a25a14b..317bc87fedc4 100644
--- a/Documentation/IRQ-domain.txt
+++ b/Documentation/IRQ-domain.txt
@@ -231,5 +231,42 @@ needs to:
4) No need to implement irq_domain_ops.map and irq_domain_ops.unmap,
they are unused with hierarchy irq_domain.
-Hierarchy irq_domain may also be used to support other architectures,
-such as ARM, ARM64 etc.
+Hierarchy irq_domain is in no way x86 specific, and is heavily used to
+support other architectures, such as ARM, ARM64 etc.
+
+=== Debugging ===
+
+If you switch on CONFIG_IRQ_DOMAIN_DEBUG (which depends on
+CONFIG_IRQ_DOMAIN and CONFIG_DEBUG_FS), you will find a new file in
+your debugfs mount point, called irq_domain_mapping. This file
+contains a live snapshot of all the IRQ domains in the system:
+
+ name mapped linear-max direct-max devtree-node
+ pl061 8 8 0 /smb/gpio@e0080000
+ pl061 8 8 0 /smb/gpio@e1050000
+ pMSI 0 0 0 /interrupt-controller@e1101000/v2m@e0080000
+ MSI 37 0 0 /interrupt-controller@e1101000/v2m@e0080000
+ GICv2m 37 0 0 /interrupt-controller@e1101000/v2m@e0080000
+ GICv2 448 448 0 /interrupt-controller@e1101000
+
+it also iterates over the interrupts to display their mapping in the
+domains, and makes visible the domain stacking:
+
+
+irq hwirq chip name chip data active type domain
+ 1 0x00019 GICv2 0xffff00000916bfd8 * LINEAR GICv2
+ 2 0x0001d GICv2 0xffff00000916bfd8 LINEAR GICv2
+ 3 0x0001e GICv2 0xffff00000916bfd8 * LINEAR GICv2
+ 4 0x0001b GICv2 0xffff00000916bfd8 * LINEAR GICv2
+ 5 0x0001a GICv2 0xffff00000916bfd8 LINEAR GICv2
+[...]
+ 96 0x81808 MSI 0x (null) RADIX MSI
+ 96+ 0x00063 GICv2m 0xffff8003ee116980 RADIX GICv2m
+ 96+ 0x00063 GICv2 0xffff00000916bfd8 LINEAR GICv2
+ 97 0x08800 MSI 0x (null) * RADIX MSI
+ 97+ 0x00064 GICv2m 0xffff8003ee116980 * RADIX GICv2m
+ 97+ 0x00064 GICv2 0xffff00000916bfd8 * LINEAR GICv2
+
+Here, interrupts 1-5 are only using a single domain, while 96 and 97
+are build out of a stack of three domain, each level performing a
+particular function.
--
2.11.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [tip:irq/core] irqdomain: Let irq_domain_mapping display hierarchical domains
2017-05-12 11:55 ` [PATCH 1/4] irqdomain: Let irq_domain_mapping display hierarchical domains Marc Zyngier
@ 2017-05-22 20:33 ` tip-bot for Marc Zyngier
0 siblings, 0 replies; 9+ messages in thread
From: tip-bot for Marc Zyngier @ 2017-05-22 20:33 UTC (permalink / raw)
To: linux-tip-commits; +Cc: tglx, linux-kernel, hpa, marc.zyngier, mingo
Commit-ID: fe17a42e704a64477b15bb2cf8366fe3e5119aff
Gitweb: http://git.kernel.org/tip/fe17a42e704a64477b15bb2cf8366fe3e5119aff
Author: Marc Zyngier <marc.zyngier@arm.com>
AuthorDate: Fri, 12 May 2017 12:55:35 +0100
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Mon, 22 May 2017 22:29:44 +0200
irqdomain: Let irq_domain_mapping display hierarchical domains
Hierarchical domains seem to be hard to grasp, and a number of
aspiring kernel hackers find them utterly discombobulating.
In order to ease their pain, let's make them appear in
/sys/kernel/debug/irq_domain_mapping, such as the following:
96 0x81808 MSI 0x (null) RADIX MSI
96+ 0x00063 GICv2m 0xffff8003ee116980 RADIX GICv2m
96+ 0x00063 GICv2 0xffff00000916bfd8 LINEAR GICv2
[output compressed to fit in a commit log]
This shows that IRQ96 is implemented by a stack of three domains,
the + sign indicating the stacking.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Link: http://lkml.kernel.org/r/20170512115538.10767-2-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/irq/irqdomain.c | 68 +++++++++++++++++++++++++++++++-------------------
1 file changed, 43 insertions(+), 25 deletions(-)
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 31805f2..1f6cd2c 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -746,13 +746,54 @@ unsigned int irq_find_mapping(struct irq_domain *domain,
EXPORT_SYMBOL_GPL(irq_find_mapping);
#ifdef CONFIG_IRQ_DOMAIN_DEBUG
+static void virq_debug_show_one(struct seq_file *m, struct irq_desc *desc)
+{
+ struct irq_domain *domain;
+ struct irq_data *data;
+
+ domain = desc->irq_data.domain;
+ data = &desc->irq_data;
+
+ while (domain) {
+ unsigned int irq = data->irq;
+ unsigned long hwirq = data->hwirq;
+ struct irq_chip *chip;
+ bool direct;
+
+ if (data == &desc->irq_data)
+ seq_printf(m, "%5d ", irq);
+ else
+ seq_printf(m, "%5d+ ", irq);
+ seq_printf(m, "0x%05lx ", hwirq);
+
+ chip = irq_data_get_irq_chip(data);
+ seq_printf(m, "%-15s ", (chip && chip->name) ? chip->name : "none");
+
+ seq_printf(m, data ? "0x%p " : " %p ",
+ irq_data_get_irq_chip_data(data));
+
+ seq_printf(m, " %c ", (desc->action && desc->action->handler) ? '*' : ' ');
+ direct = (irq == hwirq) && (irq < domain->revmap_direct_max_irq);
+ seq_printf(m, "%6s%-8s ",
+ (hwirq < domain->revmap_size) ? "LINEAR" : "RADIX",
+ direct ? "(DIRECT)" : "");
+ seq_printf(m, "%s\n", domain->name);
+#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
+ domain = domain->parent;
+ data = data->parent_data;
+#else
+ domain = NULL;
+#endif
+ }
+}
+
static int virq_debug_show(struct seq_file *m, void *private)
{
unsigned long flags;
struct irq_desc *desc;
struct irq_domain *domain;
struct radix_tree_iter iter;
- void *data, **slot;
+ void **slot;
int i;
seq_printf(m, " %-16s %-6s %-10s %-10s %s\n",
@@ -782,30 +823,7 @@ static int virq_debug_show(struct seq_file *m, void *private)
continue;
raw_spin_lock_irqsave(&desc->lock, flags);
- domain = desc->irq_data.domain;
-
- if (domain) {
- struct irq_chip *chip;
- int hwirq = desc->irq_data.hwirq;
- bool direct;
-
- seq_printf(m, "%5d ", i);
- seq_printf(m, "0x%05x ", hwirq);
-
- chip = irq_desc_get_chip(desc);
- seq_printf(m, "%-15s ", (chip && chip->name) ? chip->name : "none");
-
- data = irq_desc_get_chip_data(desc);
- seq_printf(m, data ? "0x%p " : " %p ", data);
-
- seq_printf(m, " %c ", (desc->action && desc->action->handler) ? '*' : ' ');
- direct = (i == hwirq) && (i < domain->revmap_direct_max_irq);
- seq_printf(m, "%6s%-8s ",
- (hwirq < domain->revmap_size) ? "LINEAR" : "RADIX",
- direct ? "(DIRECT)" : "");
- seq_printf(m, "%s\n", desc->irq_data.domain->name);
- }
-
+ virq_debug_show_one(m, desc);
raw_spin_unlock_irqrestore(&desc->lock, flags);
}
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [tip:irq/core] irqdomain: Let irq_domain_mapping display ACPI fwnode attributes
2017-05-12 11:55 ` [PATCH 2/4] irqdomain: Let irq_domain_mapping display ACPI fwnode attributes Marc Zyngier
@ 2017-05-22 20:34 ` tip-bot for Marc Zyngier
0 siblings, 0 replies; 9+ messages in thread
From: tip-bot for Marc Zyngier @ 2017-05-22 20:34 UTC (permalink / raw)
To: linux-tip-commits; +Cc: mingo, tglx, marc.zyngier, linux-kernel, hpa
Commit-ID: 2370c00dc7232d0c4af224e7730b4de031f3b1a0
Gitweb: http://git.kernel.org/tip/2370c00dc7232d0c4af224e7730b4de031f3b1a0
Author: Marc Zyngier <marc.zyngier@arm.com>
AuthorDate: Fri, 12 May 2017 12:55:36 +0100
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Mon, 22 May 2017 22:29:44 +0200
irqdomain: Let irq_domain_mapping display ACPI fwnode attributes
If the system is using ACPI, there is no of_node to display. But ACPI can
use a struct irqchip_fwid as a domain identifier, and it can be used to
display the name contained in that structure.
The output on such a system will look like this:
pMSI 0 0 0 irqchip@00000000e1180000
MSI 37 0 0 irqchip@00000000e1180000
GICv2m 37 0 0 irqchip@00000000e1180000
GICv2 448 448 0 irqchip@ffff000008003000
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Link: http://lkml.kernel.org/r/20170512115538.10767-3-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/irq/irqdomain.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 1f6cd2c..70b9da7 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -801,15 +801,26 @@ static int virq_debug_show(struct seq_file *m, void *private)
mutex_lock(&irq_domain_mutex);
list_for_each_entry(domain, &irq_domain_list, link) {
struct device_node *of_node;
+ const char *name;
+
int count = 0;
+
of_node = irq_domain_get_of_node(domain);
+ if (of_node)
+ name = of_node_full_name(of_node);
+ else if (is_fwnode_irqchip(domain->fwnode))
+ name = container_of(domain->fwnode, struct irqchip_fwid,
+ fwnode)->name;
+ else
+ name = "";
+
radix_tree_for_each_slot(slot, &domain->revmap_tree, &iter, 0)
count++;
seq_printf(m, "%c%-16s %6u %10u %10u %s\n",
domain == irq_default_domain ? '*' : ' ', domain->name,
domain->revmap_size + count, domain->revmap_size,
domain->revmap_direct_max_irq,
- of_node ? of_node_full_name(of_node) : "");
+ name);
}
mutex_unlock(&irq_domain_mutex);
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [tip:irq/core] genirq/msi: Populate the domain name if provided by the irqchip
2017-05-12 11:55 ` [PATCH 3/4] genirq/msi: Populate the domain name if provided by the irqchip Marc Zyngier
@ 2017-05-22 20:35 ` tip-bot for Marc Zyngier
0 siblings, 0 replies; 9+ messages in thread
From: tip-bot for Marc Zyngier @ 2017-05-22 20:35 UTC (permalink / raw)
To: linux-tip-commits; +Cc: mingo, hpa, linux-kernel, tglx, marc.zyngier
Commit-ID: a97b852b4d4c2f8c50cab13c71566639f9a1a990
Gitweb: http://git.kernel.org/tip/a97b852b4d4c2f8c50cab13c71566639f9a1a990
Author: Marc Zyngier <marc.zyngier@arm.com>
AuthorDate: Fri, 12 May 2017 12:55:37 +0100
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Mon, 22 May 2017 22:29:45 +0200
genirq/msi: Populate the domain name if provided by the irqchip
In order to ease debug, let's populate the domain name upfront, before any
MSI gets requested. This allows the domain to appear in the
irq_domain_mapping, and the user to easily find the expected data.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Link: http://lkml.kernel.org/r/20170512115538.10767-4-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/irq/msi.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index ddc2f54..fe4d48e 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -265,13 +265,19 @@ struct irq_domain *msi_create_irq_domain(struct fwnode_handle *fwnode,
struct msi_domain_info *info,
struct irq_domain *parent)
{
+ struct irq_domain *domain;
+
if (info->flags & MSI_FLAG_USE_DEF_DOM_OPS)
msi_domain_update_dom_ops(info);
if (info->flags & MSI_FLAG_USE_DEF_CHIP_OPS)
msi_domain_update_chip_ops(info);
- return irq_domain_create_hierarchy(parent, IRQ_DOMAIN_FLAG_MSI, 0,
- fwnode, &msi_domain_ops, info);
+ domain = irq_domain_create_hierarchy(parent, IRQ_DOMAIN_FLAG_MSI, 0,
+ fwnode, &msi_domain_ops, info);
+ if (domain && info->chip && info->chip->name)
+ domain->name = info->chip->name;
+
+ return domain;
}
int msi_domain_prepare_irqs(struct irq_domain *domain, struct device *dev,
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [tip:irq/core] Documentation: Update IRQ-domain.txt to document irq_domain_mapping
2017-05-12 11:55 ` [PATCH 4/4] Documentation: Update IRQ-domain.txt to document irq_domain_mapping Marc Zyngier
@ 2017-05-22 20:35 ` tip-bot for Marc Zyngier
0 siblings, 0 replies; 9+ messages in thread
From: tip-bot for Marc Zyngier @ 2017-05-22 20:35 UTC (permalink / raw)
To: linux-tip-commits; +Cc: mingo, tglx, hpa, marc.zyngier, linux-kernel
Commit-ID: 53286669392b2d888f4b78b0e7894e022e668d11
Gitweb: http://git.kernel.org/tip/53286669392b2d888f4b78b0e7894e022e668d11
Author: Marc Zyngier <marc.zyngier@arm.com>
AuthorDate: Fri, 12 May 2017 12:55:38 +0100
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Mon, 22 May 2017 22:29:45 +0200
Documentation: Update IRQ-domain.txt to document irq_domain_mapping
irq_domain_mapping is a rather useful tool to understand how IRqs
are mapped in irqdomains, and yet it is not documented anywhere.
Let's address this.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Link: http://lkml.kernel.org/r/20170512115538.10767-5-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
Documentation/IRQ-domain.txt | 41 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 39 insertions(+), 2 deletions(-)
diff --git a/Documentation/IRQ-domain.txt b/Documentation/IRQ-domain.txt
index 82001a2..1f246eb 100644
--- a/Documentation/IRQ-domain.txt
+++ b/Documentation/IRQ-domain.txt
@@ -231,5 +231,42 @@ needs to:
4) No need to implement irq_domain_ops.map and irq_domain_ops.unmap,
they are unused with hierarchy irq_domain.
-Hierarchy irq_domain may also be used to support other architectures,
-such as ARM, ARM64 etc.
+Hierarchy irq_domain is in no way x86 specific, and is heavily used to
+support other architectures, such as ARM, ARM64 etc.
+
+=== Debugging ===
+
+If you switch on CONFIG_IRQ_DOMAIN_DEBUG (which depends on
+CONFIG_IRQ_DOMAIN and CONFIG_DEBUG_FS), you will find a new file in
+your debugfs mount point, called irq_domain_mapping. This file
+contains a live snapshot of all the IRQ domains in the system:
+
+ name mapped linear-max direct-max devtree-node
+ pl061 8 8 0 /smb/gpio@e0080000
+ pl061 8 8 0 /smb/gpio@e1050000
+ pMSI 0 0 0 /interrupt-controller@e1101000/v2m@e0080000
+ MSI 37 0 0 /interrupt-controller@e1101000/v2m@e0080000
+ GICv2m 37 0 0 /interrupt-controller@e1101000/v2m@e0080000
+ GICv2 448 448 0 /interrupt-controller@e1101000
+
+it also iterates over the interrupts to display their mapping in the
+domains, and makes the domain stacking visible:
+
+
+irq hwirq chip name chip data active type domain
+ 1 0x00019 GICv2 0xffff00000916bfd8 * LINEAR GICv2
+ 2 0x0001d GICv2 0xffff00000916bfd8 LINEAR GICv2
+ 3 0x0001e GICv2 0xffff00000916bfd8 * LINEAR GICv2
+ 4 0x0001b GICv2 0xffff00000916bfd8 * LINEAR GICv2
+ 5 0x0001a GICv2 0xffff00000916bfd8 LINEAR GICv2
+[...]
+ 96 0x81808 MSI 0x (null) RADIX MSI
+ 96+ 0x00063 GICv2m 0xffff8003ee116980 RADIX GICv2m
+ 96+ 0x00063 GICv2 0xffff00000916bfd8 LINEAR GICv2
+ 97 0x08800 MSI 0x (null) * RADIX MSI
+ 97+ 0x00064 GICv2m 0xffff8003ee116980 * RADIX GICv2m
+ 97+ 0x00064 GICv2 0xffff00000916bfd8 * LINEAR GICv2
+
+Here, interrupts 1-5 are only using a single domain, while 96 and 97
+are build out of a stack of three domain, each level performing a
+particular function.
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-05-22 20:37 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-12 11:55 [PATCH 0/4] irqdomain: Improve irq_domain_mapping facility Marc Zyngier
2017-05-12 11:55 ` [PATCH 1/4] irqdomain: Let irq_domain_mapping display hierarchical domains Marc Zyngier
2017-05-22 20:33 ` [tip:irq/core] " tip-bot for Marc Zyngier
2017-05-12 11:55 ` [PATCH 2/4] irqdomain: Let irq_domain_mapping display ACPI fwnode attributes Marc Zyngier
2017-05-22 20:34 ` [tip:irq/core] " tip-bot for Marc Zyngier
2017-05-12 11:55 ` [PATCH 3/4] genirq/msi: Populate the domain name if provided by the irqchip Marc Zyngier
2017-05-22 20:35 ` [tip:irq/core] " tip-bot for Marc Zyngier
2017-05-12 11:55 ` [PATCH 4/4] Documentation: Update IRQ-domain.txt to document irq_domain_mapping Marc Zyngier
2017-05-22 20:35 ` [tip:irq/core] " tip-bot for Marc Zyngier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox