Linux Input/HID development
 help / color / mirror / Atom feed
From: Kendall Willis <k-willis@ti.com>
To: <sashiko-reviews@lists.linux.dev>
Cc: <robh@kernel.org>, <conor+dt@kernel.org>,
	<devicetree@vger.kernel.org>, <linux-input@vger.kernel.org>,
	<dmitry.torokhov@gmail.com>
Subject: Re: [PATCH v3 2/2] Input: gpio-keys - support wakeup pinctrl state on suspend
Date: Thu, 1 Oct 2026 11:12:31 -0500	[thread overview]
Message-ID: <20261001161231.eopj5fqxfn6d54sz@uda0506412> (raw)
In-Reply-To: <20261001160201.4F53D1F00898@smtp.kernel.org>

On 16:02-20261001, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] input: gpio-keys: silent masking of pinctrl resource acquisition errors
> --
> 
> commit f85782ff9c9eb4bfa803e47eea6427b48cb93f09
> Author: Kendall Willis <k-willis@ti.com>
> 
> Input: gpio-keys - support wakeup pinctrl state on suspend
> 
> This commit adds support for selecting a wakeup pinctrl state during suspend
> to RAM on TI K3 AM62 devices. It retrieves the pinctrl state using
> devm_pinctrl_get() and looks up the wakeup state if the device is enabled.
> 
> > diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
> > --- a/drivers/input/keyboard/gpio_keys.c
> > +++ b/drivers/input/keyboard/gpio_keys.c
> 
> [ ... ]
> 
> > @@ -884,6 +887,15 @@ static int gpio_keys_probe(struct platform_device *pdev)
> >  	platform_set_drvdata(pdev, ddata);
> >  	input_set_drvdata(input, ddata);
> >  
> > +	ddata->pinctrl = devm_pinctrl_get(dev);
> > +	if (IS_ERR(ddata->pinctrl)) {
> > +		error = PTR_ERR(ddata->pinctrl);
> > +		if (error == -EPROBE_DEFER)
> > +			return error;
> 
> [Severity: Medium]
> Does this code intentionally swallow all error codes from devm_pinctrl_get()
> other than -EPROBE_DEFER?
> 
> If devm_pinctrl_get() fails for other reasons, such as a memory allocation
> failure (-ENOMEM) or an invalid device tree configuration (-EINVAL), the
> error is silently ignored. This allows the driver to probe successfully but
> with silently broken wakeup functionality. 
> 
> Should the error be returned for all failure cases to avoid masking resource
> acquisition failures?

Pinctrl is optional to use for gpio-keys so we only care if
-EPROBE_DEFER is the error from pinctrl which would mean that it just
has not been probed yet. All other errors can fall through and the
pinctrl_wakeup variable would be left as NULL.

Best,
Kendall

> 
> > +	} else if (ddata->pinctrl) {
> > +		ddata->pinctrl_wakeup = pinctrl_lookup_state(ddata->pinctrl, "wakeup");
> > +	}
> > +
> >  	input->name = pdata->name ? : pdev->name;
> >  	input->phys = "gpio-keys/input0";
> >  	input->dev.parent = dev;
> 
> -- 
> Sashiko AI review · https://sashiko.dev/#/patchset/20261001-upstream-gpio-wakeup-v3-0-6f3bcde367a3@ti.com?part=2

  reply	other threads:[~2026-10-01 16:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01 15:50 [PATCH v3 0/2] Input: gpio-keys - support wakeup pinctrl state Kendall Willis
2026-10-01 15:50 ` [PATCH v3 1/2] dt-bindings: input: gpio-keys: add pinctrl states Kendall Willis
2026-10-01 15:59   ` sashiko-bot
2026-10-01 16:11     ` Kendall Willis
2026-10-01 20:01   ` Rob Herring (Arm)
2026-10-01 15:50 ` [PATCH v3 2/2] Input: gpio-keys - support wakeup pinctrl state on suspend Kendall Willis
2026-10-01 16:02   ` sashiko-bot
2026-10-01 16:12     ` Kendall Willis [this message]
2026-10-03  5:26       ` Dmitry Torokhov
2026-10-05 20:42         ` Kendall Willis

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=20261001161231.eopj5fqxfn6d54sz@uda0506412 \
    --to=k-willis@ti.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.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