linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/4xx/uic: clear pending interrupt after irq type/pol change
@ 2019-06-15 15:23 Christian Lamparter
  2019-07-08  1:19 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Lamparter @ 2019-06-15 15:23 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Thomas Gleixner, Paul Mackerras

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 <chunkeey@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] powerpc/4xx/uic: clear pending interrupt after irq type/pol change
  2019-06-15 15:23 [PATCH] powerpc/4xx/uic: clear pending interrupt after irq type/pol change Christian Lamparter
@ 2019-07-08  1:19 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2019-07-08  1:19 UTC (permalink / raw)
  To: Christian Lamparter, linuxppc-dev; +Cc: Thomas Gleixner, Paul Mackerras

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 <chunkeey@gmail.com>

Applied to powerpc next, thanks.

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

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-08  1:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-15 15:23 [PATCH] powerpc/4xx/uic: clear pending interrupt after irq type/pol change Christian Lamparter
2019-07-08  1:19 ` Michael Ellerman

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).