Re: [PATCH] firmware: google: fix orphaned devices on partial populate failure

From: Titouan Ameline

Date: Thu Apr 30 2026 - 04:30:56 EST


Thanks both for the reference to of_platform_populate(), that makes
the clear.

I'll rework the patch to simply continue the loop on any
device_register() failure, log a warning, and always return 0.
That drops the cleanup and aligns with the strategy used
in of_platform_populate().

Will send a v2 in the next 24 hours

Le mar. 28 avr. 2026 à 22:33, Brian Norris <briannorris@xxxxxxxxxxxx> a écrit :
>
> On Tue, Apr 28, 2026 at 12:49:35PM -0700, Julius Werner wrote:
> > > Given that, would the right approach be to continue the loop on
> > > entry-specific errors ( logging a warning), while still aborting and
> > > cleaning up on systemic ones like -ENOMEM? Or is the name collision
> > > case considered impossible here since names are derived from the
> > > tag/index and the table is only parsed once?
> >
> > I don't think you should hardcode behavior so specific to what the
> > called function does. Trying every entry doesn't really hurt even if
> > they all fail due to some systemic problem, so if there's any chance
> > that other entries might succeed, I think the best option is to just
> > always continue the loop and try the next one.
>
> FWIW, of_platform_populate() might be a (highly-used) analog for
> comparison. Aside from some top-level errors (such as, "can't even find
> the root to start from"), it doesn't actually return errors at all [1].
> It just skips individual device failures (including -ENOMEM).
>
> Seems like an OK strategy to me.
>
> Brian
>
> [1] of_platform_bus_create() technically has some recursion-carried
> return codes, giving a chance to propagate a failure, but all the return
> codes are still 0.