mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 3/7] genirq/debugfs: Allow irq domain name to be overriden
Date: Tue, 24 Apr 2018 15:36:14 +0100	[thread overview]
Message-ID: <20180424143618.16073-4-marc.zyngier@arm.com> (raw)
In-Reply-To: <20180424143618.16073-1-marc.zyngier@arm.com>

As for irqchip, it would be useful for a domain to generate its
name dynamically, and thus control the name that gets used in
debugfs.

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

diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 48c7e86bb556..a912b1cc1715 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -119,6 +119,7 @@ struct irq_domain_ops {
 			 unsigned long *out_hwirq, unsigned int *out_type);
 #endif
 #ifdef CONFIG_GENERIC_IRQ_DEBUGFS
+	char *(*override_name)(struct irq_domain *d);
 	void (*debug_show)(struct seq_file *m, struct irq_domain *d,
 			   struct irq_data *irqd, int ind);
 #endif
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 5d9fc01b60a6..521065c8bace 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -220,6 +220,20 @@ struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size,
 	domain->revmap_direct_max_irq = direct_max;
 	irq_domain_check_hierarchy(domain);
 
+#ifdef CONFIG_GENERIC_IRQ_DEBUGFS
+	if (domain->ops->override_name) {
+		char *new_name;
+
+		new_name = domain->ops->override_name(domain);
+		if (new_name) {
+			if (domain->flags & IRQ_DOMAIN_NAME_ALLOCATED)
+				kfree(domain->name);
+			domain->name = new_name;
+			domain->flags |= IRQ_DOMAIN_NAME_ALLOCATED;
+		}
+	}
+#endif
+
 	mutex_lock(&irq_domain_mutex);
 	debugfs_add_domain_dir(domain);
 	list_add(&domain->link, &irq_domain_list);
-- 
2.14.2

  parent reply	other threads:[~2018-04-24 14:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-24 14:36 [PATCH 0/7] Partitioned percpu IRQ rework Marc Zyngier
2018-04-24 14:36 ` [PATCH 1/7] genirq/debugfs: Print percpu affinity for percpu_devid interrupts Marc Zyngier
2018-04-24 14:36 ` [PATCH 2/7] genirq/debugfs: Use irq_print_chip method if available Marc Zyngier
2018-04-24 14:36 ` Marc Zyngier [this message]
2018-04-24 14:36 ` [PATCH 4/7] irqchip/partition-percpu: Override domain name in debugfs Marc Zyngier
2018-04-24 14:36 ` [PATCH 5/7] irqchip/partition-percpu: Refactor backend method calling Marc Zyngier
2018-04-24 14:36 ` [PATCH 6/7] irqchip/partition-percpu: Allow chained_desc to be NULL Marc Zyngier
2018-04-24 14:36 ` [PATCH 7/7] irqchip/partition-percpu: Move allocation of chained interrupt to activate Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180424143618.16073-4-marc.zyngier@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®