kernel: bump 4.14 to 4.14.136
[openwrt/staging/chunkeey.git] / target / linux / apm821xx / patches-4.19 / 100-powerpc-4xx-uic-clear-pending-interrupt-after-irq-ty.patch
1 From 9b84ad676e248a3e3c81db7f5d39e1739b3780aa Mon Sep 17 00:00:00 2001
2 From: Christian Lamparter <chunkeey@gmail.com>
3 Date: Sat, 15 Jun 2019 16:35:26 +0200
4 Subject: [PATCH] powerpc/4xx/uic: clear pending interrupt after irq type/pol
5 change
6
7 When testing out gpio-keys with a button, a spurious
8 interrupt (and therefore a key press or release event)
9 gets triggered as soon as the driver enables the irq
10 line for the first time.
11
12 This patch clears any potential bogus generated interrupt
13 that was caused by the switching of the associated irq's
14 type and polarity.
15
16 Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
17 ---
18 arch/powerpc/platforms/4xx/uic.c | 1 +
19 1 file changed, 1 insertion(+)
20
21 --- a/arch/powerpc/platforms/4xx/uic.c
22 +++ b/arch/powerpc/platforms/4xx/uic.c
23 @@ -158,6 +158,7 @@ static int uic_set_irq_type(struct irq_d
24
25 mtdcr(uic->dcrbase + UIC_PR, pr);
26 mtdcr(uic->dcrbase + UIC_TR, tr);
27 + mtdcr(uic->dcrbase + UIC_SR, ~mask);
28
29 raw_spin_unlock_irqrestore(&uic->lock, flags);
30