From patchwork Wed Nov 23 23:07:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aren X-Patchwork-Id: 25244 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3084838wrr; Wed, 23 Nov 2022 15:27:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf7y66vD0ZgXxqoaVQwyq7e5uo/nblwv86MsGhFWDscEtUq++XTe33GsWfC5J67ye6XAaDv3 X-Received: by 2002:a17:906:960d:b0:7ac:a335:203f with SMTP id s13-20020a170906960d00b007aca335203fmr25432982ejx.460.1669246050411; Wed, 23 Nov 2022 15:27:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669246050; cv=none; d=google.com; s=arc-20160816; b=m4LIeJYFffJhubdSz92Zr48EoWDTWbd2+uvWAl9d9nFHXIovIv6MittT07XFwYEpIO 3AxoO+LRfncJbQtVAR5+BVuxCRfqO3Qx5HSFhdUgh7uR2wN61uferXPChtez73nyZU1W AU7gplfixcEbhY5zFHwWUltxefBci2xsOqB/l6eDNDKkfhigCFL4G813CUtoM1+USkfD AxTqCf0ZgNGdapxwGYL/1mMBBj9L27MHJX4FBs0SdAbl020pZsD7P40h40rrqwcJe425 8zkl4ONxrc1bUNHxLYVO/+RRAx5+kNbQnS8lTpMmwuFOI0PcFhS3ZMZrrdDlnMnmmlvs u3Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=X8Qm5jm0AtEblzCeF9itCHAowb9iYc8polGhradUFPU=; b=gAEZ3ka1jrc5kAzi6pIvOfH+KLqcdTrPtHytxGJhIlJ5pRoRei+/thJwEq9Rp13/gU a4It+9SGwziqhTaTiZnvn0RtfCDrJNn9vTgX3IhSSRCrkQSNmMg7mFRTNUkF7UEjQTmc ByaKY19VAWFE4GpRc+HcMj950vyiSZ5kh4DM/Jy0GPpW9VYh+pOhcw3sqm5K6kQFt3pC GRr6Ra2lRqFu0rs0gm2JbSXKrZy8+9k9lLbPHSHCDmxiD/d3/BkWTN9qlAC6NhEavr55 5TBrHUW9mWN5JWaKByBzup1QQy6WFP1MlCaXDf/jqCIVH6UNvv2qj1WiaOtrhOwmuwgU nGTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@peacevolution.org header.s=dkim header.b=aX6eqJCu; 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=REJECT sp=REJECT dis=NONE) header.from=peacevolution.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c14-20020aa7df0e000000b004692dc7d456si11467733edy.370.2022.11.23.15.27.06; Wed, 23 Nov 2022 15:27:30 -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=@peacevolution.org header.s=dkim header.b=aX6eqJCu; 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=REJECT sp=REJECT dis=NONE) header.from=peacevolution.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229899AbiKWXUe (ORCPT + 99 others); Wed, 23 Nov 2022 18:20:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229848AbiKWXUa (ORCPT ); Wed, 23 Nov 2022 18:20:30 -0500 X-Greylist: delayed 537 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 23 Nov 2022 15:20:29 PST Received: from a.peacevolution.org (a.peacevolution.org [206.189.193.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35F0511604E for ; Wed, 23 Nov 2022 15:20:28 -0800 (PST) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by a.peacevolution.org (Postfix) with ESMTPA id 43C0C7E00E; Wed, 23 Nov 2022 23:11:30 +0000 (UTC) From: Aren Moynihan To: Lee Jones , Chen-Yu Tsai , linux-kernel@vger.kernel.org Cc: Ondrej Jirman , Aren Moynihan Subject: [PATCH] mfd: axp20x: fix order of pek rise and fall events Date: Wed, 23 Nov 2022 18:07:41 -0500 Message-Id: <20221123230741.2430813-1-aren@peacevolution.org> MIME-Version: 1.0 Authentication-Results: auth=pass smtp.auth=aren@peacevolution.org smtp.mailfrom=aren@peacevolution.org X-Spamd-Bar: ++++ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=peacevolution.org; s=dkim; t=1669245090; h=from:subject:date:message-id:to:cc:mime-version:content-transfer-encoding; bh=X8Qm5jm0AtEblzCeF9itCHAowb9iYc8polGhradUFPU=; b=aX6eqJCu411zJGL0YO09SckcfgDVgQ55UbzLBVY2LnjHHxKwGPXJ0fRcl/nFsPDp4/Xkwq w0o4zhX0xS25J2GMBf+ElBLjDbxVasKa26BAY5QxM0EOlPGWi9/MQ7MrAsWAQ70vfz7+RX tgUzSkmRk1K0CVxd0W8xr5qDY34qn+E= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750331346836445501?= X-GMAIL-MSGID: =?utf-8?q?1750331346836445501?= 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. 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,