All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jerome Brunet" <jbrunet@baylibre.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v5 3/5] dt-bindings: mfd: x-powers,axp152: Document AXP318W
Date: Mon, 20 Jul 2026 11:40:58 +0000	[thread overview]
Message-ID: <20260720114059.4929E1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260720-axp318-regulator-v5-3-a1afa7ee24f9@baylibre.com>

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

Pre-existing issues:
- [High] The driver statically assigns hard-coded `.id` values inside its `mfd_cell` arrays and bypasses automatic ID allocation by passing `PLATFORM_DEVID_NONE` to `mfd_add_devices()`, violating the MFD subsystem guidelines.
--

--- Patch [3]: [PATCH v5 3/5] dt-bindings: mfd: x-powers,axp152: Document AXP318W ---
commit 0c5a5d45e78382d3cb52bdfeed22ad1c54a031fd
Author: Andre Przywara <andre.przywara@arm.com>

dt-bindings: mfd: x-powers,axp152: Document AXP318W

The X-Powers AXP318W is a PMIC used on some newer Allwinner devices.
Among a large number of both DCDC and LDO regulators it features the usual
ADC/IRQ/power key parts. Like other recent PMICs, it lacks the DC/DC converter
PWM frequency control register, that rate is fixed here.

> diff --git a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> index 45f015d63df16..38556c32417b3 100644
> --- a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> +++ b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml

[ ... ]

> @@ -277,7 +303,7 @@ properties:
>            Defines the work frequency of DC-DC in kHz.
>  
>      patternProperties:
> -      "^(([a-f])?ldo[0-9]|dcdc[0-7a-e]|ldo(_|-)io(0|1)|(dc1)?sw|rtc(_|-)ldo|cpusldo|drivevbus|dc5ldo|boost)$":
> +      "^(([a-f])?ldo[0-9]|dcdc[0-9a-e]|ldo(_|-)io(0|1)|(dc1)?sw|swout[1-2]|rtc(_|-)ldo|cpusldo|drivevbus|dc5ldo|boost)$":
>          $ref: /schemas/regulator/regulator.yaml#
>          type: object
>          unevaluatedProperties: false

[Severity: High]
This is a pre-existing issue, but while reviewing these changes, I noticed
a potential problem with how the driver handles cell IDs in
drivers/mfd/axp20x.c.

The mfd_cell array explicitly hardcodes the subdevice cell ID to 1:

drivers/mfd/axp20x.c:axp313a_cells[] {
    ...
    MFD_CELL_BASIC("axp20x-regulator", NULL, NULL, 0, 1),
    ...
}

The driver then forces the platform bus to consume these hard-coded cell IDs
rather than generating safe dynamic IDs:

drivers/mfd/axp20x.c:axp20x_device_probe() {
    ...
    ret = mfd_add_devices(axp20x->dev, PLATFORM_DEVID_NONE, axp20x->cells,
                          axp20x->nr_cells, NULL, 0, NULL);
    ...
}

Could this lead to device naming collisions in sysfs and driver load failures
if multiple MFD instances of the same type are instantiated?

If multiple PMICs sharing the same cell definitions are present, they might
attempt to register subdevices with the same hardcoded name and ID.

This would result in a fatal probe failure for the colliding subdevices.

Should this code use PLATFORM_DEVID_AUTO instead of PLATFORM_DEVID_NONE to
ensure automatic cell indexing?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260720-axp318-regulator-v5-0-a1afa7ee24f9@baylibre.com?part=3

  reply	other threads:[~2026-07-20 11:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20 11:20 [PATCH v5 0/5] regulator: Add X-Powers AXP318W PMIC support Jerome Brunet
2026-07-20 11:20 ` [PATCH v5 1/5] mfd: axp20x: Constify axp313 and axp717 cells Jerome Brunet
2026-07-20 14:50   ` Chen-Yu Tsai
2026-07-20 11:20 ` [PATCH v5 2/5] mfd: axp20x-i2c: Fix i2c instantiation Jerome Brunet
2026-07-20 14:52   ` Chen-Yu Tsai
2026-07-20 11:20 ` [PATCH v5 3/5] dt-bindings: mfd: x-powers,axp152: Document AXP318W Jerome Brunet
2026-07-20 11:40   ` sashiko-bot [this message]
2026-07-20 11:20 ` [PATCH v5 4/5] mfd: axp20x: Add support for AXP318W PMIC Jerome Brunet
2026-07-20 11:33   ` sashiko-bot
2026-07-20 11:20 ` [PATCH v5 5/5] regulator: axp20x: add support for the AXP318W Jerome Brunet

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=20260720114059.4929E1F00A3A@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.