* [PATCH 0/2] irqdomain debufs fixes for 4.20
@ 2018-10-01 10:05 Marc Zyngier
2018-10-01 10:05 ` [PATCH 1/2] genirq/debugfs: Reset domain debugfs_file on removal of the debugfs file Marc Zyngier
2018-10-01 10:05 ` [PATCH 2/2] genirq/debugfs: Reinstate full OF path for domain name Marc Zyngier
0 siblings, 2 replies; 5+ messages in thread
From: Marc Zyngier @ 2018-10-01 10:05 UTC (permalink / raw)
To: linux-kernel; +Cc: Thomas Gleixner
Here's a couple of fixes for the irqdomain debugfs feature that I
wrote while working on some unrelated irqchip over the weekend.
If nobody screams, I'll queue them for 4.20.
Thanks,
M.
Marc Zyngier (2):
genirq/debugfs: Reset domain debugfs_file on removal of the debugfs
file
genirq/debugfs: Reinstate full OF path for domain name
kernel/irq/irqdomain.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--
2.19.0
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 1/2] genirq/debugfs: Reset domain debugfs_file on removal of the debugfs file 2018-10-01 10:05 [PATCH 0/2] irqdomain debufs fixes for 4.20 Marc Zyngier @ 2018-10-01 10:05 ` Marc Zyngier 2018-10-01 10:27 ` [tip:irq/core] " tip-bot for Marc Zyngier 2018-10-01 10:05 ` [PATCH 2/2] genirq/debugfs: Reinstate full OF path for domain name Marc Zyngier 1 sibling, 1 reply; 5+ messages in thread From: Marc Zyngier @ 2018-10-01 10:05 UTC (permalink / raw) To: linux-kernel; +Cc: Thomas Gleixner When removing a debugfs file for a given irq domain, we fail to clear the corresponding field, meaning that the corresponding domain won't be created again if we need to do so. It turns out that this is exactly what irq_domain_update_bus_token does (delete old file, update domain name, recreate file). This doesn't have any impact other than making debug more difficult, but we do value ease of debugging... So let's clear the debugfs_file field. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> --- kernel/irq/irqdomain.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 5d9fc01b60a6..95a0acbdd4e6 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -1741,6 +1741,7 @@ static void debugfs_add_domain_dir(struct irq_domain *d) static void debugfs_remove_domain_dir(struct irq_domain *d) { debugfs_remove(d->debugfs_file); + d->debugfs_file = NULL; } void __init irq_domain_debugfs_init(struct dentry *root) -- 2.19.0 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [tip:irq/core] genirq/debugfs: Reset domain debugfs_file on removal of the debugfs file 2018-10-01 10:05 ` [PATCH 1/2] genirq/debugfs: Reset domain debugfs_file on removal of the debugfs file Marc Zyngier @ 2018-10-01 10:27 ` tip-bot for Marc Zyngier 0 siblings, 0 replies; 5+ messages in thread From: tip-bot for Marc Zyngier @ 2018-10-01 10:27 UTC (permalink / raw) To: linux-tip-commits; +Cc: marc.zyngier, tglx, mingo, linux-kernel, hpa Commit-ID: 513145ea66af95f1a5c744d7b5a4f4a97625e669 Gitweb: https://git.kernel.org/tip/513145ea66af95f1a5c744d7b5a4f4a97625e669 Author: Marc Zyngier <marc.zyngier@arm.com> AuthorDate: Mon, 1 Oct 2018 11:05:21 +0100 Committer: Thomas Gleixner <tglx@linutronix.de> CommitDate: Mon, 1 Oct 2018 12:24:53 +0200 genirq/debugfs: Reset domain debugfs_file on removal of the debugfs file When removing a debugfs file for a given irq domain, we fail to clear the corresponding field, meaning that the corresponding domain won't be created again if we need to do so. It turns out that this is exactly what irq_domain_update_bus_token does (delete old file, update domain name, recreate file). This doesn't have any impact other than making debug more difficult, but we do value ease of debugging... So clear the debugfs_file field. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20181001100522.180054-2-marc.zyngier@arm.com --- kernel/irq/irqdomain.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 5d9fc01b60a6..95a0acbdd4e6 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -1741,6 +1741,7 @@ static void debugfs_add_domain_dir(struct irq_domain *d) static void debugfs_remove_domain_dir(struct irq_domain *d) { debugfs_remove(d->debugfs_file); + d->debugfs_file = NULL; } void __init irq_domain_debugfs_init(struct dentry *root) ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] genirq/debugfs: Reinstate full OF path for domain name 2018-10-01 10:05 [PATCH 0/2] irqdomain debufs fixes for 4.20 Marc Zyngier 2018-10-01 10:05 ` [PATCH 1/2] genirq/debugfs: Reset domain debugfs_file on removal of the debugfs file Marc Zyngier @ 2018-10-01 10:05 ` Marc Zyngier 2018-10-01 10:28 ` [tip:irq/core] " tip-bot for Marc Zyngier 1 sibling, 1 reply; 5+ messages in thread From: Marc Zyngier @ 2018-10-01 10:05 UTC (permalink / raw) To: linux-kernel; +Cc: Thomas Gleixner On a DT based system, we use the of_node full name to name the corresponding irq domain. We expect that name to be unique, so so that domains with the same base name won't clash (this happens on multi-node topologies, for example). Since a7e4cfb0a7ca ("of/fdt: only store the device node basename in full_name"), of_node_full_name() lies and only returns the basename. This breaks the above requirement, and we end-up with only a subset of the domains in /sys/kernel/debug/irq/domains. Let's reinstate the feature by using the fancy new %pOF format specifier, which happens to do the right thing. Fixes: a7e4cfb0a7ca ("of/fdt: only store the device node basename in full_name") Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> --- kernel/irq/irqdomain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 95a0acbdd4e6..3b30a4aeb0db 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -183,7 +183,7 @@ struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size, * unhappy about. Replace them with ':', which does * the trick and is not as offensive as '\'... */ - name = kstrdup(of_node_full_name(of_node), GFP_KERNEL); + name = kasprintf(GFP_KERNEL, "%pOF", of_node); if (!name) { kfree(domain); return NULL; -- 2.19.0 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [tip:irq/core] genirq/debugfs: Reinstate full OF path for domain name 2018-10-01 10:05 ` [PATCH 2/2] genirq/debugfs: Reinstate full OF path for domain name Marc Zyngier @ 2018-10-01 10:28 ` tip-bot for Marc Zyngier 0 siblings, 0 replies; 5+ messages in thread From: tip-bot for Marc Zyngier @ 2018-10-01 10:28 UTC (permalink / raw) To: linux-tip-commits; +Cc: hpa, marc.zyngier, mingo, linux-kernel, tglx Commit-ID: 94967b55ebf3b603f2fe750ecedd896042585a1c Gitweb: https://git.kernel.org/tip/94967b55ebf3b603f2fe750ecedd896042585a1c Author: Marc Zyngier <marc.zyngier@arm.com> AuthorDate: Mon, 1 Oct 2018 11:05:22 +0100 Committer: Thomas Gleixner <tglx@linutronix.de> CommitDate: Mon, 1 Oct 2018 12:24:53 +0200 genirq/debugfs: Reinstate full OF path for domain name On a DT based system, we use the of_node full name to name the corresponding irq domain. We expect that name to be unique, so so that domains with the same base name won't clash (this happens on multi-node topologies, for example). Since a7e4cfb0a7ca ("of/fdt: only store the device node basename in full_name"), of_node_full_name() lies and only returns the basename. This breaks the above requirement, and we end-up with only a subset of the domains in /sys/kernel/debug/irq/domains. Let's reinstate the feature by using the fancy new %pOF format specifier, which happens to do the right thing. Fixes: a7e4cfb0a7ca ("of/fdt: only store the device node basename in full_name") Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20181001100522.180054-3-marc.zyngier@arm.com --- kernel/irq/irqdomain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 95a0acbdd4e6..3b30a4aeb0db 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -183,7 +183,7 @@ struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size, * unhappy about. Replace them with ':', which does * the trick and is not as offensive as '\'... */ - name = kstrdup(of_node_full_name(of_node), GFP_KERNEL); + name = kasprintf(GFP_KERNEL, "%pOF", of_node); if (!name) { kfree(domain); return NULL; ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-10-01 10:28 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-10-01 10:05 [PATCH 0/2] irqdomain debufs fixes for 4.20 Marc Zyngier 2018-10-01 10:05 ` [PATCH 1/2] genirq/debugfs: Reset domain debugfs_file on removal of the debugfs file Marc Zyngier 2018-10-01 10:27 ` [tip:irq/core] " tip-bot for Marc Zyngier 2018-10-01 10:05 ` [PATCH 2/2] genirq/debugfs: Reinstate full OF path for domain name Marc Zyngier 2018-10-01 10:28 ` [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
all inboxes | Powered by JetHome®