Skip to content

Commit 7f9560a

Browse files
Raviteja LaggyshettyGeorgi Djakov
authored andcommitted
interconnect: qcom: icc-rpmh: Add dynamic icc node id support
Interconnect framework relies on static IDs for creating, linking and maintaning the topology. This dependency on static IDs prevents creating two instances of same provider. To overcome the dependency on static IDs, dynamic ID support is being added. To facilitate dynamic node ID support, the driver now uses node pointers for links instead of static node IDs and icc_node pointer is added as member in qcom_icc_node structure to track the node creation. Signed-off-by: Raviteja Laggyshetty <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Georgi Djakov <[email protected]>
1 parent ac2c390 commit 7f9560a

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

drivers/interconnect/qcom/icc-rpmh.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,14 @@ int qcom_icc_rpmh_probe(struct platform_device *pdev)
280280
if (!qn)
281281
continue;
282282

283-
node = icc_node_create(qn->id);
283+
if (desc->alloc_dyn_id) {
284+
if (!qn->node)
285+
qn->node = icc_node_create_dyn();
286+
node = qn->node;
287+
} else {
288+
node = icc_node_create(qn->id);
289+
}
290+
284291
if (IS_ERR(node)) {
285292
ret = PTR_ERR(node);
286293
goto err_remove_nodes;
@@ -290,8 +297,12 @@ int qcom_icc_rpmh_probe(struct platform_device *pdev)
290297
node->data = qn;
291298
icc_node_add(node, provider);
292299

293-
for (j = 0; j < qn->num_links; j++)
294-
icc_link_create(node, qn->links[j]);
300+
for (j = 0; j < qn->num_links; j++) {
301+
if (desc->alloc_dyn_id)
302+
icc_link_nodes(node, &qn->link_nodes[j]->node);
303+
else
304+
icc_link_create(node, qn->links[j]);
305+
}
295306

296307
data->nodes[i] = node;
297308
}

drivers/interconnect/qcom/icc-rpmh.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ struct qcom_icc_qosbox {
8383
* @name: the node name used in debugfs
8484
* @links: an array of nodes where we can go next while traversing
8585
* @id: a unique node identifier
86+
* @link_nodes: links associated with this node
87+
* @node: icc_node associated with this node
8688
* @num_links: the total number of @links
8789
* @channels: num of channels at this node
8890
* @buswidth: width of the interconnect between a node and the bus
@@ -96,6 +98,8 @@ struct qcom_icc_node {
9698
const char *name;
9799
u16 links[MAX_LINKS];
98100
u16 id;
101+
struct qcom_icc_node **link_nodes;
102+
struct icc_node *node;
99103
u16 num_links;
100104
u16 channels;
101105
u16 buswidth;
@@ -154,6 +158,7 @@ struct qcom_icc_desc {
154158
struct qcom_icc_bcm * const *bcms;
155159
size_t num_bcms;
156160
bool qos_requires_clocks;
161+
bool alloc_dyn_id;
157162
};
158163

159164
int qcom_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw,

0 commit comments

Comments
 (0)