On 17/02/25 20:32, Quentin Schulz wrote:
Hi Moteen,
On 2/12/25 10:18 AM, Moteen Shah wrote:
[You don't often get email from m-s...@ti.com. Learn why this is
important at https://aka.ms/LearnAboutSenderIdentification ]
In the U-Boot pre-relocation stage, if the parent node lacks bootph*
property and the driver lacks a pre-reloc flag, all of its subsequent
subnodes gets skipped over from driver binding—even if they have a
bootph* property.
This series addresses the issue by scanning through all the subnodes
of the current node for the bootph* property and propagate it to all
of its supernodes, ensuring that all of the applicable drivers are
bound and probed prior to relocation. This series implements one of
the solutions mentioned in [0].
Since, all the nodes which are not having any bootph* property will
also be traversed, we will have to incur some overheads in boot time,
hence protecting the feature under a config.
Boot time overheads:
Baseline: Upstream u-boot
Patch test: Baseline + remove all bootph-all properties from
*-u-boot.dtsi except the ones which are supposed to be probed
but have no bootph in any of its subnode.
J7200 delta from baseline : ~100ms
J784S4 delta from baseline : ~350ms
Pfew, that's a lot of time. Can you tell us what's the delta in
percentage from baseline? Because if your system is usually booting in
one minute, 100ms isn't too bad :)
Our system's boot time is about 2.2s (J7200) and that of J784s4 is 2.7s
(owing to a larger DT).
FYI, I believe we've been hit by this issue on Rockchip but cannot
find the thread or patch right now.
For TPL and SPL, the Device Tree is parsed and looked for appropriate
bootph properties. Any node which doesn't have a bootph property and
doesn't have any children with a bootph property is removed from the
tree. However, the bootph property (if only present in a children
node) isn't propagated (meaning the node doesn't get the property).
This is done by fdtgrep.
The issue is that for U-Boot proper pre-relocation, the whole DT is
taken and only nodes with the appropriate bootph property is probed
and children nodes do NOT count as opposed to the TPL/SPL case.
My idea was that maybe we should rather propagate the property, at the
very least in U-Boot proper pre-relocation. This does mean we will
increase (by which amount?) the size of the DT in U-Boot proper
because we would add this property recursively up the tree from a node
that has the bootph property for U-Boot proper pre-relocation. This
**could** be an issue as the DT could be passed between stages and we
would then hit the size limit. Sadly, I didn't take the time to look
into adding support for that in fdtgrep nor will I have the time to do
it, so take this as me sharing my wish list with you.
Thanks for sharing this, the size increase this patch introduces for 48
such bootph-* tags is about 1.5KB's, we can go ahead and bind the super
parent to bypass the part of adding the tag, but for the next parent we
will have to traverse again down the DT adding in unnecessary
traversals(considering a case that we are 4-5 levels deep in the DT).
I would really like to avoid having it guarded by a knob though
because I really think this is an issue that should simply be fixed
unconditionally for every platform with DT support.
Agreed. This fix should be for all platforms, the knob is for preventing
boot time performance issues.
Cheers,
Quentin
Regards,
Moteen