Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jun Yan" <jerrysteve1101@gmail.com>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com,
	robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v4 02/10] Input: cap11xx - remove unused register macros
Date: Wed, 17 Jun 2026 20:21:38 +0000	[thread overview]
Message-ID: <20260617202138.A3D631F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260617150318.753148-3-jerrysteve1101@gmail.com>

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

New issues:
- [Medium] The patch fails to remove unused definitions in `cap11xx_volatile_reg` despite the commit message claiming otherwise.

Pre-existing issues:
- [High] The threaded interrupt handler unconditionally returns IRQ_HANDLED even when I2C operations fail to clear the hardware interrupt source, risking an IRQ storm.
--

commit 8aa29f5d8b4eefa859454cdb0496fecf07ff5aa8
Author: Jun Yan <jerrysteve1101@gmail.com>

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 without affecting functionality.

> Remove unused register address macros and unused definitions in
> the cap11xx_reg_defaults array and cap11xx_volatile_reg.

[Severity: Medium]
Will this patch actually remove the unused definitions in
cap11xx_volatile_reg?

The commit message states they are removed, but the patch doesn't modify
that function.

> diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
> index 485d8ba97723..fae26f035186 100644
> --- a/drivers/input/keyboard/cap11xx.c
> +++ b/drivers/input/keyboard/cap11xx.c
> @@ -20,53 +20,24 @@
>  #define CAP11XX_REG_MAIN_CONTROL_GAIN_SHIFT	(6)
>  #define CAP11XX_REG_MAIN_CONTROL_GAIN_MASK	(0xc0)
>  #define CAP11XX_REG_MAIN_CONTROL_DLSEEP		BIT(4)
> -#define CAP11XX_REG_GENERAL_STATUS	0x02
>  #define CAP11XX_REG_SENSOR_INPUT	0x03
> -#define CAP11XX_REG_NOISE_FLAG_STATUS	0x0a
>  #define CAP11XX_REG_SENOR_DELTA(X)	(0x10 + (X))

[Severity: Medium]
Should this macro also have been removed?

Because cap11xx_volatile_reg() was not updated, this macro and its
corresponding case entries:

	case CAP11XX_REG_SENOR_DELTA(0):
	case CAP11XX_REG_SENOR_DELTA(1):

were left in the file.

[ ... ]

>  static bool cap11xx_volatile_reg(struct device *dev, unsigned int reg)

[Severity: High]
This isn't a bug introduced by this patch, but could the error handling
in cap11xx_thread_func() risk an IRQ storm?

If an I2C communication error occurs during the interrupt handler:

cap11xx_thread_func() {
	...
	if (ret < 0)
		goto out;
	...
out:
	return IRQ_HANDLED;
}

Because this uses IRQF_ONESHOT, returning IRQ_HANDLED instructs the IRQ
subsystem to unmask the interrupt. Since the device's interrupt status
was never cleared due to the I2C failure, the interrupt line will remain
asserted.

Will this cause the interrupt to immediately fire again when unmasked,
creating an infinite loop?

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

  reply	other threads:[~2026-06-17 20:21 UTC|newest]

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

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=20260617202138.A3D631F000E9@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