Skip to contentSkip to conversation

Add a new member 'name' to structure irq_host.

PATCH In review Zhang Wei 4 participants 10 messages Mar 16, 2007 – Mar 27, 2007 PowerPC

lore
Share & tools
lore

Zhang Wei

author
#0 lore raw

PATCH 1/4 Add a new member 'name' to structure irq_host.

This patch adds a new member 'name' for irq host's name to structure irq_host and modifies the definition of the function irq_alloc_host(). The assignment to the irq host's name is also added to irq_alloc_host().

---
 arch/powerpc/kernel/irq.c |    4 +++-
 include/asm-powerpc/irq.h |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
arch/powerpc/kernel/irq.c +3 -1
index 919fbf5..2cbf87f 100644
@@ -404,7 +404,8 @@ static struct irq_host *irq_default_host
 struct irq_host *irq_alloc_host(unsigned int revmap_type,
 				unsigned int revmap_arg,
 				struct irq_host_ops *ops,
-				irq_hw_number_t inval_irq)
+				irq_hw_number_t inval_irq,
+				const char *name)
 {
 	struct irq_host *host;
 	unsigned int size = sizeof(struct irq_host);
@@ -429,6 +430,7 @@ struct irq_host *irq_alloc_host(unsigned
 	host->revmap_type = revmap_type;
 	host->inval_irq = inval_irq;
 	host->ops = ops;
+	host->name = name;
 
 	spin_lock_irqsave(&irq_big_lock, flags);
 
include/asm-powerpc/irq.h +3 -1
index cf927c1..d8d77ef 100644
@@ -124,6 +124,7 @@ #define IRQ_HOST_MAP_TREE	3 /* radix tre
 	struct irq_host_ops	*ops;
 	void			*host_data;
 	irq_hw_number_t		inval_irq;
+	const char		*name;
 };
 
 /* The main irq map itself is an array of NR_IRQ entries containing the
@@ -162,7 +163,8 @@ static inline irq_hw_number_t virq_to_hw
 extern struct irq_host *irq_alloc_host(unsigned int revmap_type,
 				       unsigned int revmap_arg,
 				       struct irq_host_ops *ops,
-				       irq_hw_number_t inval_irq);
+				       irq_hw_number_t inval_irq,
+				       const char *name);
 
 
 /**
Signature · 1 line
1.4.0
author
#1 lore raw

PATCH 2/4 Add i8259 host name.

This patch adds i8259 irq controller host name by the i8259 of_node's full name.

---
 arch/powerpc/sysdev/i8259.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/powerpc/sysdev/i8259.c +2 -1
index ad87adc..e80c127 100644
@@ -278,7 +278,8 @@ void i8259_init(struct device_node *node
 	/* create a legacy host */
 	if (node)
 		i8259_node = of_node_get(node);
-	i8259_host = irq_alloc_host(IRQ_HOST_MAP_LEGACY, 0, &i8259_host_ops, 0);
+	i8259_host = irq_alloc_host(IRQ_HOST_MAP_LEGACY, 0, &i8259_host_ops, 0,
+			(node) ? i8259_node->full_name : NULL);
 	if (i8259_host == NULL) {
 		printk(KERN_ERR "i8259: failed to allocate irq host !\n");
 		return;
Signature · 1 line
1.4.0
author
#2 lore raw

PATCH 3/4 Add mpic host name.

This patch adds mpic controller host name by the mpic of_node's full_name.

---
 arch/powerpc/sysdev/mpic.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/powerpc/sysdev/mpic.c +2 -1
index bcfb900..4e1581e 100644
@@ -926,7 +926,8 @@ struct mpic * __init mpic_alloc(struct d
 
 	mpic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, isu_size,
 				       &mpic_host_ops,
-				       flags & MPIC_LARGE_VECTORS ? 2048 : 256);
+				       flags & MPIC_LARGE_VECTORS ? 2048 : 256,
+				       mpic->of_node->full_name);
 	if (mpic->irqhost == NULL) {
 		of_node_put(node);
 		return NULL;
Signature · 1 line
1.4.0
author
#3 lore raw

PATCH 4/4 Add irq debugfs and virq_mapping for getting the virq to irq host's hwirq mapping list.

This patch adds 'irq' directory into the root debugfs and virq_mapping for getting the virq to irq host's hwirq mapping list.

---
 arch/powerpc/kernel/Makefile      |    1 
 arch/powerpc/kernel/irq_debugfs.c |  135 +++++++++++++++++++++++++++++++++++++
 2 files changed, 136 insertions(+), 0 deletions(-)
arch/powerpc/kernel/Makefile +1 -0
index 8120d42..9c56acd 100644
@@ -14,6 +14,7 @@ obj-y				:= semaphore.o cputable.o ptrac
 				   irq.o align.o signal_32.o pmc.o vdso.o \
 				   init_task.o process.o systbl.o idle.o
 obj-y				+= vdso32/
+obj-$(CONFIG_DEBUG_FS)		+= irq_debugfs.o
 obj-$(CONFIG_PPC64)		+= setup_64.o binfmt_elf32.o sys_ppc32.o \
 				   signal_64.o ptrace32.o \
 				   paca.o cpu_setup_ppc970.o \
arch/powerpc/kernel/irq_debugfs.c new file +135 -0

135 lines not on this page · raw message

Signature · 1 line
1.4.0
#4 lore raw

Re: [PATCH 4/4] Add irq debugfs and virq_mapping for getting the virq to irq host's hwirq mapping list.

Quoted 2 lines · Zhang Wei

This patch adds 'irq' directory into the root debugfs and virq_mapping for getting the virq to irq host's hwirq mapping list.

Minor nit. Should we be creating a 'powerpc' directory first, and putting the 'irq' file under that? Otherwise we risk clashing with some generic code that creates a file called 'irq' in debugfs.

cheers

Signature · 8 lines
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
#5 lore raw

RE: [PATCH 4/4] Add irq debugfs and virq_mapping for getting thevirq to irq host's hwirq mapping list.

Quoted 9 lines

=20
Minor nit. Should we be creating a 'powerpc' directory first, and putting the 'irq' file under that? Otherwise we risk clashing=20 with some
generic code that creates a file called 'irq' in debugfs. =20
cheers
=20

Hi, Michael,

I've seen some codes in arch/powerpc/kernel/prom.c to create debugfs dir = "powerpc". But those codes were enabled by a local macro 'DEBUG'. There = is a little problem. Maybe I should change '#ifdef DEBUG' to '#ifdef = CONFIG_DEBUG_FS' before the export_flat_device_tree() function in = arch/powerpc/kernel/prom.c. How about it?

Thanks!

Best Regards
Zhang Wei

#6 lore raw

RE: [PATCH 4/4] Add irq debugfs and virq_mapping for getting thevirq to irq host's hwirq mapping list.

Quoted 8 lines · On Tue, 2007-03-20 at 17:51 +0800, Zhang Wei-r63237 wrote:
Quoted 8 lines

Minor nit. Should we be creating a 'powerpc' directory first, and putting the 'irq' file under that? Otherwise we risk clashing with some
generic code that creates a file called 'irq' in debugfs.

cheers

Quoted 7 lines

Hi, Michael,

I've seen some codes in arch/powerpc/kernel/prom.c to create debugfs dir "powerpc". But those codes were enabled by a local macro 'DEBUG'. There is a little problem. Maybe I should change '#ifdef DEBUG' to '#ifdef CONFIG_DEBUG_FS' before the export_flat_device_tree() function in arch/powerpc/kernel/prom.c. How about it?

No, we don't want to always export the flat device tree.

Instead I think you should add a function in arch/powerpc/kernel/setup-common.c which creates the powerpc directory if CONFIG_DEBUG_FS is enabled, make it an arch_initcall. Then the flat device tree code can use that directory, and so can your irq stuff.

cheers

Signature · 8 lines
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
#7 lore raw

Re: [PATCH 4/4] Add irq debugfs and virq_mapping for getting the virq to irq host's hwirq mapping list.

In reply to Michael Ellerman
Quoted 6 lines
Quoted 2 lines

This patch adds 'irq' directory into the root debugfs and virq_mapping for getting the virq to irq host's hwirq mapping list.

Minor nit. Should we be creating a 'powerpc' directory first, and putting the 'irq' file under that? Otherwise we risk clashing with some generic code that creates a file called 'irq' in debugfs.

Or put the whole IRQ tree under sysfs generically...

Segher

#8 lore raw

Re: [PATCH 4/4] Add irq debugfs and virq_mapping for getting the virq to irq host's hwirq mapping list.

Quoted 9 lines · Segher Boessenkool
Quoted 7 lines
Quoted 3 lines

This patch adds 'irq' directory into the root debugfs and virq_mapping for getting the virq to
irq host's hwirq mapping list.

Minor nit. Should we be creating a 'powerpc' directory first, and putting the 'irq' file under that? Otherwise we risk clashing with some generic code that creates a file called 'irq' in debugfs.

Or put the whole IRQ tree under sysfs generically...

Except that there is no such thing as an IRQ tree in the generic code...

Ben.

#9 lore raw

Re: [PATCH 4/4] Add irq debugfs and virq_mapping for getting the virq to irq host's hwirq mapping list.

Quoted 3 lines
Quoted 1 line

Or put the whole IRQ tree under sysfs generically...

Except that there is no such thing as an IRQ tree in the generic code...

Darn, I thought the whole cascading thing was done in generic code now. Oh well...

Segher