* [RFC PATCH 0/2] Remove at91 workaround from handle_IRQ
@ 2012-05-31 7:38 Will Deacon
2012-05-31 7:38 ` [RFC PATCH 1/2] ARM: at91: use EOI flow control for interrupt handling Will Deacon
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Will Deacon @ 2012-05-31 7:38 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
This is a couple of patches that I wrote quickly to try and remove the
irq_finish hook from handle_IRQ on ARM. Currently, the hook is only used
by at91 in order to issue an EOI when using level_irq flow control.
This patch moves the at91 irq_chip to fasteoi flow control, removing the
need for the additional hook. Since I (a) don't know anything about at91
(the TRM I found for the IRQ controller is only a few pages long) and (b)
don't have a platform on which to test, this is very much an RFC series.
All comments welcome.
Will
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Will Deacon (2):
ARM: at91: use EOI flow control for interrupt handling
ARM: irq: remove unused irq_finish hook from core interrupt handling
arch/arm/kernel/irq.c | 10 ----------
arch/arm/mach-at91/include/mach/irqs.h | 8 --------
arch/arm/mach-at91/irq.c | 12 +++++++++---
3 files changed, 9 insertions(+), 21 deletions(-)
--
1.7.3.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RFC PATCH 1/2] ARM: at91: use EOI flow control for interrupt handling
2012-05-31 7:38 [RFC PATCH 0/2] Remove at91 workaround from handle_IRQ Will Deacon
@ 2012-05-31 7:38 ` Will Deacon
2012-05-31 7:38 ` [RFC PATCH 2/2] ARM: irq: remove unused irq_finish hook from core " Will Deacon
2012-05-31 8:21 ` [RFC PATCH 0/2] Remove at91 workaround from handle_IRQ ludovic.desroches
2 siblings, 0 replies; 5+ messages in thread
From: Will Deacon @ 2012-05-31 7:38 UTC (permalink / raw)
To: linux-arm-kernel
This patch updates the at91 interrupt handling to use EOI flow control
in preparation for removing the irq_finish hook on ARM.
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-at91/include/mach/irqs.h | 8 --------
arch/arm/mach-at91/irq.c | 12 +++++++++---
2 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/arch/arm/mach-at91/include/mach/irqs.h b/arch/arm/mach-at91/include/mach/irqs.h
index ac8b7df..592cb43 100644
--- a/arch/arm/mach-at91/include/mach/irqs.h
+++ b/arch/arm/mach-at91/include/mach/irqs.h
@@ -26,14 +26,6 @@
#define NR_AIC_IRQS 32
-
-/*
- * Acknowledge interrupt with AIC after interrupt has been handled.
- * (by kernel/irq.c)
- */
-#define irq_finish(irq) do { at91_aic_write(AT91_AIC_EOICR, 0); } while (0)
-
-
/*
* IRQ interrupt symbols are the AT91xxx_ID_* symbols
* for IRQs handled directly through the AIC, or else the AT91_PIN_*
diff --git a/arch/arm/mach-at91/irq.c b/arch/arm/mach-at91/irq.c
index cfcfcbe..3095fe0 100644
--- a/arch/arm/mach-at91/irq.c
+++ b/arch/arm/mach-at91/irq.c
@@ -55,6 +55,12 @@ static void at91_aic_unmask_irq(struct irq_data *d)
at91_aic_write(AT91_AIC_IECR, 1 << d->hwirq);
}
+static void at91_aic_eoi_irq(struct irq_data *d)
+{
+ /* Mark end-of-interrupt on AIC */
+ at91_aic_write(AT91_AIC_EOICR, 1 << d->hwirq);
+}
+
unsigned int at91_extern_irq;
#define is_extern_irq(hwirq) ((1 << (hwirq)) & at91_extern_irq)
@@ -128,9 +134,9 @@ void at91_irq_resume(void)
static struct irq_chip at91_aic_chip = {
.name = "AIC",
- .irq_ack = at91_aic_mask_irq,
.irq_mask = at91_aic_mask_irq,
.irq_unmask = at91_aic_unmask_irq,
+ .irq_eoi = at91_aic_eoi_irq,
.irq_set_type = at91_aic_set_type,
.irq_set_wake = at91_aic_set_wake,
};
@@ -171,7 +177,7 @@ static int at91_aic_irq_map(struct irq_domain *h, unsigned int virq,
/* Active Low interrupt, without priority */
at91_aic_write(AT91_AIC_SMR(hw), AT91_AIC_SRCTYPE_LOW);
- irq_set_chip_and_handler(virq, &at91_aic_chip, handle_level_irq);
+ irq_set_chip_and_handler(virq, &at91_aic_chip, handle_fasteoi_irq);
set_irq_flags(virq, IRQF_VALID | IRQF_PROBE);
return 0;
@@ -238,7 +244,7 @@ void __init at91_aic_init(unsigned int priority[NR_AIC_IRQS])
/* Active Low interrupt, with the specified priority */
at91_aic_write(AT91_AIC_SMR(i), AT91_AIC_SRCTYPE_LOW | priority[i]);
- irq_set_chip_and_handler(i, &at91_aic_chip, handle_level_irq);
+ irq_set_chip_and_handler(i, &at91_aic_chip, handle_fasteoi_irq);
set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [RFC PATCH 2/2] ARM: irq: remove unused irq_finish hook from core interrupt handling
2012-05-31 7:38 [RFC PATCH 0/2] Remove at91 workaround from handle_IRQ Will Deacon
2012-05-31 7:38 ` [RFC PATCH 1/2] ARM: at91: use EOI flow control for interrupt handling Will Deacon
@ 2012-05-31 7:38 ` Will Deacon
2012-05-31 8:21 ` [RFC PATCH 0/2] Remove at91 workaround from handle_IRQ ludovic.desroches
2 siblings, 0 replies; 5+ messages in thread
From: Will Deacon @ 2012-05-31 7:38 UTC (permalink / raw)
To: linux-arm-kernel
The irq_finish hook is no longer used by any platforms, so remove it.
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/kernel/irq.c | 10 ----------
1 files changed, 0 insertions(+), 10 deletions(-)
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 8349d4e..16cedb4 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -40,13 +40,6 @@
#include <asm/mach/irq.h>
#include <asm/mach/time.h>
-/*
- * No architecture-specific irq_finish function defined in arm/arch/irqs.h.
- */
-#ifndef irq_finish
-#define irq_finish(irq) do { } while (0)
-#endif
-
unsigned long irq_err_count;
int arch_show_interrupts(struct seq_file *p, int prec)
@@ -85,9 +78,6 @@ void handle_IRQ(unsigned int irq, struct pt_regs *regs)
generic_handle_irq(irq);
}
- /* AT91 specific workaround */
- irq_finish(irq);
-
irq_exit();
set_irq_regs(old_regs);
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [RFC PATCH 0/2] Remove at91 workaround from handle_IRQ
2012-05-31 7:38 [RFC PATCH 0/2] Remove at91 workaround from handle_IRQ Will Deacon
2012-05-31 7:38 ` [RFC PATCH 1/2] ARM: at91: use EOI flow control for interrupt handling Will Deacon
2012-05-31 7:38 ` [RFC PATCH 2/2] ARM: irq: remove unused irq_finish hook from core " Will Deacon
@ 2012-05-31 8:21 ` ludovic.desroches
2012-05-31 8:31 ` Will Deacon
2 siblings, 1 reply; 5+ messages in thread
From: ludovic.desroches @ 2012-05-31 8:21 UTC (permalink / raw)
To: linux-arm-kernel
Hi Will,
Le 05/31/2012 09:38 AM, Will Deacon a ?crit :
> Hello,
>
> This is a couple of patches that I wrote quickly to try and remove the
> irq_finish hook from handle_IRQ on ARM. Currently, the hook is only used
> by at91 in order to issue an EOI when using level_irq flow control.
>
> This patch moves the at91 irq_chip to fasteoi flow control, removing the
> need for the additional hook. Since I (a) don't know anything about at91
> (the TRM I found for the IRQ controller is only a few pages long) and (b)
> don't have a platform on which to test, this is very much an RFC series.
>
> All comments welcome.
>
> Will
I have sent a patch with the same purpose a few days ago:
http://comments.gmane.org/gmane.linux.ports.arm.kernel/169371
The content of our patches is really close:
- I missed the remove of irq_finish macro in arch/arm/irq/kernel.c
- AIC don't care about the value written into AT91_AIC_EOICR, I don't
know if it's better to write 0 or a precise value as you did.
- I didn't remove irq_ack but you're right it's no more useful.
- You missed gpio part, it has to use fasteoi flow control also.
I have also to remove some comments so I can send a second version and
add what I missed the first time if you have no objections.
> Cc: Arnd Bergmann<arnd@arndb.de>
> Cc: Jean-Christophe Plagniol-Villard<plagnioj@jcrosoft.com>
> Cc: Nicolas Ferre<nicolas.ferre@atmel.com>
>
> Will Deacon (2):
> ARM: at91: use EOI flow control for interrupt handling
> ARM: irq: remove unused irq_finish hook from core interrupt handling
>
> arch/arm/kernel/irq.c | 10 ----------
> arch/arm/mach-at91/include/mach/irqs.h | 8 --------
> arch/arm/mach-at91/irq.c | 12 +++++++++---
> 3 files changed, 9 insertions(+), 21 deletions(-)
>
Regards
Ludovic
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RFC PATCH 0/2] Remove at91 workaround from handle_IRQ
2012-05-31 8:21 ` [RFC PATCH 0/2] Remove at91 workaround from handle_IRQ ludovic.desroches
@ 2012-05-31 8:31 ` Will Deacon
0 siblings, 0 replies; 5+ messages in thread
From: Will Deacon @ 2012-05-31 8:31 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, May 31, 2012 at 09:21:24AM +0100, ludovic.desroches wrote:
> Hi Will,
Hi Ludovic,
> Le 05/31/2012 09:38 AM, Will Deacon a ?crit :
>
> I have sent a patch with the same purpose a few days ago:
> http://comments.gmane.org/gmane.linux.ports.arm.kernel/169371
Great - that means the controller does actually support EOI! I'm sorry
that I missed your patches the first time around.
> I have also to remove some comments so I can send a second version and
> add what I missed the first time if you have no objections.
Sure, please update your patches and CC me on version 2.
Thanks,
Will
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-05-31 8:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-31 7:38 [RFC PATCH 0/2] Remove at91 workaround from handle_IRQ Will Deacon
2012-05-31 7:38 ` [RFC PATCH 1/2] ARM: at91: use EOI flow control for interrupt handling Will Deacon
2012-05-31 7:38 ` [RFC PATCH 2/2] ARM: irq: remove unused irq_finish hook from core " Will Deacon
2012-05-31 8:21 ` [RFC PATCH 0/2] Remove at91 workaround from handle_IRQ ludovic.desroches
2012-05-31 8:31 ` Will Deacon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).