[PATCH 1/4] clk: scmi: Bulk allocate all sub-driver instance data

Peng Fan peng.fan at oss.nxp.com
Tue Oct 28 13:00:19 CET 2025


On Tue, Oct 28, 2025 at 04:41:03AM +0100, Marek Vasut wrote:
>Allocate all sub-driver instance data at once. The amount of data that
>have to be allocated is known up front, so is the size of the data, so
>there is no need to call malloc() in a loop, mallocate all data at once.
>
>The upside is, less heap fragmentation and fewer malloc() calls overall,
>and a faster boot time.
>
>The downside is, if some of the clock fail to register, then the clock
>driver cannot free parts of the bulk allocated sub-driver instance data.
>Such a failure can only occur if clk_register() were to fail, and if that
>happens, the system has more significant problems. Worse, if a core clock
>driver fails to probe, the system has even bigger problem.
>
>Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>

Reviewed-by: Peng Fan <peng.fan at nxp.com>


More information about the U-Boot mailing list