From patchwork Sat Aug 20 09:59:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeffy Chen X-Patchwork-Id: 599045 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39C38C32774 for ; Sat, 20 Aug 2022 10:16:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231132AbiHTKQs (ORCPT ); Sat, 20 Aug 2022 06:16:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344640AbiHTKQr (ORCPT ); Sat, 20 Aug 2022 06:16:47 -0400 Received: from mail-m11885.qiye.163.com (mail-m11885.qiye.163.com [115.236.118.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51B9D5FAA for ; Sat, 20 Aug 2022 03:16:46 -0700 (PDT) Received: from localhost (unknown [103.29.142.67]) by mail-m11885.qiye.163.com (Hmail) with ESMTPA id 6B7974C0286; Sat, 20 Aug 2022 18:07:01 +0800 (CST) From: Jeffy Chen To: Heiko Stuebner , Doug Anderson Cc: Jeffy Chen , linux-rockchip@lists.infradead.org, Linus Walleij , Bartosz Golaszewski , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] gpio/rockchip: Convert to generic_handle_domain_irq() Date: Sat, 20 Aug 2022 17:59:32 +0800 Message-Id: <20220820095933.20234-1-jeffy.chen@rock-chips.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVlCTUxLVkhIGU0ZSUIeSUtIGlUTARMWGhIXJBQOD1 lXWRgSC1lBWUpLSFVJQlVKT0lVTUxZV1kWGg8SFR0UWUFZT0tIVUpKS0hKQ1VLWQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Nk06Tzo*Vj03ShUeNVZPHBgZ TjAwCThVSlVKTU1LQkJLS0lKQ0xNVTMWGhIXVREeHR0CVRgTHhU7CRQYEFYYExILCFUYFBZFWVdZ EgtZQVlKS0hVSUJVSk9JVU1MWVdZCAFZQUlITEs3Bg++ X-HM-Tid: 0a82bab85f4a2eb9kusn6b7974c0286 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Follow commit dbd1c54fc820 ("gpio: Bulk conversion to generic_handle_domain_irq()"). Signed-off-by: Jeffy Chen --- drivers/gpio/gpio-rockchip.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c index e342a6dc4c6c..a98351cd6821 100644 --- a/drivers/gpio/gpio-rockchip.c +++ b/drivers/gpio/gpio-rockchip.c @@ -333,16 +333,10 @@ static void rockchip_irq_demux(struct irq_desc *desc) pend = readl_relaxed(bank->reg_base + bank->gpio_regs->int_status); while (pend) { - unsigned int irq, virq; + unsigned int irq; irq = __ffs(pend); pend &= ~BIT(irq); - virq = irq_find_mapping(bank->domain, irq); - - if (!virq) { - dev_err(bank->dev, "unmapped irq %d\n", irq); - continue; - } dev_dbg(bank->dev, "handling irq %d\n", irq); @@ -377,7 +371,7 @@ static void rockchip_irq_demux(struct irq_desc *desc) } while ((data & BIT(irq)) != (data_old & BIT(irq))); } - generic_handle_irq(virq); + generic_handle_domain_irq(bank->domain, irq); } chained_irq_exit(chip, desc); From patchwork Sat Aug 20 09:59:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeffy Chen X-Patchwork-Id: 598821 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C52FBC25B08 for ; Sat, 20 Aug 2022 10:16:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344474AbiHTKQr (ORCPT ); Sat, 20 Aug 2022 06:16:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231132AbiHTKQq (ORCPT ); Sat, 20 Aug 2022 06:16:46 -0400 X-Greylist: delayed 582 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sat, 20 Aug 2022 03:16:45 PDT Received: from mail-m11885.qiye.163.com (mail-m11885.qiye.163.com [115.236.118.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FBB5CD0 for ; Sat, 20 Aug 2022 03:16:45 -0700 (PDT) Received: from localhost (unknown [103.29.142.67]) by mail-m11885.qiye.163.com (Hmail) with ESMTPA id A28F04C0309; Sat, 20 Aug 2022 18:07:02 +0800 (CST) From: Jeffy Chen To: Heiko Stuebner , Doug Anderson Cc: Jeffy Chen , linux-rockchip@lists.infradead.org, Bartosz Golaszewski , Linus Walleij , 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 Message-Id: <20220820095933.20234-2-jeffy.chen@rock-chips.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220820095933.20234-1-jeffy.chen@rock-chips.com> References: <20220820095933.20234-1-jeffy.chen@rock-chips.com> MIME-Version: 1.0 X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVkZHUNOVk0eH0pLSk5NTE5IH1UTARMWGhIXJBQOD1 lXWRgSC1lBWUpLSFVJQlVKT0lVTUxZV1kWGg8SFR0UWUFZT0tIVUpISkJITVVLWQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6OCI6Dxw4ST0rCRUyD1YzHAo# ORkKC1ZVSlVKTU1LQkJLS0lISktPVTMWGhIXVREeHR0CVRgTHhU7CRQYEFYYExILCFUYFBZFWVdZ EgtZQVlKS0hVSUJVSk9JVU1MWVdZCAFZQUlOSUg3Bg++ X-HM-Tid: 0a82bab864142eb9kusna28f04c0309 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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 --- 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);