avr32: Interrupt cleanups and API change preparation
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
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.
--- arch/avr32/mach-at32ap/pio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/avr32/mach-at32ap/pio.c +2 -2
@@ -312,7 +312,6 @@ gpio_irq_setup(struct pio_device *pio, iunsigned 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); }/*--------------------------------------------------------------------------*/
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.
Reported-by Russell King <[email protected]>Signed-off-by Thomas Gleixner <[email protected]>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, iunsigned 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
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] avr32/at32ap: Consolidate chained IRQ handler install/remove
In reply to Thomas Gleixneravr32/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
@@ -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); }/*--------------------------------------------------------------------------*/
PATCH 2/3 avr32/at32ap: Use irq_set_handler_locked()
In reply to Thomas GleixnerUse 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
@@ -128,9 +128,9 @@ static int eic_set_irq_type(struct irq_dirqd_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 ; }
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.
Signed-off-by Thomas Gleixner <[email protected]>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_dirqd_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
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] avr32/at32ap: Use irq_set_handler_locked()
In reply to Thomas Gleixneravr32/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
@@ -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 ; }
PATCH 3/3 avr32/irq: Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc
In reply to Thomas GleixnerFrom: 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
@@ -286,7 +286,7 @@ static void gpio_irq_handler(unsigned irstruct 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;
tip-bot for Jiang Liu
merge bot[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
@@ -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;