Re: [PATCH v4 05/29] dt-bindings: bus: Add simple-platform-bus
From: Herve Codina
Date: Fri Oct 31 2025 - 11:20:27 EST
Hi Rob,
On Thu, 30 Oct 2025 09:14:48 -0500
Rob Herring <robh@xxxxxxxxxx> wrote:
> On Wed, Oct 15, 2025 at 09:13:52AM +0200, Herve Codina wrote:
> > A Simple Platform Bus is a transparent bus that doesn't need a specific
> > driver to perform operations at bus level.
> >
> > Similar to simple-bus, a Simple Platform Bus allows to automatically
> > instantiate devices connected to this bus.
> >
> > Those devices are instantiated only by the Simple Platform Bus probe
> > function itself.
>
> Don't let Greg see this... :)
>
> I can't say I'm a fan either. "Platform bus" is a kernel thing, and the
> distinction here between the 2 compatibles is certainly a kernel thing.
>
> I think this needs to be solved within the kernel.
I fully agree with that.
>
> What I previously said is define a list of compatibles to not
> instantiate the child devices. This would essentially be any case having
> a specific compatible and having its own driver. So if someone has
> 'compatible = "vendor,not-so-simple-bus", "simple-bus"', when and if
> they add a driver for "vendor,not-so-simple-bus", then they have to add
> the compatible to the list in the simple-pm-bus driver. I wouldn't
> expect this to be a large list. There's only a handful of cases where
> "simple-bus" has a more specific compatible. And only a few of those
> have a driver. A more general and complicated solution would be making
> linux handle 2 (or more) drivers matching a node and picking the driver
> with most specific match. That gets complicated with built-in vs.
> modules. I'm not sure we really need to solve that problem.
Right. Let discard the "more general and complicated solution" and focus
on the list of compatible to avoid child devices instantiation.
Do you mean that, for "simple-bus" compatible we should:
- Remove the recursive device instantiation from of_platform_populate().
- In simple-bus probe(), check the device we probe against the
'no_instantiate_children' list
- If it matches, do not instantiate chidren
- If it doesn't match instantiate children
Is that correct?
Best regards,
Hervé