Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Eduard Bostina" <egbostina@gmail.com>
Cc: conor+dt@kernel.org, linux-input@vger.kernel.org,
	linux-leds@vger.kernel.org, dri-devel@lists.freedesktop.org,
	robh@kernel.org, devicetree@vger.kernel.org, lee@kernel.org,
	dmitry.torokhov@gmail.com
Subject: Re: [PATCH v3 3/4] dt-bindings: input: Convert TI TPS65217 power button to DT schema
Date: Tue, 21 Jul 2026 11:34:07 +0000	[thread overview]
Message-ID: <20260721113408.655C01F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260721112133.70382-4-egbostina@gmail.com>

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

Pre-existing issues:
- [High] Missing NULL check on `dev_get_regmap` can lead to a kernel panic in the IRQ handler.
- [High] The driver incorrectly masks `platform_get_irq()` error codes with `-EINVAL`, breaking probe deferral.
--

--- Patch [3]: [PATCH v3 3/4] dt-bindings: input: Convert TI TPS65217 power button to DT schema ---
commit 7ffa82f06e0d099b257abd8ec45ed224af6ff3c6
Author: Eduard Bostina <egbostina@gmail.com>

dt-bindings: input: Convert TI TPS65217 power button to DT schema

Convert the Texas Instruments TPS65217 and TPS65218 Power Button
bindings to DT schema.

drivers/input/misc/tps65218-pwrbutton.c:tps6521x_pb_probe() {
        ...
        pwr->regmap = dev_get_regmap(dev->parent, NULL);
        ...
}

[Severity: High]
This isn't a bug introduced by this patch, but does this code need to check
if pwr->regmap is NULL?

If dev_get_regmap() returns NULL due to an incomplete device tree, it seems
this could lead to a kernel panic during an interrupt when tps6521x_pb_irq()
dereferences it:

drivers/input/misc/tps65218-pwrbutton.c:tps6521x_pb_irq() {
        ...
        error = regmap_read(pwr->regmap, tps_data->reg_status, &reg);
        ...
}


drivers/input/misc/tps65218-pwrbutton.c:tps6521x_pb_probe() {
        ...
        irq = platform_get_irq(pdev, 0);
        if (irq < 0)
                return -EINVAL;
        ...
}

[Severity: High]
This is also a pre-existing issue, but does masking the return value of
platform_get_irq() break probe deferral?

If platform_get_irq() returns -EPROBE_DEFER, converting the error to -EINVAL
prevents the driver core from handling the deferral and retrying later.

> diff --git a/Documentation/devicetree/bindings/input/ti,tps65217-pwrbutton.yaml b/Documentation/devicetree/bindings/input/ti,tps65217-pwrbutton.yaml
> new file mode 100644
> index 0000000000000..3526d8b045fd2
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/ti,tps65217-pwrbutton.yaml

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260721112133.70382-1-egbostina@gmail.com?part=3

  reply	other threads:[~2026-07-21 11:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21 11:21 [PATCH v3 0/4] dt-bindings: Convert TI TPS65217 to DT schema Eduard Bostina
2026-07-21 11:21 ` [PATCH v3 1/4] ARM: dts: ti: am335x-guardian: Drop unused isink-en property Eduard Bostina
2026-07-21 11:24   ` sashiko-bot
2026-07-21 11:21 ` [PATCH v3 2/4] ARM: dts: Rename the TPS65217 regulator nodes Eduard Bostina
2026-07-21 11:26   ` sashiko-bot
2026-07-21 11:21 ` [PATCH v3 3/4] dt-bindings: input: Convert TI TPS65217 power button to DT schema Eduard Bostina
2026-07-21 11:34   ` sashiko-bot [this message]
2026-07-21 15:02     ` Rob Herring
2026-07-21 11:21 ` [PATCH v3 4/4] dt-bindings: leds: backlight: Convert TPS65217 " Eduard Bostina
2026-07-21 11:29   ` 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=20260721113408.655C01F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=egbostina@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-leds@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