From mboxrd@z Thu Jan 1 00:00:00 1970 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 D29F2C6FA8E for ; Wed, 21 Sep 2022 15:47:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231517AbiIUPrc (ORCPT ); Wed, 21 Sep 2022 11:47:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231516AbiIUPrF (ORCPT ); Wed, 21 Sep 2022 11:47:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5E5E9323D; Wed, 21 Sep 2022 08:47:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C5AF06312E; Wed, 21 Sep 2022 15:47:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF019C433D6; Wed, 21 Sep 2022 15:47:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663775221; bh=7r89XjSIqmxsdqJA11MBe+sbq2S+K17H1vE04rSMB7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P1ZeQE2BXFDmWC/nmGKwJqL+vlkLg3v2ZG7eCy+aeLOcLScb8BaSQYOXTH4O0xGZ2 Pve2CnXbil351Tz0g9Rrh2K81/vO4SrN2K+vn9H8Z1jr/4i7rjDAcbkxIe9t2mPRjE 1qZ2x2jBnJ3jLB68Q/xwk9HhX90iM21n7eDWs1ek= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "=?UTF-8?q?Jo=C3=A3o=20H . =20Spies?=" , Linus Walleij , Sasha Levin Subject: [PATCH 5.19 04/38] pinctrl: rockchip: Enhance support for IRQ_TYPE_EDGE_BOTH Date: Wed, 21 Sep 2022 17:45:48 +0200 Message-Id: <20220921153646.447506473@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220921153646.298361220@linuxfoundation.org> References: <20220921153646.298361220@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: João H. Spies [ Upstream commit b871656aa4f54e04207f62bdd0d7572be1d86b36 ] Switching between falling/rising edges for IRQ_TYPE_EDGE_BOTH on pins that require debounce can cause the device to lose events due to a desync between pin state and irq type. This problem is resolved by switching between IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_LEVEL_HIGH instead. Fixes: 936ee2675eee ("gpio/rockchip: add driver for rockchip gpio") Signed-off-by: João H. Spies Link: https://lore.kernel.org/r/20220808025121.110223-1-jhlspies@gmail.com Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/gpio/gpio-rockchip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c index e342a6dc4c6c..bb953f647864 100644 --- a/drivers/gpio/gpio-rockchip.c +++ b/drivers/gpio/gpio-rockchip.c @@ -418,11 +418,11 @@ static int rockchip_irq_set_type(struct irq_data *d, unsigned int type) goto out; } else { bank->toggle_edge_mode |= mask; - level |= mask; + level &= ~mask; /* * Determine gpio state. If 1 next interrupt should be - * falling otherwise rising. + * low otherwise high. */ data = readl(bank->reg_base + bank->gpio_regs->ext_port); if (data & mask) -- 2.35.1