clk: tegra: Register clocks from root to leaf
authorTimo Alho <talho@nvidia.com>
Wed, 6 Apr 2022 15:17:00 +0000 (16:17 +0100)
committerThierry Reding <treding@nvidia.com>
Wed, 4 May 2022 09:30:32 +0000 (11:30 +0200)
commit2db12b15c6f3e41ae2f2b3bb15627f28d1eaf715
tree4876ba278f5759b8ae8f8fbb40de886dbaaa18d9
parent23a43cc437e747473d5f8f98b4fe189fb5c433b7
clk: tegra: Register clocks from root to leaf

Current clock initialization causes intermediate registering of orphan
clocks (i.e. a clock without a parent registered). CCF keeps track of
orphan clocks and any time a new clock is registered, it will loop
through the list of orphan and queries if the parent is now available.
This operation triggers one or more clock operations, which are IPCs
with BPMP-FW. Hence, due to the order in which the clocks appear
currently, this causes > 5000 IPC messages to be sent to BPMP-FW during
clock initialization.

Optimize the clock probing by registering clocks hierarchically from
root clock towards leafs.

Signed-off-by: Timo Alho <talho@nvidia.com>
[jonathanh@nvidia.com: checkpatch fixes]
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/clk/tegra/clk-bpmp.c