Skip to contentSkip to conversation

avr32: Interrupt cleanups and API change preparation

PATCH In review Thomas Gleixner 3 participants 9 messages Jul 13, 2015 – Jul 27, 2015

lore
Share & tools
lore
#0 lore raw

cover avr32: Interrupt cleanups and API change preparation

The following patch series contains the following changes:

- Consolidation of chained interrupt handler setup/removal

- Switch to functions which avoid a redundant interrupt descriptor lookup

- Preparation of interrupt flow handlers for the 'irq' argument removal

The series has no dependencies and is also available as a git branch for your convenience:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/avr32

If you want me to carry the patches in the irq/core branch of tip, please let me know.

Thanks,

tglx

#1 lore raw

PATCH 1/3 avr32/at32ap: Consolidate chained IRQ handler install/remove

Chained irq handlers usually set up handler data as well. We now have a function to set both under irq_desc->lock. Replace the two calls with one.

Search and conversion was done with coccinelle.

Cc Julia Lawall <[email protected]>
Cc Haavard Skinnemoen <[email protected]>
Cc Hans-Christian Egtvedt <[email protected]>
---
 arch/avr32/mach-at32ap/pio.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/avr32/mach-at32ap/pio.c +2 -2
Index: tip/arch/avr32/mach-at32ap/pio.c
===================================================================
@@ -312,7 +312,6 @@ gpio_irq_setup(struct pio_device *pio, i
 	unsigned	i;
 
 	irq_set_chip_data(irq, pio);
-	irq_set_handler_data(irq, (void *)gpio_irq);
 
 	for (i = 0; i < 32; i++, gpio_irq++) {
 		irq_set_chip_data(gpio_irq, pio);
@@ -320,7 +319,8 @@ gpio_irq_setup(struct pio_device *pio, i
 					 handle_simple_irq);
 	}
 
-	irq_set_chained_handler(irq, gpio_irq_handler);
+	irq_set_chained_handler_and_data(irq, gpio_irq_handler,
+					 (void *)gpio_irq);
 }
 
 /*--------------------------------------------------------------------------*/
Acked-by on v1 1/3
#2 lore raw

Re: [patch 1/3] avr32/at32ap: Consolidate chained IRQ handler install/remove

Quoted 11 lines · Thomas Gleixner

Chained irq handlers usually set up handler data as well. We now have a function to set both under irq_desc->lock. Replace the two calls with one.

Search and conversion was done with coccinelle.

Cc Julia Lawall <[email protected]>
Cc Haavard Skinnemoen <[email protected]>
Cc Hans-Christian Egtvedt <[email protected]>
Quoted 26 lines
---
 arch/avr32/mach-at32ap/pio.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: tip/arch/avr32/mach-at32ap/pio.c
===================================================================

arch/avr32/mach-at32ap/pio.c +2 -2
@@ -312,7 +312,6 @@ gpio_irq_setup(struct pio_device *pio, i
 	unsigned	i;
 
 	irq_set_chip_data(irq, pio);
-	irq_set_handler_data(irq, (void *)gpio_irq);
 
 	for (i = 0; i < 32; i++, gpio_irq++) {
 		irq_set_chip_data(gpio_irq, pio);
@@ -320,7 +319,8 @@ gpio_irq_setup(struct pio_device *pio, i
 					 handle_simple_irq);
 	}
 
-	irq_set_chained_handler(irq, gpio_irq_handler);
+	irq_set_chained_handler_and_data(irq, gpio_irq_handler,
+					 (void *)gpio_irq);
 }
 
 /*--------------------------------------------------------------------------*/
Signature · 2 lines
mvh
Hans-Christian Egtvedt
#3 lore raw

[tip:irq/core] avr32/at32ap: Consolidate chained IRQ handler install/remove

In reply to Thomas Gleixner
avr32/at32ap: Consolidate chained IRQ handler install/remove
Commit-ID:  4365160def95ef2f5da9b5cc5660e5747e5e1956
Gitweb:     http://git.kernel.org/tip/4365160def95ef2f5da9b5cc5660e5747e5e1956
Author:     Thomas Gleixner <[email protected]>
AuthorDate: Mon, 13 Jul 2015 20:31:09 +0000
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Sun, 26 Jul 2015 11:47:25 +0200

avr32/at32ap: Consolidate chained IRQ handler install/remove

Chained irq handlers usually set up handler data as well. We now have a function to set both under irq_desc->lock. Replace the two calls with one.

Search and conversion was done with coccinelle.

---
 arch/avr32/mach-at32ap/pio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/avr32/mach-at32ap/pio.c +2 -2
index 903c7d8..6c7035a 100644
@@ -312,7 +312,6 @@ gpio_irq_setup(struct pio_device *pio, int irq, int gpio_irq)
 	unsigned	i;
 
 	irq_set_chip_data(irq, pio);
-	irq_set_handler_data(irq, (void *)gpio_irq);
 
 	for (i = 0; i < 32; i++, gpio_irq++) {
 		irq_set_chip_data(gpio_irq, pio);
@@ -320,7 +319,8 @@ gpio_irq_setup(struct pio_device *pio, int irq, int gpio_irq)
 					 handle_simple_irq);
 	}
 
-	irq_set_chained_handler(irq, gpio_irq_handler);
+	irq_set_chained_handler_and_data(irq, gpio_irq_handler,
+					 (void *)gpio_irq);
 }
 
 /*--------------------------------------------------------------------------*/
#4 lore raw

PATCH 2/3 avr32/at32ap: Use irq_set_handler_locked()

In reply to Thomas Gleixner

Use irq_set_handler_locked() as it avoids a redundant lookup of the irq descriptor.

Search and replacement was done with coccinelle.

Cc Jiang Liu <[email protected]>
Cc Julia Lawall <[email protected]>
Cc Haavard Skinnemoen <[email protected]>
Cc Hans-Christian Egtvedt <[email protected]>
---
 arch/avr32/mach-at32ap/extint.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/avr32/mach-at32ap/extint.c +2 -2
Index: tip/arch/avr32/mach-at32ap/extint.c
===================================================================
@@ -128,9 +128,9 @@ static int eic_set_irq_type(struct irq_d
 
 	irqd_set_trigger_type(d, flow_type);
 	if (flow_type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
-		__irq_set_handler_locked(irq, handle_level_irq);
+		irq_set_handler_locked(d, handle_level_irq);
 	else
-		__irq_set_handler_locked(irq, handle_edge_irq);
+		irq_set_handler_locked(d, handle_edge_irq);
 
 	return IRQ_SET_MASK_OK_NOCOPY;
 }
Acked-by on v1 2/3
#5 lore raw

Re: [patch 2/3] avr32/at32ap: Use irq_set_handler_locked()

Quoted 10 lines · Thomas Gleixner

Use irq_set_handler_locked() as it avoids a redundant lookup of the irq descriptor.

Search and replacement was done with coccinelle.

Cc Jiang Liu <[email protected]>
Cc Julia Lawall <[email protected]>
Cc Haavard Skinnemoen <[email protected]>
Cc Hans-Christian Egtvedt <[email protected]>
Quoted 20 lines
---
 arch/avr32/mach-at32ap/extint.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: tip/arch/avr32/mach-at32ap/extint.c
===================================================================

arch/avr32/mach-at32ap/extint.c +2 -2
@@ -128,9 +128,9 @@ static int eic_set_irq_type(struct irq_d
 
 	irqd_set_trigger_type(d, flow_type);
 	if (flow_type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
-		__irq_set_handler_locked(irq, handle_level_irq);
+		irq_set_handler_locked(d, handle_level_irq);
 	else
-		__irq_set_handler_locked(irq, handle_edge_irq);
+		irq_set_handler_locked(d, handle_edge_irq);
 
 	return IRQ_SET_MASK_OK_NOCOPY;
 }
Signature · 2 lines
mvh
Hans-Christian Egtvedt
#6 lore raw

[tip:irq/core] avr32/at32ap: Use irq_set_handler_locked()

In reply to Thomas Gleixner
avr32/at32ap: Use irq_set_handler_locked()
Commit-ID:  4f31dd63e050b777d3f3139197c4b3860aa89301
Gitweb:     http://git.kernel.org/tip/4f31dd63e050b777d3f3139197c4b3860aa89301
Author:     Thomas Gleixner <[email protected]>
AuthorDate: Mon, 13 Jul 2015 20:31:10 +0000
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Sun, 26 Jul 2015 11:47:25 +0200

avr32/at32ap: Use irq_set_handler_locked()

Use irq_set_handler_locked() as it avoids a redundant lookup of the irq descriptor.

Search and replacement was done with coccinelle.

---
 arch/avr32/mach-at32ap/extint.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/avr32/mach-at32ap/extint.c +2 -2
index 2d48b6a..d51ff8f 100644
@@ -128,9 +128,9 @@ static int eic_set_irq_type(struct irq_data *d, unsigned int flow_type)
 
 	irqd_set_trigger_type(d, flow_type);
 	if (flow_type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
-		__irq_set_handler_locked(irq, handle_level_irq);
+		irq_set_handler_locked(d, handle_level_irq);
 	else
-		__irq_set_handler_locked(irq, handle_edge_irq);
+		irq_set_handler_locked(d, handle_edge_irq);
 
 	return IRQ_SET_MASK_OK_NOCOPY;
 }
#7 lore raw

PATCH 3/3 avr32/irq: Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc

In reply to Thomas Gleixner

From: Jiang Liu <[email protected]>

Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc while we already have a pointer to corresponding irq_desc.

---
 arch/avr32/mach-at32ap/pio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/avr32/mach-at32ap/pio.c +1 -1
Index: tip/arch/avr32/mach-at32ap/pio.c
===================================================================
@@ -286,7 +286,7 @@ static void gpio_irq_handler(unsigned ir
 	struct pio_device	*pio = irq_desc_get_chip_data(desc);
 	unsigned		gpio_irq;
 
-	gpio_irq = (unsigned) irq_get_handler_data(irq);
+	gpio_irq = (unsigned) irq_desc_get_handler_data(desc);
 	for (;;) {
 		u32		isr;
 
#8 lore raw

[tip:irq/core] avr32/irq: Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc

avr32/irq: Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc
Commit-ID:  df6e23ae62d46a524ba3db95a201904a01419bdc
Gitweb:     http://git.kernel.org/tip/df6e23ae62d46a524ba3db95a201904a01419bdc
Author:     Jiang Liu <[email protected]>
AuthorDate: Mon, 13 Jul 2015 20:31:12 +0000
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Sun, 26 Jul 2015 11:47:25 +0200

avr32/irq: Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc

Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc while we already have a pointer to corresponding irq_desc.

---
 arch/avr32/mach-at32ap/pio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/avr32/mach-at32ap/pio.c +1 -1
index 6c7035a..157a5e0 100644
@@ -286,7 +286,7 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
 	struct pio_device	*pio = irq_desc_get_chip_data(desc);
 	unsigned		gpio_irq;
 
-	gpio_irq = (unsigned) irq_get_handler_data(irq);
+	gpio_irq = (unsigned) irq_desc_get_handler_data(desc);
 	for (;;) {
 		u32		isr;