Skip to contentSkip to conversation

Alchemy: use new irq methods

PATCH RESEND New Manuel Lauss 1 participant 3 messages Feb 11, 2011 MIPS

lore
Share & tools
lore
#1 lore raw

PATCH RESEND 1/2 MIPS: Convert to new irq methods.

In reply to Manuel Lauss

Convert the core MIPS irq code to use the new .irq_xxx methods.

---
Tested on DB1200 with C0 timer. The MIPS-MT bits are untested since I don't have capable hardware.

 arch/mips/kernel/irq.c     |   12 ++++++++++--
 arch/mips/kernel/irq_cpu.c |   42 +++++++++++++++++++++---------------------
 2 files changed, 31 insertions(+), 23 deletions(-)
arch/mips/kernel/irq.c +10 -2
index 4f93db5..b8112cf 100644
@@ -89,6 +89,9 @@ int show_interrupts(struct seq_file *p, void *v)
 {
 	int i = *(loff_t *) v, j;
 	struct irqaction * action;
+	struct irq_desc *desc;
+	struct irq_data *data;
+	struct irq_chip *chip;
 	unsigned long flags;
 
 	if (i == 0) {
@@ -100,9 +103,14 @@ int show_interrupts(struct seq_file *p, void *v)
 
 	if (i < NR_IRQS) {
 		raw_spin_lock_irqsave(&irq_desc[i].lock, flags);
-		action = irq_desc[i].action;
+		desc = irq_to_desc(i);
+		if (!desc)
+			goto skip;
+		action = desc->action;
 		if (!action)
 			goto skip;
+		data = irq_get_irq_data(i);
+		chip = irq_data_get_irq_chip(data);
 		seq_printf(p, "%3d: ", i);
 #ifndef CONFIG_SMP
 		seq_printf(p, "%10u ", kstat_irqs(i));
@@ -110,7 +118,7 @@ int show_interrupts(struct seq_file *p, void *v)
 		for_each_online_cpu(j)
 			seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
 #endif
-		seq_printf(p, " %14s", irq_desc[i].chip->name);
+		seq_printf(p, " %14s", chip->name);
 		seq_printf(p, "  %s", action->name);
 
 		for (action=action->next; action; action = action->next)
arch/mips/kernel/irq_cpu.c +21 -21

81 lines not on this page · raw message

Signature · 1 line
1.7.4
#0 lore raw

cover Alchemy: use new irq methods

[Resending without the umlaut in Ralf's surname]

These 2 patches change the core MIPS and Alchmey irq code to use the new .irq_xxx methods.

The first patch is a prerequisite to turn on GENERIC_HARDIRQS_NO_DEPRECATED. I have tested it with the C0 timer and it seems to run well, however the MIPS-MT bits I cannot test. Someone with capable hardware please test! Thank you!

The second patch changes the core alchemy and DB1200 board irq functions over to the new .irq_xxx ones.

Run-tested on the DB1200.

Manuel Lauss (2):
MIPS: Convert to new irq methods.
Alchemy: Convert to new irq methods.

 arch/mips/Kconfig                  |    1 +
 arch/mips/alchemy/common/irq.c     |   83 +++++++++++++++++++-----------------
 arch/mips/alchemy/devboards/bcsr.c |   18 ++++----
 arch/mips/kernel/irq.c             |   12 ++++-
 arch/mips/kernel/irq_cpu.c         |   42 +++++++++---------
 5 files changed, 85 insertions(+), 71 deletions(-)
Signature · 1 line
1.7.4
#2 lore raw

PATCH RESEND 2/2 Alchemy: Convert to new irq methods.

Convert Alchemy core and board code to use new .irq_xxx methods.

---
Run-tested on DB1200.

 arch/mips/Kconfig                  |    1 +
 arch/mips/alchemy/common/irq.c     |   83 +++++++++++++++++++-----------------
 arch/mips/alchemy/devboards/bcsr.c |   18 ++++----
 3 files changed, 54 insertions(+), 48 deletions(-)
arch/mips/Kconfig +1 -0
index f5ecc05..401fc8f 100644
@@ -44,6 +44,7 @@ config MIPS_ALCHEMY
 	select GENERIC_GPIO
 	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select SYS_SUPPORTS_ZBOOT
+	select GENERIC_HARDIRQS_NO_DEPRECATED
 
 config AR7
 	bool "Texas Instruments AR7"
arch/mips/alchemy/common/irq.c +44 -39

194 lines not on this page · raw message

arch/mips/alchemy/devboards/bcsr.c +9 -9
index c52af88..f91c43a 100644
@@ -97,26 +97,26 @@ static void bcsr_csc_handler(unsigned int irq, struct irq_desc *d)
  * CPLD generates tons of spurious interrupts (at least on my DB1200).
  *	-- mlau
  */
-static void bcsr_irq_mask(unsigned int irq_nr)
+static void bcsr_irq_mask(struct irq_data *d)
 {
-	unsigned short v = 1 << (irq_nr - bcsr_csc_base);
+	unsigned short v = 1 << (d->irq - bcsr_csc_base);
 	__raw_writew(v, bcsr_virt + BCSR_REG_INTCLR);
 	__raw_writew(v, bcsr_virt + BCSR_REG_MASKCLR);
 	wmb();
 }
 
-static void bcsr_irq_maskack(unsigned int irq_nr)
+static void bcsr_irq_maskack(struct irq_data *d)
 {
-	unsigned short v = 1 << (irq_nr - bcsr_csc_base);
+	unsigned short v = 1 << (d->irq - bcsr_csc_base);
 	__raw_writew(v, bcsr_virt + BCSR_REG_INTCLR);
 	__raw_writew(v, bcsr_virt + BCSR_REG_MASKCLR);
 	__raw_writew(v, bcsr_virt + BCSR_REG_INTSTAT);	/* ack */
 	wmb();
 }
 
-static void bcsr_irq_unmask(unsigned int irq_nr)
+static void bcsr_irq_unmask(struct irq_data *d)
 {
-	unsigned short v = 1 << (irq_nr - bcsr_csc_base);
+	unsigned short v = 1 << (d->irq - bcsr_csc_base);
 	__raw_writew(v, bcsr_virt + BCSR_REG_INTSET);
 	__raw_writew(v, bcsr_virt + BCSR_REG_MASKSET);
 	wmb();
@@ -124,9 +124,9 @@ static void bcsr_irq_unmask(unsigned int irq_nr)
 
 static struct irq_chip bcsr_irq_type = {
 	.name		= "CPLD",
-	.mask		= bcsr_irq_mask,
-	.mask_ack	= bcsr_irq_maskack,
-	.unmask		= bcsr_irq_unmask,
+	.irq_mask	= bcsr_irq_mask,
+	.irq_mask_ack	= bcsr_irq_maskack,
+	.irq_unmask	= bcsr_irq_unmask,
 };
 
 void __init bcsr_init_irq(int csc_start, int csc_end, int hook_irq)
Signature · 1 line
1.7.4