Re: [PATCH v2 03/10] interconnect: qcom: icc-rpm: Let nodes drive their own bus clock

From: Stephan Gerhold
Date: Tue Aug 01 2023 - 07:05:22 EST


On Mon, Jul 31, 2023 at 12:52:19PM +0200, Konrad Dybcio wrote:
> If this hardware couldn't get messier, some nodes are supposed to drive
> their own bus clock.. Presumably to connect to some intermediate
> interface between the node itself and the bus it's (supposed to be)
> connected to.
>
> Expand the node struct with the necessary data and hook up the
> allocations & calculations.
>
> To save on memory (not very many nodes have their own clocks), allocate
> a pointer to an array instead of allocating an array within
> qcom_icc_node.
>

Only on ARM32 though. On ARM64 you waste extra memory:

u32 bus_clk_rate[QCOM_SMD_RPM_STATE_NUM];
sizeof(bus_clk_rate) = QCOM_SMD_RPM_STATE_NUM * sizeof(bus_clk_rate[0])
= 2 * 4
= 8

u32 *bus_clk_rate;
sizeof(bus_clk_rate) = sizeof(ptr)
= 8 (for ARM64)
+ 2 * 4 + malloc overhead
for each node with bus_clk_desc

which is > 8 from above.

I'm not quite convinced this optimization is worth it.

Thanks,
Stephan