Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Maurizio Casciano" <mauriziocasciano7@gmail.com>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org
Subject: Re: [PATCH 2/2] Input: drv260x: Map ACPI enable GPIO
Date: Wed, 26 Aug 2026 13:37:50 +0000	[thread overview]
Message-ID: <20260826133750.F3B6D1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260826132211.3341936-3-mauriziocasciano7@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] I2C writes in `drv260x_resume()` and error paths of `drv260x_suspend()` will fail because the enable GPIO is not asserted.
--

commit 3813e86cb3a701e0633edd349e11dd4b241aa914
Author: Maurizio Casciano <mauriziocasciano7@gmail.com>

Input: drv260x: Map ACPI enable GPIO
    
Some ACPI DRV2604 devices describe the enable line as the first GPIO
resource in _CRS but provide no _DSD mapping for its function. Add a managed
ACPI GPIO mapping before requesting the optional enable line so these devices
can power their haptic path.

> diff --git a/drivers/input/misc/drv260x.c b/drivers/input/misc/drv260x.c
> index c4fbb10b254e9..b6243ce8157d6 100644
> --- a/drivers/input/misc/drv260x.c
> +++ b/drivers/input/misc/drv260x.c

[ ... ]

> @@ -448,6 +455,14 @@ static int drv260x_probe(struct i2c_client *client)
>  	u32 voltage;
>  	int error;
>  
> +	if (has_acpi_companion(dev)) {
> +		error = devm_acpi_dev_add_driver_gpios(dev,
> +						       drv260x_acpi_gpios);
> +		if (error)
> +			return dev_err_probe(dev, error,
> +					     "Failed to add ACPI GPIO mapping\n");
> +	}
> +
>  	haptics = devm_kzalloc(dev, sizeof(*haptics), GFP_KERNEL);
>  	if (!haptics)
>  		return -ENOMEM;

[Severity: High]
This isn't a bug introduced by this patch, but it appears there is a
pre-existing issue in the suspend and resume paths related to the enable GPIO.

Looking at drv260x_resume():

drivers/input/misc/drv260x.c:drv260x_resume() {
...
		error = regmap_update_bits(haptics->regmap,
					   DRV260X_MODE,
					   DRV260X_STANDBY_MASK, 0);
		if (error) {
			dev_err(dev, "Failed to unset standby mode\n");
			if (haptics->regulator)
				regulator_disable(haptics->regulator);
			return error;
		}

		gpiod_set_value(haptics->enable_gpio, 1);
...
}

Will this I2C transaction fail because it occurs while the chip is still held
in reset/shutdown by the GPIO? Since the enable GPIO is not asserted until
after the I2C write, and the driver aborts the resume on error, does this
leave the chip permanently disabled?

Additionally, because pulling the enable GPIO low resets all chip registers and
REGCACHE_NONE is used, is the device configuration (calibration, over-drive
voltage, library selection) lost and never restored during resume?

A similar issue appears to exist in the error path of drv260x_suspend():

drivers/input/misc/drv260x.c:drv260x_suspend() {
...
		gpiod_set_value(haptics->enable_gpio, 0);

		if (haptics->regulator) {
			error = regulator_disable(haptics->regulator);
			if (error) {
				dev_err(dev, "Failed to disable regulator\n");
				regmap_update_bits(haptics->regmap,
						   DRV260X_MODE,
						   DRV260X_STANDBY_MASK, 0);
				return error;
			}
		}
...
}

Does the error path attempt to communicate with the chip via I2C without
restoring the enable GPIO to 1?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260826132211.3341936-1-mauriziocasciano7@gmail.com?part=2

  reply	other threads:[~2026-08-26 13:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26 13:22 [PATCH 0/2] Input: Add ACPI support needed by Yoga Book DRV2604 Maurizio Casciano
2026-08-26 13:22 ` [PATCH 1/2] Input: drv260x: Make vbat supply optional Maurizio Casciano
2026-08-26 13:36   ` sashiko-bot
2026-08-27 10:54   ` Dmitry Torokhov
2026-08-27 18:15     ` Maurizio Casciano
2026-08-26 13:22 ` [PATCH 2/2] Input: drv260x: Map ACPI enable GPIO Maurizio Casciano
2026-08-26 13:37   ` sashiko-bot [this message]
2026-08-27 10:58   ` Dmitry Torokhov
2026-08-27 18:15     ` Maurizio Casciano

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=20260826133750.F3B6D1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=mauriziocasciano7@gmail.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