Skip to contentSkip to conversation

blackfin: Final irq cleanup

PATCH In review Thomas Gleixner 2 participants 10 messages Mar 25, 2011 – Mar 30, 2011

lore
Share & tools
lore
#0 lore raw

cover blackfin: Final irq cleanup

Mike,

this is the final cleanup and name space conversion, so that we can remove the deprecated code in the core.

It would be nice to get this Linus wards for .39

Thanks,

tglx

#1 lore raw

PATCH 1/2 bfin: Final irq cleanup

Use the trigger type in irq_data and check level type instead of looking at desc->handle_irq.

---
 arch/blackfin/mach-bf561/smp.c            |    6 +++---
 arch/blackfin/mach-common/ints-priority.c |    9 +++------
 2 files changed, 6 insertions(+), 9 deletions(-)
arch/blackfin/mach-bf561/smp.c +3 -3
Index: linux-2.6-tip/arch/blackfin/mach-bf561/smp.c
===================================================================
@@ -154,13 +154,13 @@ void platform_clear_ipi(unsigned int cpu
 void __cpuinit bfin_local_timer_setup(void)
 {
 #if defined(CONFIG_TICKSOURCE_CORETMR)
-	struct irq_chip *chip = get_irq_chip(IRQ_CORETMR);
-	struct irq_desc *desc = irq_to_desc(IRQ_CORETMR);
+	struct irq_data *data = irq_get_irq_data(IRQ_CORETMR);
+	struct irq_chip *chip = irq_data_get_chip(data);
 
 	bfin_coretmr_init();
 	bfin_coretmr_clockevent_init();
 
-	chip->irq_unmask(&desc->irq_data);
+	chip->irq_unmask(data);
 #else
 	/* Power down the core timer, just to play safe. */
 	bfin_write_TCNTL(0);
arch/blackfin/mach-common/ints-priority.c +3 -6
Index: linux-2.6-tip/arch/blackfin/mach-common/ints-priority.c
===================================================================
@@ -578,10 +578,9 @@ static void bfin_gpio_ack_irq(struct irq
 static void bfin_gpio_mask_ack_irq(struct irq_data *d)
 {
 	unsigned int irq = d->irq;
-	struct irq_desc *desc = irq_to_desc(irq);
 	u32 gpionr = irq_to_gpio(irq);
 
-	if (desc->handle_irq == handle_edge_irq)
+	if (!irqd_is_level_type(d))
 		set_gpio_data(gpionr, 0);
 
 	set_gpio_maska(gpionr, 0);
@@ -837,12 +836,11 @@ void init_pint_lut(void)
 
 static void bfin_gpio_ack_irq(struct irq_data *d)
 {
-	struct irq_desc *desc = irq_to_desc(d->irq);
 	u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS];
 	u32 pintbit = PINT_BIT(pint_val);
 	u32 bank = PINT_2_BANK(pint_val);
 
-	if ((desc->status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
+	if (irqd_get_trigger_type(d) == IRQ_TYPE_EDGE_BOTH) {
 		if (pint[bank]->invert_set & pintbit)
 			pint[bank]->invert_clear = pintbit;
 		else
@@ -854,12 +852,11 @@ static void bfin_gpio_ack_irq(struct irq
 
 static void bfin_gpio_mask_ack_irq(struct irq_data *d)
 {
-	struct irq_desc *desc = irq_to_desc(d->irq);
 	u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS];
 	u32 pintbit = PINT_BIT(pint_val);
 	u32 bank = PINT_2_BANK(pint_val);
 
-	if ((desc->status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
+	if (irqd_get_trigger_type(d) == IRQ_TYPE_EDGE_BOTH) {
 		if (pint[bank]->invert_set & pintbit)
 			pint[bank]->invert_clear = pintbit;
 		else
#2 lore raw

PATCH 2/2 bfin: Convert irq namespace

In reply to Thomas Gleixner

Convert to the new function names. Scripted with coccinelle.

---
 arch/blackfin/kernel/irqchip.c            |    2 -
 arch/blackfin/mach-common/ints-priority.c |   34 +++++++++++++++---------------
 2 files changed, 18 insertions(+), 18 deletions(-)
arch/blackfin/kernel/irqchip.c +1 -1
Index: linux-2.6-tip/arch/blackfin/kernel/irqchip.c
===================================================================
@@ -48,7 +48,7 @@ int show_interrupts(struct seq_file *p, 
 		seq_printf(p, "%3d: ", i);
 		for_each_online_cpu(j)
 			seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
-		seq_printf(p, " %8s", get_irq_desc_chip(desc)->name);
+		seq_printf(p, " %8s", irq_desc_get_chip(desc)->name);
 		seq_printf(p, "  %s", action->name);
 		for (action = action->next; action; action = action->next)
 			seq_printf(p, "  %s", action->name);
arch/blackfin/mach-common/ints-priority.c +17 -17
Index: linux-2.6-tip/arch/blackfin/mach-common/ints-priority.c
===================================================================
@@ -559,7 +559,7 @@ static inline void bfin_set_irq_handler(
 #ifdef CONFIG_IPIPE
 	handle = handle_level_irq;
 #endif
-	__set_irq_handler_unlocked(irq, handle);
+	__irq_set_handler_locked(irq, handle);
 }
 
 static DECLARE_BITMAP(gpio_enabled, MAX_BLACKFIN_GPIOS);
@@ -1163,9 +1163,9 @@ int __init init_arch_irq(void)
 
 	for (irq = 0; irq <= SYS_IRQS; irq++) {
 		if (irq <= IRQ_CORETMR)
-			set_irq_chip(irq, &bfin_core_irqchip);
+			irq_set_chip(irq, &bfin_core_irqchip);
 		else
-			set_irq_chip(irq, &bfin_internal_irqchip);
+			irq_set_chip(irq, &bfin_internal_irqchip);
 
 		switch (irq) {
 #if defined(CONFIG_BF53x)
@@ -1189,50 +1189,50 @@ int __init init_arch_irq(void)
 #elif defined(CONFIG_BF538) || defined(CONFIG_BF539)
 		case IRQ_PORTF_INTA:
 #endif
-			set_irq_chained_handler(irq,
-						bfin_demux_gpio_irq);
+			irq_set_chained_handler(irq, bfin_demux_gpio_irq);
 			break;
 #ifdef BF537_GENERIC_ERROR_INT_DEMUX
 		case IRQ_GENERIC_ERROR:
-			set_irq_chained_handler(irq, bfin_demux_error_irq);
+			irq_set_chained_handler(irq, bfin_demux_error_irq);
 			break;
 #endif
 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
 		case IRQ_MAC_ERROR:
-			set_irq_chained_handler(irq, bfin_demux_mac_status_irq);
+			irq_set_chained_handler(irq,
+						bfin_demux_mac_status_irq);
 			break;
 #endif
 #ifdef CONFIG_SMP
 		case IRQ_SUPPLE_0:
 		case IRQ_SUPPLE_1:
-			set_irq_handler(irq, handle_percpu_irq);
+			irq_set_handler(irq, handle_percpu_irq);
 			break;
 #endif
 
 #ifdef CONFIG_TICKSOURCE_CORETMR
 		case IRQ_CORETMR:
 # ifdef CONFIG_SMP
-			set_irq_handler(irq, handle_percpu_irq);
+			irq_set_handler(irq, handle_percpu_irq);
 			break;
 # else
-			set_irq_handler(irq, handle_simple_irq);
+			irq_set_handler(irq, handle_simple_irq);
 			break;
 # endif
 #endif
 
 #ifdef CONFIG_TICKSOURCE_GPTMR0
 		case IRQ_TIMER0:
-			set_irq_handler(irq, handle_simple_irq);
+			irq_set_handler(irq, handle_simple_irq);
 			break;
 #endif
 
 #ifdef CONFIG_IPIPE
 		default:
-			set_irq_handler(irq, handle_level_irq);
+			irq_set_handler(irq, handle_level_irq);
 			break;
 #else /* !CONFIG_IPIPE */
 		default:
-			set_irq_handler(irq, handle_simple_irq);
+			irq_set_handler(irq, handle_simple_irq);
 			break;
 #endif /* !CONFIG_IPIPE */
 		}
@@ -1240,22 +1240,22 @@ int __init init_arch_irq(void)
 
 #ifdef BF537_GENERIC_ERROR_INT_DEMUX
 	for (irq = IRQ_PPI_ERROR; irq <= IRQ_UART1_ERROR; irq++)
-		set_irq_chip_and_handler(irq, &bfin_generic_error_irqchip,
+		irq_set_chip_and_handler(irq, &bfin_generic_error_irqchip,
 					 handle_level_irq);
 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
-	set_irq_chained_handler(IRQ_MAC_ERROR, bfin_demux_mac_status_irq);
+	irq_set_chained_handler(IRQ_MAC_ERROR, bfin_demux_mac_status_irq);
 #endif
 #endif
 
 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
 	for (irq = IRQ_MAC_PHYINT; irq <= IRQ_MAC_STMDONE; irq++)
-		set_irq_chip_and_handler(irq, &bfin_mac_status_irqchip,
+		irq_set_chip_and_handler(irq, &bfin_mac_status_irqchip,
 					 handle_level_irq);
 #endif
 	/* if configured as edge, then will be changed to do_edge_IRQ */
 	for (irq = GPIO_IRQ_BASE;
 		irq < (GPIO_IRQ_BASE + MAX_BLACKFIN_GPIOS); irq++)
-		set_irq_chip_and_handler(irq, &bfin_gpio_irqchip,
+		irq_set_chip_and_handler(irq, &bfin_gpio_irqchip,
 					 handle_level_irq);
 
 	bfin_write_IMASK(0);
#3 lore raw

Re: [patch 2/2] bfin: Convert irq namespace

Quoted 2 lines · Thomas Gleixner

-       __set_irq_handler_unlocked(irq, handle);
+       __irq_set_handler_locked(irq, handle);

looks like a typo in your patch ? should still be unlocked right ? -mike

#4 lore raw

Re: [patch 2/2] bfin: Convert irq namespace

Quoted 5 lines · Mike Frysinger
Quoted 2 lines · Thomas Gleixner

-       __set_irq_handler_unlocked(irq, handle);
+       __irq_set_handler_locked(irq, handle);

looks like a typo in your patch ?  should still be unlocked right ?

although that still doesnt fix the build failure for me ...

arch/blackfin/mach-common/ints-priority.c: In function ‘bfin_set_irq_handler’:
arch/blackfin/mach-common/ints-priority.c:562: error: implicit declaration of function ‘__irq_set_handler_unlocked’
make[1]: *** [arch/blackfin/mach-common/ints-priority.o] Error 1 -mike

#5 lore raw

Re: [patch 2/2] bfin: Convert irq namespace

Quoted 5 lines · Mike Frysinger
Quoted 4 lines · Mike Frysinger
Quoted 2 lines · Thomas Gleixner

-       __set_irq_handler_unlocked(irq, handle);
+       __irq_set_handler_locked(irq, handle);

Quoted 7 lines
Quoted 1 line

looks like a typo in your patch ?  should still be unlocked right ?

although that still doesnt fix the build failure for me ...

arch/blackfin/mach-common/ints-priority.c: In function ‘bfin_set_irq_handler’:
arch/blackfin/mach-common/ints-priority.c:562: error: implicit declaration of function ‘__irq_set_handler_unlocked’

Sorry the patch is correct, but it depends on a pending pull request. I hope that hits linus tree tonight.

git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git irq/urgent

Thanks,

tglx

#6 lore raw

Re: [uclinux-dist-devel] [patch 2/2] bfin: Convert irq namespace

Quoted 10 lines · Thomas Gleixner
Quoted 9 lines · Mike Frysinger
Quoted 5 lines · Mike Frysinger
Quoted 2 lines · Thomas Gleixner

-       __set_irq_handler_unlocked(irq, handle);
+       __irq_set_handler_locked(irq, handle);

looks like a typo in your patch ?  should still be unlocked right ?

although that still doesnt fix the build failure for me ...

Quoted 8 lines
Quoted 3 lines

arch/blackfin/mach-common/ints-priority.c: In function ‘bfin_set_irq_handler’:
arch/blackfin/mach-common/ints-priority.c:562: error: implicit declaration of function ‘__irq_set_handler_unlocked’

Sorry the patch is correct, but it depends on a pending pull request. I hope that hits linus tree tonight.

git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git irq/urgent

OK, i'll look at the patches tomorrow then ;)
-mike

#7 lore raw
In reply to Thomas Gleixner
Quoted 4 lines · Thomas Gleixner

this is the final cleanup and name space conversion, so that we can remove the deprecated code in the core.

It would be nice to get this Linus wards for .39

does this require some other patch ? a recent merge from another tree broke Blackfin, so i need to push out stuff to Linus again anyways. -mike

#8 lore raw
Quoted 8 lines · Mike Frysinger
Quoted 4 lines · Thomas Gleixner

this is the final cleanup and name space conversion, so that we can remove the deprecated code in the core.

It would be nice to get this Linus wards for .39

does this require some other patch ?  a recent merge from another tree broke Blackfin, so i need to push out stuff to Linus again anyways.

hmm, so i guess you just merged this through your own tree ? -mike

#9 lore raw
Quoted 11 lines · Mike Frysinger
Quoted 8 lines · Mike Frysinger
Quoted 4 lines · Thomas Gleixner

this is the final cleanup and name space conversion, so that we can remove the deprecated code in the core.

It would be nice to get this Linus wards for .39

does this require some other patch ?  a recent merge from another tree broke Blackfin, so i need to push out stuff to Linus again anyways.

hmm, so i guess you just merged this through your own tree ?

Yeah, we wanted to get rid of the core cruft, so we put all the pending stuff in.

Thanks,

tglx