irqdomain debufs fixes for 4.20
Subsystems (2)
cover irqdomain debufs fixes for 4.20
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(-)
Signature · 1 line
2.19.0
PATCH 1/2 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 let's clear the debugfs_file field.
--- kernel/irq/irqdomain.c | 1 + 1 file changed, 1 insertion(+)
kernel/irq/irqdomain.c +1 -0
@@ -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)
Signature · 1 line
2.19.0
tip-bot for Marc Zyngier
merge bot[tip:irq/core] genirq/debugfs: Reset domain debugfs_file on removal of the debugfs file
genirq/debugfs: Reset domain debugfs_file on removal of the debugfs file
Commit-ID: 513145ea66af95f1a5c744d7b5a4f4a97625e669 Gitweb: https://git.kernel.org/tip/513145ea66af95f1a5c744d7b5a4f4a97625e669 Author: Marc Zyngier <[email protected]> AuthorDate: Mon, 1 Oct 2018 11:05:21 +0100 Committer: Thomas Gleixner <[email protected]> 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.
--- kernel/irq/irqdomain.c | 1 + 1 file changed, 1 insertion(+)
kernel/irq/irqdomain.c +1 -0
@@ -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)
PATCH 2/2 genirq/debugfs: Reinstate full OF path for domain name
In reply to Marc ZyngierOn 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.
--- kernel/irq/irqdomain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/irqdomain.c +1 -1
@@ -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 ;
Signature · 1 line
2.19.0
tip-bot for Marc Zyngier
merge bot[tip:irq/core] genirq/debugfs: Reinstate full OF path for domain name
genirq/debugfs: Reinstate full OF path for domain name
Commit-ID: 94967b55ebf3b603f2fe750ecedd896042585a1c Gitweb: https://git.kernel.org/tip/94967b55ebf3b603f2fe750ecedd896042585a1c Author: Marc Zyngier <[email protected]> AuthorDate: Mon, 1 Oct 2018 11:05:22 +0100 Committer: Thomas Gleixner <[email protected]> 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.
--- kernel/irq/irqdomain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/irqdomain.c +1 -1
@@ -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 ;