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 <[email protected]>
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?
> +
> +out:
> + return ret;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com?part=8
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.