On 1/13/2025 1:44 PM, Dmitry Baryshkov wrote: > On Sat, Jan 11, 2025 at 04:14:25PM +0000, Raviteja Laggyshetty wrote: >> Current interconnect framework is based on static IDs for creating node >> and registering with framework. This becomes a limitation for topologies >> where there are multiple instances of same interconnect provider. Add >> icc_node_create_alloc_id() API to create icc node with dynamic id, this >> will help to overcome the dependency on static IDs. > > This doesn't overcome the dependency on static ID. Drivers still have to > manually lookup the resulting ID and use it to link the nodes. Instead > ICC framework should be providing a completely dynamic solution: > - icc_node_create() should get a completely dynamic counterpart. Use > e.g. 1000000 as a dynamic start ID. > - icc_link_create() shold get a counterpart which can create a link > between two icc_node instances directly, without an additional lookup. > Agreed, with current implementation, still there is dependency on IDs for linking the nodes. Instead of relying on node names for the links, array of struct pointers will be used, this will eliminate the need for ID lookup and avoids extra loops. Instead of providing counter part for the ICC framework APIs which involves duplication of most of the code, I will modify the existing icc_node_create, icc_link_create and icc_node_add APIs to support both static and dynamic IDs. > You can check if your implementation is correct if you can refactor > existing ICC drivers (e.g. icc-clk and/or icc-rpm to drop ID arrays > completely). > ok, I will check the implementation on icc-rpmh driver for sa8775p SoC. >> >> Signed-off-by: Raviteja Laggyshetty <quic_rlaggysh@xxxxxxxxxxx> >> --- >> drivers/interconnect/core.c | 32 +++++++++++++++++++++++++++ >> include/linux/interconnect-provider.h | 6 +++++ >> 2 files changed, 38 insertions(+) >> >