From: sashiko-bot@kernel.org
To: "Jerome Brunet" <jbrunet@baylibre.com>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH v3 4/4] regulator: axp20x: add support for the AXP318W
Date: Fri, 17 Jul 2026 09:18:46 +0000 [thread overview]
Message-ID: <20260717091846.BB9021F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260717-axp318-regulator-v3-4-779dc1b97dd4@baylibre.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Unhandled AXP318_ID variant in `axp20x_set_dcdc_workmode` triggers a kernel splat if `x-powers,dcdc-workmode` is in the Device Tree.
--
--- Patch [4]: [PATCH v3 4/4] regulator: axp20x: add support for the AXP318W ---
commit 8de3219334d650160512cfdeb429dbaddb9ab5cb
Author: Andre Przywara <andre.przywara@arm.com>
regulator: axp20x: add support for the AXP318W
The X-Powers AXP318W is a typical PMIC from X-Powers, featuring nine
DC/DC converters and 28 LDOs, on the regulator side. Describe the chip's
voltage settings and switch registers, how the voltages are encoded, and
connect this to the MFD device via its regulator ID.
> diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
> index da891415efc0b..6f887250d6402 100644
> --- a/drivers/regulator/axp20x-regulator.c
> +++ b/drivers/regulator/axp20x-regulator.c
[ ... ]
> @@ -1585,6 +1858,10 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
> regulators = axp313a_regulators;
> nregulators = AXP313A_REG_ID_MAX;
> break;
> + case AXP318_ID:
> + regulators = axp318_regulators;
> + nregulators = AXP318_REG_ID_MAX;
> + break;
> case AXP717_ID:
> regulators = axp717_regulators;
> nregulators = AXP717_REG_ID_MAX;
[Severity: Medium]
Could this trigger a kernel splat if the device tree contains the
"x-powers,dcdc-workmode" property for an AXP318 regulator?
During initialization in axp20x_regulator_probe(), the property is read
and passed to axp20x_set_dcdc_workmode():
ret = of_property_read_u32(rdev->dev.of_node,
"x-powers,dcdc-workmode",
&workmode);
if (!ret) {
if (axp20x_set_dcdc_workmode(rdev, i, workmode))
...
However, axp20x_set_dcdc_workmode() does not seem to handle AXP318_ID
in its switch statement, which will cause it to fall through to the
default case:
default:
/* should not happen */
WARN_ON(1);
return -EINVAL;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260717-axp318-regulator-v3-0-779dc1b97dd4@baylibre.com?part=4
prev parent reply other threads:[~2026-07-17 9:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 8:44 [PATCH v3 0/4] regulator: Add X-Powers AXP318W PMIC support Jerome Brunet
2026-07-17 8:44 ` [PATCH v3 1/4] dt-bindings: mfd: x-powers,axp152: Document AXP318W Jerome Brunet
2026-07-17 8:44 ` [PATCH v3 2/4] mfd: axp20x: Add support for AXP318W PMIC Jerome Brunet
2026-07-17 9:02 ` sashiko-bot
2026-07-17 9:51 ` Jerome Brunet
2026-07-17 8:44 ` [PATCH v3 3/4] mfd: axp20x: constify axp313 and axp717 cells Jerome Brunet
2026-07-17 9:08 ` sashiko-bot
2026-07-17 8:44 ` [PATCH v3 4/4] regulator: axp20x: add support for the AXP318W Jerome Brunet
2026-07-17 9:18 ` 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=20260717091846.BB9021F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jbrunet@baylibre.com \
--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