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: 12949616 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D3BC4C25B08 for ; Sat, 20 Aug 2022 10:08:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=L7o81PJz4fHVw5S6Bs0jtHwhYRPL4HTuO1TADz8oEqw=; b=mtPN7cP7po7IwV 2O0OjXv9/SxU5sZfO/2FPmLcPB1VDx/AwwFPyAUX5N67ZvVNpTZSCdtIfxXYZKyQnFacs9toDYdfT Qfp4wBNCVaLlARsu7FiaSOUh28EjvkL7JV5Otj6+zqXg0jMJnMy9HNiCHu9eck2vmuWkQU7WKkSIp Ub79/A+LAbgH2bQxT79Tql5w7oUvnRuBlJhmXdlX2sNEXxS1R/O3t4RkJhVHtEOAZT+UDzY7LAZPq 1n0K+TXsSCLNgadhqOzaH/dD+9KzbLpGhXqmy+ZcD9Zur2Ea4t1HSB4mWNEbc/Z8Ve7VfKckqfRzh NYRSf90fiAVX2SHdYxRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oPLNv-007u9I-Gl; Sat, 20 Aug 2022 10:07:19 +0000 Received: from mail-m11885.qiye.163.com ([115.236.118.85]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oPLNj-007t27-De; Sat, 20 Aug 2022 10:07:09 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220820_030707_698546_F7E36492 X-CRM114-Status: UNSURE ( 7.28 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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: 12949617 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 22503C32774 for ; Sat, 20 Aug 2022 10:08:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=89krbWEbAeLAum9zg1lqby94hTt+uSvoyHTYIJuzU/Y=; b=TTMxtq/33gj72o 7M4bZydjsZRnqkCAZBofxMmridvy1iczQv4kIjnIYNK1s/NmRmwHCIjuS9lNz88yAWZBI/O1tqFcW OCj5GWXh50obDT05KfGhKRBUCjPlh0oDrC8C582XP/RhjOdCsxnOAfPcCYfvQ9i40OfUS3W8qbNty sUtyGAZA8a3EOy+cmw5i7/CBfB3nsKHJmve8lNDwdEasDcMr789g9B47qP14K2DxkC+0QM1s6chtt 3y+A1uPrj8mheZOpjivEq1ewmqGh2a7WdzI7+1tIWW8j2sR9NhC3Pf1xfb+I0rSdwsTsos2cVTVPq PC65IFzneXajNoPvaFWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oPLNn-007taX-4B; Sat, 20 Aug 2022 10:07:11 +0000 Received: from mail-m11885.qiye.163.com ([115.236.118.85]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oPLNj-007t7d-EI; Sat, 20 Aug 2022 10:07:09 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220820_030707_698751_F49F1C94 X-CRM114-Status: UNSURE ( 7.08 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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);