Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1918652rwb; Tue, 29 Nov 2022 22:52:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf6QtmIMfxtZUz7U/COiPB2caYiCTiT0J5ir3B0qXO89YVesbeHlQK49z3RxXGFzaLoEuDrV X-Received: by 2002:aa7:d556:0:b0:45c:6467:94e2 with SMTP id u22-20020aa7d556000000b0045c646794e2mr54071863edr.295.1669791170662; Tue, 29 Nov 2022 22:52:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669791170; cv=none; d=google.com; s=arc-20160816; b=KMJKpDtXO1wGM80CoaGopVyZ6NFFMDCilfH+3yRNGixWGUfG5LXkziPAH0qC1B7xu9 ghREczrS0hPwR/pDFgqmDaJ5Oz6ZbnZ5MqHk6hzwfwZzVInzL3zyOOorRGzQxebdhLh5 NipPM8kCEkD1WUFsDRj4aF8h3zihPKItP7ckDvrmEUwj8858x6bXSxjZHCtGMRji4YSa rUwLG2PK0oIWgCyZbyvhrHgszd2B5WDlCYnFxX0BLG+81IVq4jpV7YU40sBqmaAqc9lc jHXJE2zZ8t6ctfRJv1SN3W4lsrydtwdDkarcsb32KqRest4oa/vSg7uDimVp32J8XVB6 CqPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:feedback-id:dkim-signature:dkim-signature; bh=lntUmHMVl09jWwzPOK/afaD1n7te2cZMlPiqFMAMIAM=; b=h3G3QxOkRFb+2cajr+rW0E3YBiSxCBmeKoqrsbETaKzsNBP5u30Iqf6c0sCZ1w9nLU UZ/mmelsUvDOi5QE4gHcdcle55wYLHdueEehKL8DiQOTEuB4NL1OnTmPHcJWfc4xDzV6 tK6b3MFo8f6ZuFjRDiAOdKeW3SvDn1a7Whz2DK4LbcajoZYYSOoToWUCoNDWO/2IYpHr oLxEGlrj7OmYTqyOPPEb9hRP27xciti0TzUY3g0QOHO2oUBJecBiaympTzPcOckhX1hD 3e+orHFX4JmCwdeNPFWjIP1PJ8fatA09xOR+Kkp+Fu4rRvlyQ7iqPTW9G0T1y54pi1ar td3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=S8kbnn+D; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=c0kTGr6J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i4-20020a1709064fc400b007c07a5fb437si741958ejw.581.2022.11.29.22.52.29; Tue, 29 Nov 2022 22:52:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=S8kbnn+D; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=c0kTGr6J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232844AbiK3Gn1 (ORCPT + 86 others); Wed, 30 Nov 2022 01:43:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232704AbiK3GnW (ORCPT ); Wed, 30 Nov 2022 01:43:22 -0500 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A137264BB for ; Tue, 29 Nov 2022 22:43:19 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 2D96B32008C3; Wed, 30 Nov 2022 01:43:18 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 30 Nov 2022 01:43:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1669790597; x= 1669876997; bh=lntUmHMVl09jWwzPOK/afaD1n7te2cZMlPiqFMAMIAM=; b=S 8kbnn+Dqdd+7HPcRi3dIsjSE1GweRVRTP27wUI1l+RKXyajw5IY0h96VMhXUa0KY VkIv5J4p9CqC7iazG6OQsCNb4FDTJE0UKrWwkFyVLx6nvVlwS08+hVMT0m3RDOuK F5nahZCtUtvBnx3dLceR9sPgSN0olU0gplervKVsnu7B2CufNfjNnGwiAZVrD7Wq BFFRBGzFN73PeRpw8sKqf7tTYCyWTNJ+UACDUtRSo3xEkAvvcvVeICzuS/N5hFWT SE2Ijodm4E/wLWCTeps38Z/FBvKmd2CP914QmLPaH7hbnimP0VSTr9WQow6M6Uts WsbiRwF3ihxsNhy0xf14w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1669790597; x= 1669876997; bh=lntUmHMVl09jWwzPOK/afaD1n7te2cZMlPiqFMAMIAM=; b=c 0kTGr6Je9XBU8+OiVbwU8gWaYJTY+nGabuetTSGw1eEY3SHkQhh0lXMno/jpFVw6 pFlC0EH6i9svWR+0NT3MU2uW7iF1w8gY5QxdKz3vV0/6hY5C/L6ixXv3AAeVLrQk oVexkxy13H8Kze6jXYrnMbGDhIy1b6rhWj+mrU00Uawtz+qMtjcks62RkpnPPEBx dtCYr7Jv/5AkqM9Z1Diy4edWLkSH965SSWINCQgct5j3cCnG/KE82ba458EyaPjQ T9qTQTQDnBZUCumatFJALGLdYZXdD/r4m91WDaWSrceNf6n2LgVR6jOYmM2sqZnQ IzwsVWpTORa9TpXirRwag== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrtddvgdelkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfvvehfhffujggtgfesthejredttdefjeenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepjefgfffhudejfedtuedugeeutdetgfeiteffffehjeeugfeuvdeh jeetfedtffdtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 30 Nov 2022 01:43:16 -0500 (EST) Message-ID: <834c5b42-1992-e444-fe7b-2c0a28d71f60@sholland.org> Date: Wed, 30 Nov 2022 00:43:15 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Content-Language: en-US To: Aren Moynihan , Lee Jones , Chen-Yu Tsai Cc: Ondrej Jirman , linux-kernel@vger.kernel.org References: <20221123230741.2430813-1-aren@peacevolution.org> From: Samuel Holland Subject: Re: [PATCH] mfd: axp20x: fix order of pek rise and fall events In-Reply-To: <20221123230741.2430813-1-aren@peacevolution.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/23/22 17:07, Aren Moynihan wrote: > The power button can get "stuck" if the rising edge and falling edge irq > are read in the same pass. This can often be triggered when resuming > from suspend if the power button is released before the kernel handles > the interrupt. > > Swapping the order of the rise and fall events makes sure that the press > event is handled first, which prevents this situation. Indeed. This is probably the simplest solution, but I think it deserves a comment in at least one place that the order intentionally mismatches the order of the bits in the register. > Signed-off-by: Aren Moynihan > --- > include/linux/mfd/axp20x.h | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h > index 9ab0e2fca7ea..a13ba2bdd01f 100644 > --- a/include/linux/mfd/axp20x.h > +++ b/include/linux/mfd/axp20x.h > @@ -432,8 +432,8 @@ enum { > AXP152_IRQ_PEK_SHORT, > AXP152_IRQ_PEK_LONG, > AXP152_IRQ_TIMER, > - AXP152_IRQ_PEK_RIS_EDGE, > AXP152_IRQ_PEK_FAL_EDGE, > + AXP152_IRQ_PEK_RIS_EDGE, > AXP152_IRQ_GPIO3_INPUT, > AXP152_IRQ_GPIO2_INPUT, > AXP152_IRQ_GPIO1_INPUT, > @@ -472,8 +472,8 @@ enum { > AXP20X_IRQ_LOW_PWR_LVL1, > AXP20X_IRQ_LOW_PWR_LVL2, > AXP20X_IRQ_TIMER, > - AXP20X_IRQ_PEK_RIS_EDGE, > AXP20X_IRQ_PEK_FAL_EDGE, > + AXP20X_IRQ_PEK_RIS_EDGE, > AXP20X_IRQ_GPIO3_INPUT, > AXP20X_IRQ_GPIO2_INPUT, > AXP20X_IRQ_GPIO1_INPUT, > @@ -502,8 +502,8 @@ enum axp22x_irqs { > AXP22X_IRQ_LOW_PWR_LVL1, > AXP22X_IRQ_LOW_PWR_LVL2, > AXP22X_IRQ_TIMER, > - AXP22X_IRQ_PEK_RIS_EDGE, > AXP22X_IRQ_PEK_FAL_EDGE, > + AXP22X_IRQ_PEK_RIS_EDGE, > AXP22X_IRQ_GPIO1_INPUT, > AXP22X_IRQ_GPIO0_INPUT, > }; > @@ -571,8 +571,8 @@ enum axp803_irqs { > AXP803_IRQ_LOW_PWR_LVL1, > AXP803_IRQ_LOW_PWR_LVL2, > AXP803_IRQ_TIMER, > - AXP803_IRQ_PEK_RIS_EDGE, > AXP803_IRQ_PEK_FAL_EDGE, > + AXP803_IRQ_PEK_RIS_EDGE, > AXP803_IRQ_PEK_SHORT, > AXP803_IRQ_PEK_LONG, > AXP803_IRQ_PEK_OVER_OFF, > @@ -623,8 +623,8 @@ enum axp809_irqs { > AXP809_IRQ_LOW_PWR_LVL1, > AXP809_IRQ_LOW_PWR_LVL2, > AXP809_IRQ_TIMER, > - AXP809_IRQ_PEK_RIS_EDGE, > AXP809_IRQ_PEK_FAL_EDGE, > + AXP809_IRQ_PEK_RIS_EDGE, > AXP809_IRQ_PEK_SHORT, > AXP809_IRQ_PEK_LONG, > AXP809_IRQ_PEK_OVER_OFF, You should also update APX288 and APX806, which name the IRQs "POK" instead of "PEK" for some reason. Regards, Samuel