Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Roman Vivchar" <rva333@protonmail.com>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org
Subject: Re: [PATCH] Input: synaptics-rmi4 - add support for reset gpios
Date: Sat, 12 Sep 2026 18:10:47 +0000	[thread overview]
Message-ID: <20260912181048.302FC1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260912-rmi4-reset-v1-1-4a3fc8856830@protonmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Missing reset GPIO assertion before disabling regulators on driver unbind and probe error paths leads to potential backpowering.
--

commit 11e1dedc5b986fa6ff95c5549b898574a80bff23
Author: Roman Vivchar <rva333@protonmail.com>

Input: synaptics-rmi4 - add support for reset gpios

In some cases, the touchscreen is wired to the always-on regulator, so
resetting is required for proper I2C communication. Add reset support to
the rmi_i2c driver.

> diff --git a/drivers/input/rmi4/rmi_i2c.c b/drivers/input/rmi4/rmi_i2c.c
> index e11d0acb9b96d..da560988f44a1 100644
> --- a/drivers/input/rmi4/rmi_i2c.c
> +++ b/drivers/input/rmi4/rmi_i2c.c
[ ... ]
> @@ -235,6 +247,11 @@ static int rmi_i2c_probe(struct i2c_client *client)
>  	if (error < 0)
>  		return error;
>  
> +	rmi_i2c->reset_gpio = devm_gpiod_get_optional(&client->dev, "reset",
> +						      GPIOD_OUT_HIGH);
> +	if (IS_ERR(rmi_i2c->reset_gpio))
> +		return PTR_ERR(rmi_i2c->reset_gpio);
> +
>  	error = regulator_bulk_enable(ARRAY_SIZE(rmi_i2c->supplies),
>  				       rmi_i2c->supplies);
>  	if (error < 0)

[Severity: High]
If a probe error occurs later in rmi_i2c_probe() (for example, when calling
rmi_register_transport_device()), or if the driver is unbound, devres will
run rmi_i2c_regulator_bulk_disable() to disable the regulators.

Should the reset GPIO be asserted before disabling the regulators in the
devres cleanup paths? 

Unlike the suspend callbacks which do assert the GPIO, the devres cleanup
does not. This appears to leave the reset GPIO driven while the chip is
unpowered, which could lead to backpowering the device.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260912-rmi4-reset-v1-1-4a3fc8856830@protonmail.com?part=1

      reply	other threads:[~2026-09-12 18:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-12 17:59 [PATCH] Input: synaptics-rmi4 - add support for reset gpios Roman Vivchar via B4 Relay
2026-09-12 18:10 ` sashiko-bot [this message]

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=20260912181048.302FC1F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=rva333@protonmail.com \
    --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