From: Shivendra Pratap <shivendra.pratap@oss.qualcomm.com>
To: sashiko-reviews@lists.linux.dev
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org,
mfd@lists.linux.dev, robh@kernel.org, lee@kernel.org
Subject: Re: [PATCH v24 08/12] mfd: psci-mfd: Add psci-reboot-mode child cell
Date: Mon, 3 Aug 2026 18:22:18 +0530 [thread overview]
Message-ID: <eb7c8660-1892-4cd3-a960-9f4a15ca31d8@oss.qualcomm.com> (raw)
In-Reply-To: <20260803100748.34BE81F000E9@smtp.kernel.org>
On 8/3/2026 3:37 PM, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] The MFD probe function swallows errors from devm_mfd_add_devices() instead of propagating them to abort the probe.
> --
>
> --- Patch [8]: [PATCH v24 08/12] mfd: psci-mfd: Add psci-reboot-mode child cell ---
> commit 88cfe078ed8299db3dd71fd877f29ff443d5037e
> Author: Shivendra Pratap <shivendra.pratap@oss.qualcomm.com>
>
> mfd: psci-mfd: Add psci-reboot-mode child cell
>
> This commit exposes the PSCI reboot-mode node as a proper child cell using
> a named_fwnode. It also registers the psci-cpuidle-domain cell first to
> isolate it from reboot-mode failures.
>
>> diff --git a/drivers/mfd/psci-mfd.c b/drivers/mfd/psci-mfd.c
>> index 7affd6bb09dd8..7befc4fa86f5d 100644
>> --- a/drivers/mfd/psci-mfd.c
>> +++ b/drivers/mfd/psci-mfd.c
>
> [ ... ]
>
>> @@ -14,10 +14,35 @@ static const struct mfd_cell psci_cells[] = {
>> static int psci_mfd_probe(struct platform_device *pdev)
>> {
>> - return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, psci_cells,
>> + int ret;
>> +
>> + ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, psci_cells,
>> ARRAY_SIZE(psci_cells), NULL, 0, NULL);
>> + if (ret)
>> + goto out;
>> +
>> + ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
>> + psci_reboot_mode_cell,
>> + ARRAY_SIZE(psci_reboot_mode_cell),
>> + NULL, 0, NULL);
>> + if (ret) {
>> + if (ret == -ENOMEM)
>> + goto out;
>> + dev_warn(&pdev->dev, "reboot-mode child cell failed to add: %d\n", ret);
>> + ret = 0;
>> + }
>
> [Severity: Medium]
> Should this propagate the error instead of returning 0?
>
> According to the MFD subsystem guidelines, if a child device fails to
> register during an MFD probe, the entire probe must fail and unwind
> previously registered children. By setting ret = 0 here, the driver reports
> success for the parent probe even if the reboot-mode child cell fails to
> register. Does this leave the device in an incomplete state and violate the
> requirement to propagate devm_mfd_add_devices() errors?
This is done on purpose.
psci-mfd adds two child cells, psci-cpuidle-domain and psci-reboot-mode.
psci-cpuidle-domain is a critical driver for device device bootup on
supported systems. psci-reboot-mode child is hence added separately as
optional child which will not affect the probe of psci-mfd.
thanks,
Shivendra
next prev parent reply other threads:[~2026-08-03 12:52 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 9:43 [PATCH v24 00/12] Implement PSCI reboot mode driver for PSCI resets Shivendra Pratap
2026-08-03 9:43 ` [PATCH v24 01/12] power: reset: reboot-mode: Support up to 3 magic values per mode Shivendra Pratap
2026-08-03 9:56 ` sashiko-bot
2026-08-03 9:43 ` [PATCH v24 02/12] power: reset: reboot-mode: Add support for predefined reboot modes Shivendra Pratap
2026-08-03 9:59 ` sashiko-bot
2026-08-04 14:19 ` Shivendra Pratap
2026-08-03 9:43 ` [PATCH v24 03/12] firmware: psci: Introduce command-based resets Shivendra Pratap
2026-08-03 10:01 ` sashiko-bot
2026-08-04 14:38 ` Shivendra Pratap
2026-08-03 9:43 ` [PATCH v24 04/12] mfd: psci-mfd: Add PSCI MFD driver for cpuidle-psci-domain cell Shivendra Pratap
2026-08-03 10:00 ` sashiko-bot
2026-08-03 9:43 ` [PATCH v24 05/12] dt-bindings: arm: Document reboot mode magic Shivendra Pratap
2026-08-03 10:09 ` sashiko-bot
2026-08-03 11:44 ` Rob Herring (Arm)
2026-08-03 12:46 ` Shivendra Pratap
2026-08-03 14:02 ` Rob Herring
2026-08-03 14:21 ` Shivendra Pratap
2026-08-03 9:43 ` [PATCH v24 06/12] power: reset: Add psci-reboot-mode driver Shivendra Pratap
2026-08-03 10:11 ` sashiko-bot
2026-08-03 13:07 ` Shivendra Pratap
2026-08-03 9:43 ` [PATCH v24 07/12] mfd: core: Add firmware-node support to MFD cells Shivendra Pratap
2026-08-03 10:07 ` sashiko-bot
2026-08-03 9:43 ` [PATCH v24 08/12] mfd: psci-mfd: Add psci-reboot-mode child cell Shivendra Pratap
2026-08-03 10:07 ` sashiko-bot
2026-08-03 12:52 ` Shivendra Pratap [this message]
2026-08-03 9:43 ` [PATCH v24 09/12] arm64: dts: qcom: Add psci reboot-modes for kodiak boards Shivendra Pratap
2026-08-03 10:13 ` sashiko-bot
2026-08-03 9:43 ` [PATCH v24 10/12] arm64: dts: qcom: Add psci reboot-modes for lemans boards Shivendra Pratap
2026-08-03 10:15 ` sashiko-bot
2026-08-03 9:43 ` [PATCH v24 11/12] arm64: dts: qcom: Add psci reboot-modes for monaco boards Shivendra Pratap
2026-08-03 10:13 ` sashiko-bot
2026-08-03 9:43 ` [PATCH v24 12/12] arm64: dts: qcom: Add psci reboot-modes for talos boards Shivendra Pratap
2026-08-03 10:14 ` 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=eb7c8660-1892-4cd3-a960-9f4a15ca31d8@oss.qualcomm.com \
--to=shivendra.pratap@oss.qualcomm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=lee@kernel.org \
--cc=mfd@lists.linux.dev \
--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