On Wed, Jun 04, 2025 at 01:00:30PM +0200, Sascha Hauer wrote:
When it comes to clocks with parents the SCMI clk driver assumes that
parents are always initialized before their children which might not
always be the case.
During initialization of the parent_data array we have:
sclk->parent_data[i].hw = hws[sclk->info->parents[i]];
hws[sclk->info->parents[i]] will not yet be initialized when children
are encountered before their possible parents. Solve this by allocating
all struct scmi_clk as an array first and populating all hws[] upfront.
Fixes: 65a8a3dd3b95f ("clk: scmi: Add support for clock {set,get}_parent")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Thanks for the fix. To i.MX, the index of child clk is always after
parent clk per current SM design. Not sure you met real issue, anyway
this patch itself is correct.
Reviewed-by: <peng.fan@nxp.com>