From: sashiko-bot@kernel.org
To: "Kendall Willis" <k-willis@ti.com>
Cc: linux-input@vger.kernel.org, robh@kernel.org,
devicetree@vger.kernel.org, conor+dt@kernel.org,
dmitry.torokhov@gmail.com
Subject: Re: [PATCH 2/2] Input: gpio-keys - support wakeup pinctrl state on suspend
Date: Sat, 12 Sep 2026 21:42:12 +0000 [thread overview]
Message-ID: <20260912214213.0ACF91F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260912-upstream-gpio-wakeup-v1-2-f0e12484b836@ti.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Missing restoration of default pinctrl state on error path in gpio_keys_enable_wakeup().
--
commit 794b05f8c21f23224e4ff7b076c2d675310e6432
Author: Kendall Willis <k-willis@ti.com>
Input: gpio-keys - support wakeup pinctrl state on suspend
This commit enables GPIO controllers on TI K3 AM62 devices to act as a wakeup
source during suspend to RAM by selecting a wakeup pinctrl state and restoring
the default on resume.
> diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
> index 129fc4212a5ed..b409e17970519 100644
> --- a/drivers/input/keyboard/gpio_keys.c
> +++ b/drivers/input/keyboard/gpio_keys.c
[ ... ]
> @@ -1010,6 +1017,9 @@ gpio_keys_enable_wakeup(struct gpio_keys_drvdata *ddata)
> int error;
> int i;
>
> + if (!IS_ERR_OR_NULL(ddata->pinctrl_wakeup))
> + pinctrl_select_state(ddata->pinctrl, ddata->pinctrl_wakeup);
> +
> for (i = 0; i < ddata->pdata->nbuttons; i++) {
> bdata = &ddata->data[i];
> if (bdata->button->wakeup) {
[Severity: Medium]
Does the error path in this function need to restore the default pinctrl
state?
Looking at gpio_keys_enable_wakeup in drivers/input/keyboard/gpio_keys.c,
the pinctrl state is changed to wakeup at the start of the function.
However, if gpio_keys_button_enable_wakeup fails for any button, the code
jumps to the err_out label:
err_out:
while (i--) {
bdata = &ddata->data[i];
if (bdata->button->wakeup)
gpio_keys_button_disable_wakeup(bdata);
bdata->suspended = false;
}
return error;
Since a failure here aborts the device's suspend transition, the PM core
will not invoke the corresponding resume callback. Could this leave the
hardware pins stuck in the wakeup configuration instead of reverting to the
default state for normal runtime operation?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260912-upstream-gpio-wakeup-v1-0-f0e12484b836@ti.com?part=2
next prev parent reply other threads:[~2026-09-12 21:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-12 21:33 [PATCH 0/2] Input: gpio-keys - support wakeup pinctrl state Kendall Willis
2026-09-12 21:33 ` [PATCH 1/2] dt-bindings: input: gpio-keys: add pinctrl states Kendall Willis
2026-09-12 21:41 ` sashiko-bot
2026-09-14 10:13 ` Krzysztof Kozlowski
2026-09-15 16:48 ` Kendall Willis
2026-09-15 17:05 ` Krzysztof Kozlowski
2026-09-15 17:07 ` Krzysztof Kozlowski
2026-09-15 17:41 ` Kendall Willis
2026-09-12 21:33 ` [PATCH 2/2] Input: gpio-keys - support wakeup pinctrl state on suspend Kendall Willis
2026-09-12 21:42 ` sashiko-bot [this message]
2026-09-14 7:51 ` Markus Schneider-Pargmann
2026-09-15 16:09 ` Kendall Willis
2026-09-14 5:59 ` [PATCH 0/2] Input: gpio-keys - support wakeup pinctrl state Francesco Dolcini
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=20260912214213.0ACF91F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=k-willis@ti.com \
--cc=linux-input@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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;
as well as URLs for NNTP newsgroup(s).