From: Samuel Holland <samuel@sholland.org>
To: Aren Moynihan <aren@peacevolution.org>,
Lee Jones <lee@kernel.org>, Chen-Yu Tsai <wens@csie.org>
Cc: Ondrej Jirman <megi@xff.cz>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mfd: axp20x: fix order of pek rise and fall events
Date: Wed, 30 Nov 2022 00:43:15 -0600 [thread overview]
Message-ID: <834c5b42-1992-e444-fe7b-2c0a28d71f60@sholland.org> (raw)
In-Reply-To: <20221123230741.2430813-1-aren@peacevolution.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 <aren@peacevolution.org>
> ---
> 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
next prev parent reply other threads:[~2022-11-30 6:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-23 23:07 Aren Moynihan
2022-11-30 6:43 ` Samuel Holland [this message]
2022-12-08 23:12 ` Aren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=834c5b42-1992-e444-fe7b-2c0a28d71f60@sholland.org \
--to=samuel@sholland.org \
--cc=aren@peacevolution.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=megi@xff.cz \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®