[PATCH] powerpc/4xx/uic: clear pending interrupt after irq type/pol change

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE2587d

2 messages, 2 authors, 2019-07-08 · open the first message on its own page

[PATCH] powerpc/4xx/uic: clear pending interrupt after irq type/pol change

From: Christian Lamparter <hidden>
Date: 2019-06-15 15:25:11

When testing out gpio-keys with a button, a spurious
interrupt (and therefore a key press or release event)
gets triggered as soon as the driver enables the irq
line for the first time.

This patch clears any potential bogus generated interrupt
that was caused by the switching of the associated irq's
type and polarity.

Signed-off-by: Christian Lamparter <redacted>
---
 arch/powerpc/platforms/4xx/uic.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/platforms/4xx/uic.c b/arch/powerpc/platforms/4xx/uic.c
index 31f12ad37a98..36fb66ce54cf 100644
--- a/arch/powerpc/platforms/4xx/uic.c
+++ b/arch/powerpc/platforms/4xx/uic.c
@@ -154,6 +154,7 @@ static int uic_set_irq_type(struct irq_data *d, unsigned int flow_type)
 
 	mtdcr(uic->dcrbase + UIC_PR, pr);
 	mtdcr(uic->dcrbase + UIC_TR, tr);
+	mtdcr(uic->dcrbase + UIC_SR, ~mask);
 
 	raw_spin_unlock_irqrestore(&uic->lock, flags);
 
-- 
2.20.1

Re: [PATCH] powerpc/4xx/uic: clear pending interrupt after irq type/pol change

From: Michael Ellerman <hidden>
Date: 2019-07-08 01:53:18

On Sat, 2019-06-15 at 15:23:13 UTC, Christian Lamparter wrote:
When testing out gpio-keys with a button, a spurious
interrupt (and therefore a key press or release event)
gets triggered as soon as the driver enables the irq
line for the first time.

This patch clears any potential bogus generated interrupt
that was caused by the switching of the associated irq's
type and polarity.

Signed-off-by: Christian Lamparter <redacted>
Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/3ab3a0689e74e6aa5b41360bc18861040ddef5b1

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help