]> git.hungrycats.org Git - linux/commitdiff
pinctrl: mediatek: fix dual-edge code defect
authorhongkun.cao <hongkun.cao@mediatek.com>
Sat, 21 May 2016 07:23:39 +0000 (15:23 +0800)
committerSasha Levin <sasha.levin@oracle.com>
Fri, 17 Jun 2016 13:11:50 +0000 (09:11 -0400)
[ Upstream commit 5edf673d07fdcb6498be24914f3f38f8d8843199 ]

When a dual-edge irq is triggered, an incorrect irq will be reported on
condition that the external signal is not stable and this incorrect irq
has been registered.
Correct the register offset.

Cc: stable@vger.kernel.org
Signed-off-by: Hongkun Cao <hongkun.cao@mediatek.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/pinctrl/mediatek/pinctrl-mtk-common.c

index de08175aef0a1809b66bf9dfde8543bab8014f3f..d32a72e96c72cba5a322c88d8d5afc74797a6cd0 100644 (file)
@@ -1030,9 +1030,10 @@ static void mtk_eint_irq_handler(unsigned irq, struct irq_desc *desc)
        const struct mtk_desc_pin *pin;
 
        chained_irq_enter(chip, desc);
-       for (eint_num = 0; eint_num < pctl->devdata->ap_num; eint_num += 32) {
+       for (eint_num = 0;
+            eint_num < pctl->devdata->ap_num;
+            eint_num += 32, reg += 4) {
                status = readl(reg);
-               reg += 4;
                while (status) {
                        offset = __ffs(status);
                        index = eint_num + offset;