Derek Basehore ede7785847 clk: Remove global clk traversal on fetch parent index
It's not required to traverse the entire clk tree when the parents array
contains a NULL value. We already have the parent clk_core pointer, so
we can just compare the parent->name and parent_names[i] pointers.

This can be a substantial power improvement in cases where the parent
clk isn't known and that clk is never registered, because a mux having
an unregistered parent name may traverse the clk tree on every
clk_set_rate() call in clk_mux_determine_rate_flags(). This can happen
hundreds of times a second for CPU clks.

This patch is the combination of reverting commit 470b5e2f97cf ("clk:
simplify clk_fetch_parent_index() function") and optimizing the
resulting code to never call __clk_lookup() because we already have the
clk_core pointer we're looking for. That optimization went unnoticed
even after commit da0f0b2c3ad2 ("clk: Correct lookup logic in
clk_fetch_parent_index()") tried to optimize this path.

Signed-off-by: Derek Basehore <dbasehore@chromium.org>
[sboyd@kernel.org: More description in commit text]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2019-01-24 11:13:28 -08:00
..
2019-01-24 10:55:32 -08:00
2017-11-01 23:25:43 -07:00
2018-11-06 09:41:57 -08:00
2018-03-16 15:53:30 -07:00
2018-12-10 14:43:20 -08:00
2018-12-11 09:57:47 -08:00
2018-12-11 09:57:47 -08:00
2018-12-11 09:57:47 -08:00
2018-12-11 09:57:48 -08:00
2018-12-11 09:57:48 -08:00
2018-07-06 13:44:06 -07:00
2018-12-11 09:57:48 -08:00
2016-10-23 10:18:45 -07:00
2018-11-08 10:29:44 -08:00
2017-11-01 23:25:51 -07:00
2018-12-11 09:57:47 -08:00