[PATCH v2] clk: scmi: Fix children encountered before parents case
Sudeep Holla
sudeep.holla at arm.com
Thu Jun 12 01:29:16 PDT 2025
On Thu, Jun 12, 2025 at 09:36:58AM +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.
>
LGTM. I would like to add a note that we don't free individual scmi_clk
if for some reason it fails to setup. I can do that when I apply, just
checking if anyone has any objections. Please shout out if you have.
--
Regards,
Sudeep
More information about the linux-arm-kernel
mailing list