Re: [PATCH v24 08/12] mfd: psci-mfd: Add psci-reboot-mode child cell
Shivendra Pratap <[email protected]> Mon, 3 Aug 2026 18:22:18 +0530
| Newsgroups | dev.linux.lists.sashiko-reviews,dev.linux.lists.mfd,org.kernel.vger.linux-devicetree |
|---|---|
| Message-ID | <[email protected]> |
On 8/3/2026 3:37 PM, [email protected] 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 <[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? 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