Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jun Yan" <jerrysteve1101@gmail.com>
Cc: conor+dt@kernel.org, dmitry.torokhov@gmail.com, robh@kernel.org,
	devicetree@vger.kernel.org, linux-input@vger.kernel.org
Subject: Re: [PATCH v3 02/10] Input: cap11xx - remove unused register macros
Date: Mon, 15 Jun 2026 14:34:34 +0000	[thread overview]
Message-ID: <20260615143435.183A71F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260615142103.352163-3-jerrysteve1101@gmail.com>

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

New issues:
- [Medium] Removing sensor delta registers from the volatile register list causes regmap to incorrectly cache their values, breaking debugfs observability.

Pre-existing issues:
- [High] The driver requests its IRQ after registering the input device, creating a race condition where an unhandled interrupt can permanently disable the device.
--

commit 72bbdd7bb3155f054afabfd004f5e097d568001b
Author: Jun Yan <jerrysteve1101@gmail.com>

Input: cap11xx - remove unused register macros
    
Remove unused register address macros and unused definitions in
the cap11xx_reg_defaults array and cap11xx_volatile_reg. This cleanup
reduces code clutter and makes the driver easier to maintain.

> diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
> index 485d8ba977235..686174722204c 100644
> --- a/drivers/input/keyboard/cap11xx.c
> +++ b/drivers/input/keyboard/cap11xx.c

[ ... ]

> @@ -149,12 +97,6 @@ static bool cap11xx_volatile_reg(struct device *dev, unsigned int reg)
>  	switch (reg) {
>  	case CAP11XX_REG_MAIN_CONTROL:
>  	case CAP11XX_REG_SENSOR_INPUT:
> -	case CAP11XX_REG_SENOR_DELTA(0):
> -	case CAP11XX_REG_SENOR_DELTA(1):
> -	case CAP11XX_REG_SENOR_DELTA(2):
> -	case CAP11XX_REG_SENOR_DELTA(3):
> -	case CAP11XX_REG_SENOR_DELTA(4):
> -	case CAP11XX_REG_SENOR_DELTA(5):

[Severity: Medium]
Does removing the sensor delta registers from the volatile list cause a
regression for observability via the regmap debugfs interface?

These registers contain real-time capacitance delta hardware values that are
continuously updated by the device. Treating them as non-volatile causes
regmap to cache them on the first read, resulting in stale values for any
subsequent reads by tuning tools or developers.

>  		return true;
>  	}
>  

[Severity: High]
This isn't a bug introduced by this patch, but I noticed a pre-existing probe
ordering flaw in cap11xx_i2c_probe():

	error = input_register_device(priv->idev);
	if (error)
		return error;

	error = devm_request_threaded_irq(dev, i2c_client->irq,
					  NULL, cap11xx_thread_func,
					  IRQF_ONESHOT, dev_name(dev), priv);

Could this sequence lead to the interrupt being permanently disabled?

Since input_register_device() exposes the device to userspace, a daemon
can immediately open the device, waking the sensor from deep sleep.

If the sensor generates a hardware interrupt before
devm_request_threaded_irq() completes, the generic IRQ core will receive an
interrupt with no registered handler.

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

  reply	other threads:[~2026-06-15 14:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-15 14:20 [PATCH v3 00/10] Input: cap11xx - Add support for CAP1114 Jun Yan
2026-06-15 14:20 ` [PATCH v3 01/10] Input: cap11xx - clean up duplicate log and add probe error logs Jun Yan
2026-06-15 14:20 ` [PATCH v3 02/10] Input: cap11xx - remove unused register macros Jun Yan
2026-06-15 14:34   ` sashiko-bot [this message]
2026-06-15 14:20 ` [PATCH v3 03/10] dt-bindings: input: microchip,cap11xx: Update datasheet URL and LED reg range Jun Yan
2026-06-15 16:27   ` Conor Dooley
2026-06-15 14:20 ` [PATCH v3 04/10] dt-bindings: input: microchip,cap11xx: Add microchip,cap1126 LED reg constraints Jun Yan
2026-06-15 16:24   ` Conor Dooley
2026-06-15 14:20 ` [PATCH v3 05/10] dt-bindings: input: microchip,cap11xx: Add reset-gpios property Jun Yan
2026-06-15 14:20 ` [PATCH v3 06/10] Input: cap11xx - add reset gpio support Jun Yan
2026-06-15 14:29   ` sashiko-bot
2026-06-15 14:20 ` [PATCH v3 07/10] Input: cap11xx - refactor code for better CAP1114 support Jun Yan
2026-06-15 14:20 ` [PATCH v3 08/10] Input: cap11xx - guard unsupported DT properties before parsing Jun Yan
2026-06-15 14:20 ` [PATCH v3 09/10] dt-bindings: input: microchip,cap11xx: Add CAP1114 support Jun Yan
2026-06-15 16:24   ` Conor Dooley
2026-06-15 14:20 ` [PATCH v3 10/10] Input: cap11xx - add support for CAP1114 Jun Yan

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=20260615143435.183A71F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jerrysteve1101@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