* [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 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