linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@linaro.org>
To: linux-kernel@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linuxppc-dev@lists.ozlabs.org,
	Grant Likely <grant.likely@linaro.org>
Subject: [RFC 03/10] irqdomain: Add a name field
Date: Mon, 10 Jun 2013 01:49:15 +0100	[thread overview]
Message-ID: <1370825362-11145-4-git-send-email-grant.likely@linaro.org> (raw)
In-Reply-To: <1370825362-11145-1-git-send-email-grant.likely@linaro.org>

This patch adds a name field to the irq_domain structure to help mere
mortals understand the mappings between irq domains and virqs. It also
converts a number of places that have open-coded some kind of fudging
an irqdomain name to use the new field. This means a more consistent
display of names in irq domain log messages and debugfs output.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
---
 include/linux/irqdomain.h |  1 +
 kernel/irq/generic-chip.c |  1 +
 kernel/irq/irqdomain.c    | 19 ++++++-------------
 3 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 6f06241..e5e513c 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -89,6 +89,7 @@ struct irq_domain_chip_generic;
  */
 struct irq_domain {
 	struct list_head link;
+	const char *name;
 
 	/* type of reverse mapping_technique */
 	unsigned int revmap_type;
diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c
index 95575d8..ca98cc5 100644
--- a/kernel/irq/generic-chip.c
+++ b/kernel/irq/generic-chip.c
@@ -305,6 +305,7 @@ int irq_alloc_domain_generic_chips(struct irq_domain *d, int irqs_per_chip,
 		/* Calc pointer to the next generic chip */
 		tmp += sizeof(*gc) + num_ct * sizeof(struct irq_chip_type);
 	}
+	d->name = name;
 	return 0;
 }
 EXPORT_SYMBOL_GPL(irq_alloc_domain_generic_chips);
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 1ac8cf4..b1b5e67 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -410,12 +410,15 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base,
 				 */
 				if (ret != -EPERM) {
 					pr_info("%s didn't like hwirq-0x%lx to VIRQ%i mapping (rc=%d)\n",
-					       of_node_full_name(domain->of_node), hwirq, virq, ret);
+					       domain->name, hwirq, virq, ret);
 				}
 				irq_data->domain = NULL;
 				irq_data->hwirq = 0;
 				continue;
 			}
+			/* If not already assigned, give the domain the chip's name */
+			if (!domain->name && irq_data->chip)
+				domain->name = irq_data->chip->name;
 		}
 
 		switch (domain->revmap_type) {
@@ -708,8 +711,6 @@ static int virq_debug_show(struct seq_file *m, void *private)
 {
 	unsigned long flags;
 	struct irq_desc *desc;
-	const char *p;
-	static const char none[] = "none";
 	void *data;
 	int i;
 
@@ -731,20 +732,12 @@ static int virq_debug_show(struct seq_file *m, void *private)
 			seq_printf(m, "0x%05lx  ", desc->irq_data.hwirq);
 
 			chip = irq_desc_get_chip(desc);
-			if (chip && chip->name)
-				p = chip->name;
-			else
-				p = none;
-			seq_printf(m, "%-15s  ", p);
+			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);
 
-			if (desc->irq_data.domain)
-				p = of_node_full_name(desc->irq_data.domain->of_node);
-			else
-				p = none;
-			seq_printf(m, "%s\n", p);
+			seq_printf(m, "%s\n", desc->irq_data.domain->name);
 		}
 
 		raw_spin_unlock_irqrestore(&desc->lock, flags);
-- 
1.8.1.2


  parent reply	other threads:[~2013-06-10  0:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-10  0:49 [RFC 00/10] Refactor irqdomain Grant Likely
2013-06-10  0:49 ` [RFC 01/10] irqdomain: Relax failure path on setting up mappings Grant Likely
2013-06-10  0:49 ` [RFC 02/10] irqdomain: Replace LEGACY mapping with LINEAR Grant Likely
2013-06-10  0:49 ` Grant Likely [this message]
2013-06-10  0:49 ` [RFC 04/10] irqdomain: merge linear and tree reverse mappings Grant Likely
2013-06-10  0:49 ` [RFC 05/10] irqdomain: Eliminate revmap type Grant Likely
2013-06-10  0:49 ` [RFC 06/10] irqdomain: Clean up aftermath of irq_domain refactoring Grant Likely
2013-06-10  0:49 ` [RFC 07/10] irqdomain: Beef up debugfs output Grant Likely
2013-06-10  0:49 ` [RFC 08/10] irqdomain: Refactor irq_domain_associate_many() Grant Likely
2013-06-18  3:09   ` Mike Qiu
2013-06-18  8:54     ` Grant Likely
2013-06-10  0:49 ` [RFC 09/10] irqdomain: remove irq_domain_generate_simple() Grant Likely
2013-06-10  0:49 ` [RFC 10/10] irqchip: Make versatile fpga irq driver a generic chip Grant Likely
2013-06-10  7:40   ` Linus Walleij
2013-06-10 10:50     ` Grant Likely
2013-06-15 21:19       ` Linus Walleij
2013-06-15 21:22         ` Linus Walleij
2013-06-15 22:48           ` Grant Likely
2013-06-10  9:03   ` Russell King - ARM Linux
2013-06-10 10:33     ` Grant Likely

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=1370825362-11145-4-git-send-email-grant.likely@linaro.org \
    --to=grant.likely@linaro.org \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.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;
as well as URLs for NNTP newsgroup(s).