Same parts of DT being probed twice
Daniel Drake
dsd at laptop.org
Sat Jul 23 05:22:17 EST 2011
On 22 July 2011 18:35, Grant Likely <grant.likely at secretlab.ca> wrote:
> of_platform_bus_probe() from the root of the tree is the wrong
> approach for registering 'deep' devices. of_platform_bus_probe() only
> knows how to deal with platform_devices. The moment something
> non-trivial appears in between, it no longer works. What you really
> want from the description you've given is the following struct device
> hierarchy:
>
> platform_device(representing the pci bus)
> --->pci_dev(representing the isa bridge)
> --->isa_device(representing the "via,vx855-gpio")
>
> To make this work, of_platform_bus_probe() creates the pci bus
> instance. The pci bus /driver/ is responsible for creating the isa
> bridge, and similarly the isa driver must be responsible for creating
> the gpio controller instance. Most of the pci support code that you
> need should already be there, but I haven't looked at what ISA is
> doing.
OK, thanks for the explanation.
In this case we don't need to create a platform_device for the vx855
gpio device - it is already handled through probing of the PCI bus
which is discovered through other means. I only added it in the list
as an item inbetween the root and gpio-leds.
> The gpio-leds node should be at the root of the tree, and everything
> gets a lot easier if you switch to using the new of_platform_populate()
> instead of of_platform_bus_probe().
That sounds more sensible. I'll check with our firmware guy when he
gets back from his break and continue from there.
However, even after fixing that, we will still be left with the
generic x86 code probing pci and isa. This creates a huge array of
platform devices (which are useless, or are devices that we already
have other device instances for), and seems to take quite a while
during boot. Is commit 9079b35364e75 wrong in some way? It has your
acked-by, but seems to go against what you wrote above.
Thanks,
Daniel
More information about the devicetree-discuss
mailing list