linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeffy Chen <jeffy.chen@rock-chips.com>
To: Heiko Stuebner <heiko@sntech.de>, Doug Anderson <dianders@chromium.org>
Cc: Jeffy Chen <jeffy.chen@rock-chips.com>,
	linux-rockchip@lists.infradead.org,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] gpio/rockchip: Toggle edge trigger mode after acking
Date: Sat, 20 Aug 2022 17:59:33 +0800	[thread overview]
Message-ID: <20220820095933.20234-2-jeffy.chen@rock-chips.com> (raw)
In-Reply-To: <20220820095933.20234-1-jeffy.chen@rock-chips.com>

Otherwise the trigger mode might be out-of-sync when a level change
occurred in between.

Fixes: 53b1bfc76df2 ("pinctrl: rockchip: Avoid losing interrupts when supporting both edges")
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

 drivers/gpio/gpio-rockchip.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c
index a98351cd6821..736b4d90f1ca 100644
--- a/drivers/gpio/gpio-rockchip.c
+++ b/drivers/gpio/gpio-rockchip.c
@@ -338,7 +338,7 @@ static void rockchip_irq_demux(struct irq_desc *desc)
 		irq = __ffs(pend);
 		pend &= ~BIT(irq);
 
-		dev_dbg(bank->dev, "handling irq %d\n", irq);
+		generic_handle_domain_irq(bank->domain, irq);
 
 		/*
 		 * Triggering IRQ on both rising and falling edge
@@ -370,8 +370,6 @@ static void rockchip_irq_demux(struct irq_desc *desc)
 						     bank->gpio_regs->ext_port);
 			} while ((data & BIT(irq)) != (data_old & BIT(irq)));
 		}
-
-		generic_handle_domain_irq(bank->domain, irq);
 	}
 
 	chained_irq_exit(chip, desc);
-- 
2.20.1


  reply	other threads:[~2022-08-20 10:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-20  9:59 [PATCH 1/2] gpio/rockchip: Convert to generic_handle_domain_irq() Jeffy Chen
2022-08-20  9:59 ` Jeffy Chen [this message]
2022-08-22 17:08   ` [PATCH 2/2] gpio/rockchip: Toggle edge trigger mode after acking Doug Anderson
2022-08-23  2:50     ` Chen Jeffy
2022-08-23 18:50       ` Brian Norris
2022-08-26  8:54       ` Linus Walleij
2022-08-29 23:26         ` Brian Norris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220820095933.20234-2-jeffy.chen@rock-chips.com \
    --to=jeffy.chen@rock-chips.com \
    --cc=brgl@bgdev.pl \
    --cc=dianders@chromium.org \
    --cc=heiko@sntech.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).