Devicetree
 help / color / mirror / Atom feed
From: Jerome Brunet <jbrunet@baylibre.com>
To: Lee Jones <lee@kernel.org>
Cc: Andre Przywara <andre.przywara@arm.com>,
	 Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	 Chen-Yu Tsai <wens@kernel.org>,
	 Liam Girdwood <lgirdwood@gmail.com>,
	 Mark Brown <broonie@kernel.org>,
	devicetree@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/5] mfd: axp20x: Add support for AXP318W PMIC
Date: Thu, 06 Aug 2026 15:48:15 +0200	[thread overview]
Message-ID: <1jv79nweao.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <20260806120952.GA2869284@google.com> (Lee Jones's message of "Thu, 6 Aug 2026 13:09:52 +0100")

On jeu. 06 août 2026 at 13:09, Lee Jones <lee@kernel.org> wrote:

> /* Sashiko Automation: Issues Found (2 Findings) */
>
> Please explain or fix these Sashiko reviews.

I already did (several times actually) but for some reason, sashiko was
only replying to the DT folks and me (something I did not see until now)
... so when I replied, it did not get to you.

>
> On Fri, 17 Jul 2026, Jerome Brunet wrote:
>

[...]

>>  
>> +static const struct mfd_cell axp318_cells[] = {
>> +	MFD_CELL_BASIC("axp20x-regulator", NULL, NULL, 0, 1),
>
> [Severity: Medium]
> Does this hardcoded cell ID of 1 violate the MFD subsystem guidelines?
>
> If multiple AXP devices with hardcoded IDs of 1 (such as the AXP313a and
> AXP318W) are instantiated on the same system, could they both attempt to
> register a platform device named axp20x-regulator.1, resulting in a fatal
> -EEXIST failure?
>
> Should this use PLATFORM_DEVID_AUTO instead?

Already replied to this. As far as I can tell PLATFORM_DEVID_AUTO would
not go there. The driver is indeed registered PLATFORM_DEVID_NONE here:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/mfd/axp20x.c?h=v7.2-rc6#n1452

But there is nothing new about this. If this is an issue, it is
pre-existing one. 

>
>
>> +};
>> +
>>  static struct mfd_cell axp717_cells[] = {
>>  	MFD_CELL_NAME("axp20x-regulator"),
>>  	MFD_CELL_RES("axp20x-pek", axp717_pek_resources),
>> @@ -1313,6 +1385,12 @@ int axp20x_match_device(struct axp20x_dev *axp20x)
>>  		axp20x->regmap_cfg = &axp313a_regmap_config;
>>  		axp20x->regmap_irq_chip = &axp313a_regmap_irq_chip;
>>  		break;
>> +	case AXP318_ID:
>> +		axp20x->nr_cells = ARRAY_SIZE(axp318_cells);
>> +		axp20x->cells = axp318_cells;
>> +		axp20x->regmap_cfg = &axp318_regmap_config;
>> +		axp20x->regmap_irq_chip = &axp318_regmap_irq_chip;
>> +		break;
>
> [Severity: High]
> Is AXP318_ID missing from the switch statement in axp20x_power_off()?
>
> When the system attempts to power off, axp20x_power_off() is called. If
> AXP318_ID is not handled in the switch statement there, will it fall through
> to the default case and select AXP20X_OFF_CTRL (0x32) instead of the correct
> AXP318_SHUTDOWN_CTRL (0x52)?
>
> Could this failure to shut down the PMIC corrupt the state of the CLDO4
> regulator by writing the power-off command to AXP318_CLDO4_CONTROL (which
> is also 0x32)?

That was fixed in v5

FYI the last version is v6 here:
https://lore.kernel.org/all/20260731-axp318-regulator-v6-0-b4e745552a35@baylibre.com/

Sashiko continued to complain about the platform id. I did not fix
because because it is unrelated to the series. I'm happy to replace
PLATFORM_DEVID_NONE by PLATFORM_DEVID_AUTO but I do not really why it
was set like that in the first place and if the change would be harmless
to all existing users.

It also commented on the irq controller but no, it is not required. I've checked.


  parent reply	other threads:[~2026-08-06 13:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17 14:31 [PATCH v4 0/5] regulator: Add X-Powers AXP318W PMIC support Jerome Brunet
2026-07-17 14:31 ` [PATCH v4 1/5] dt-bindings: mfd: x-powers,axp152: Document AXP318W Jerome Brunet
2026-07-17 14:43   ` sashiko-bot
2026-07-17 15:36     ` Jerome Brunet
2026-07-17 14:31 ` [PATCH v4 2/5] mfd: axp20x: Add support for AXP318W PMIC Jerome Brunet
2026-07-17 14:48   ` sashiko-bot
2026-08-06 12:09   ` Lee Jones
2026-08-06 12:24     ` Lee Jones
2026-08-06 13:36       ` Jerome Brunet
2026-08-06 13:48     ` Jerome Brunet [this message]
2026-07-17 14:31 ` [PATCH v4 3/5] mfd: axp20x: Constify axp313 and axp717 cells Jerome Brunet
2026-07-17 14:31 ` [PATCH v4 4/5] mfd: axp20x-i2c: Fix i2c instantiation Jerome Brunet
2026-07-17 14:54   ` sashiko-bot
2026-07-17 14:31 ` [PATCH v4 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=1jv79nweao.fsf@starbuckisacylon.baylibre.com \
    --to=jbrunet@baylibre.com \
    --cc=andre.przywara@arm.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=wens@kernel.org \
    /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