Skip to contentSkip to conversation

tile: Cleanup irq chips and irq_desc accessors

PATCH In review Thomas Gleixner 2 participants 7 messages Feb 6, 2011 – Feb 23, 2011

lore
Share & tools
lore
#0 lore raw

cover tile: Cleanup irq chips and irq_desc accessors

Convert the irq chips to the new callback functions and use proper accessors for irq_desc. Select GENERIC_HARDIRQS_NO_DEPRECATED

Thanks,

tglx

#1 lore raw

PATCH 1/3 tile: Convert irq_chip to new functions

---
 arch/tile/kernel/irq.c |   28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)
arch/tile/kernel/irq.c +14 -14
Index: linux-next/arch/tile/kernel/irq.c
===================================================================
@@ -176,43 +176,43 @@ void disable_percpu_irq(unsigned int irq
 EXPORT_SYMBOL(disable_percpu_irq);
 
 /* Mask an interrupt. */
-static void tile_irq_chip_mask(unsigned int irq)
+static void tile_irq_chip_mask(struct irq_data *d)
 {
-	mask_irqs(1UL << irq);
+	mask_irqs(1UL << d->irq);
 }
 
 /* Unmask an interrupt. */
-static void tile_irq_chip_unmask(unsigned int irq)
+static void tile_irq_chip_unmask(struct irq_data *d)
 {
-	unmask_irqs(1UL << irq);
+	unmask_irqs(1UL << d->irq);
 }
 
 /*
  * Clear an interrupt before processing it so that any new assertions
  * will trigger another irq.
  */
-static void tile_irq_chip_ack(unsigned int irq)
+static void tile_irq_chip_ack(struct irq_data *d)
 {
-	if ((unsigned long)get_irq_chip_data(irq) != IS_HW_CLEARED)
-		clear_irqs(1UL << irq);
+	if ((unsigned long)irq_data_get_irq_chip_data(d) != IS_HW_CLEARED)
+		clear_irqs(1UL << d->irq);
 }
 
 /*
  * For per-cpu interrupts, we need to avoid unmasking any interrupts
  * that we disabled via disable_percpu_irq().
  */
-static void tile_irq_chip_eoi(unsigned int irq)
+static void tile_irq_chip_eoi(struct irq_data *d)
 {
-	if (!(__get_cpu_var(irq_disable_mask) & (1UL << irq)))
-		unmask_irqs(1UL << irq);
+	if (!(__get_cpu_var(irq_disable_mask) & (1UL << d->irq)))
+		unmask_irqs(1UL << d->irq);
 }
 
 static struct irq_chip tile_irq_chip = {
 	.name = "tile_irq_chip",
-	.ack = tile_irq_chip_ack,
-	.eoi = tile_irq_chip_eoi,
-	.mask = tile_irq_chip_mask,
-	.unmask = tile_irq_chip_unmask,
+	.irq_ack = tile_irq_chip_ack,
+	.irq_eoi = tile_irq_chip_eoi,
+	.irq_mask = tile_irq_chip_mask,
+	.irq_unmask = tile_irq_chip_unmask,
 };
 
 void __init init_IRQ(void)
#2 lore raw

PATCH 2/3 tile: Use proper accessor functions in show_interrupt()

In reply to Thomas Gleixner
---
 arch/tile/kernel/irq.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
arch/tile/kernel/irq.c +6 -4
Index: linux-next/arch/tile/kernel/irq.c
===================================================================
@@ -277,8 +277,10 @@ int show_interrupts(struct seq_file *p, 
 	}
 
 	if (i < NR_IRQS) {
-		raw_spin_lock_irqsave(&irq_desc[i].lock, flags);
-		action = irq_desc[i].action;
+		struct irq_desc *desc = irq_to_desc(i);
+
+		raw_spin_lock_irqsave(&desc->lock, flags);
+		action = desc->action;
 		if (!action)
 			goto skip;
 		seq_printf(p, "%3d: ", i);
@@ -288,7 +290,7 @@ int show_interrupts(struct seq_file *p, 
 		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", get_irq_desc_chip(desc)->name);
 		seq_printf(p, "  %s", action->name);
 
 		for (action = action->next; action; action = action->next)
@@ -296,7 +298,7 @@ int show_interrupts(struct seq_file *p, 
 
 		seq_putc(p, '\n');
 skip:
-		raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags);
+		raw_spin_unlock_irqrestore(&desc->lock, flags);
 	}
 	return 0;
 }
#3 lore raw

PATCH 3/3 tile: Select GENERIC_HARDIRQS_NO_DEPRECATED

In reply to Thomas Gleixner

irq chip converted and proper accessor functions used.

---
 arch/tile/Kconfig |    1 +
 1 file changed, 1 insertion(+)
arch/tile/Kconfig +1 -0
Index: linux-next/arch/tile/Kconfig
===================================================================
@@ -11,6 +11,7 @@ config TILE
 	select HAVE_GENERIC_HARDIRQS
 	select GENERIC_IRQ_PROBE
 	select GENERIC_PENDING_IRQ if SMP
+	select GENERIC_HARDIRQS_NO_DEPRECATED
 
 # FIXME: investigate whether we need/want these options.
 #	select HAVE_IOREMAP_PROT
Acked-by on the v1 series
#4 lore raw
In reply to Thomas Gleixner
Quoted 2 lines · Thomas Gleixner

Convert the irq chips to the new callback functions and use proper accessors for irq_desc. Select GENERIC_HARDIRQS_NO_DEPRECATED

For the series:

Sorry for the late response, but your email came while I was still trying to catch up with my email from a week's vacation, and I'm just re-triaging my inbox now :-)

Signature · 2 lines
Chris Metcalf, Tilera Corp.
http://www.tilera.com
#5 lore raw
Quoted 11 lines · Chris Metcalf
Quoted 2 lines · Thomas Gleixner

Convert the irq chips to the new callback functions and use proper accessors for irq_desc. Select GENERIC_HARDIRQS_NO_DEPRECATED

For the series:

Sorry for the late response, but your email came while I was still trying to catch up with my email from a week's vacation, and I'm just re-triaging my inbox now :-)

No problem. Can you takes this via your tree for .39 ? It does not depend on any changes in the core code.

Thanks,

tglx

#6 lore raw
Quoted 7 lines · Thomas Gleixner
Quoted 5 lines · Chris Metcalf
Quoted 2 lines · Thomas Gleixner

Convert the irq chips to the new callback functions and use proper accessors for irq_desc. Select GENERIC_HARDIRQS_NO_DEPRECATED

For the series:

Quoted 7 lines
Quoted 5 lines

Sorry for the late response, but your email came while I was still trying to catch up with my email from a week's vacation, and I'm just re-triaging my inbox now :-)

No problem. Can you takes this via your tree for .39 ? It does not depend on any changes in the core code.

Sure. Done.

Signature · 2 lines
Chris Metcalf, Tilera Corp.
http://www.tilera.com