Skip to content

Commit 8b819af

Browse files
committed
Merge tag 'icc-6.16-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-next
Georgi writes: interconnect changes for 6.16 This pull request contains the interconnect changes for the 6.16-rc1 merge window. The core and driver changes are listed below. Core changes: - Add support for dynamic id allocation, that allows creating multiple instances of the same provider Driver changes: - Add driver for the EPSS L3 instances on SA8775P SoC - Add QoS support for SM8650 SoC - Add some missing nodes for SM8650 - Misc dt-binding style and indentation fixes Signed-off-by: Georgi Djakov <[email protected]> * tag 'icc-6.16-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/djakov/icc: interconnect: qcom: sm8650: remove regmap config for mc_virt & clk_virt interconnect: qcom: sm8650: add the MASTER_APSS_NOC dt-bindings: interconnect: sm8650: document the MASTER_APSS_NOC interconnect: qcom: sm8650: enable QoS configuration dt-bindings: interconnect: Correct indentation and style in DTS example interconnect: qcom: sa8775p: Add dynamic icc node id support interconnect: qcom: icc-rpmh: Add dynamic icc node id support interconnect: qcom: Add multidev EPSS L3 support interconnect: core: Add dynamic id allocation support dt-bindings: interconnect: Add EPSS L3 compatible for SA8775P
2 parents bdc319f + 5fed7fe commit 8b819af

File tree

17 files changed

+873
-687
lines changed

17 files changed

+873
-687
lines changed

Documentation/devicetree/bindings/interconnect/qcom,msm8939.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ examples:
7070
reg = <0x00580000 0x14000>;
7171
#interconnect-cells = <1>;
7272
73-
snoc_mm: interconnect-snoc {
74-
compatible = "qcom,msm8939-snoc-mm";
75-
#interconnect-cells = <1>;
76-
};
73+
snoc_mm: interconnect-snoc {
74+
compatible = "qcom,msm8939-snoc-mm";
75+
#interconnect-cells = <1>;
76+
};
7777
};

Documentation/devicetree/bindings/interconnect/qcom,msm8953.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,17 @@ additionalProperties: false
8484

8585
examples:
8686
- |
87-
#include <dt-bindings/clock/qcom,gcc-msm8953.h>
87+
#include <dt-bindings/clock/qcom,gcc-msm8953.h>
8888
89-
snoc: interconnect@580000 {
90-
compatible = "qcom,msm8953-snoc";
91-
reg = <0x580000 0x16080>;
89+
interconnect@580000 {
90+
compatible = "qcom,msm8953-snoc";
91+
reg = <0x580000 0x16080>;
9292
93-
#interconnect-cells = <2>;
93+
#interconnect-cells = <2>;
9494
95-
snoc_mm: interconnect-snoc {
96-
compatible = "qcom,msm8953-snoc-mm";
95+
interconnect-snoc {
96+
compatible = "qcom,msm8953-snoc-mm";
9797
98-
#interconnect-cells = <2>;
99-
};
100-
};
98+
#interconnect-cells = <2>;
99+
};
100+
};

Documentation/devicetree/bindings/interconnect/qcom,msm8974.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ additionalProperties: false
5050

5151
examples:
5252
- |
53-
#include <dt-bindings/clock/qcom,rpmcc.h>
54-
55-
bimc: interconnect@fc380000 {
56-
reg = <0xfc380000 0x6a000>;
57-
compatible = "qcom,msm8974-bimc";
58-
#interconnect-cells = <1>;
59-
clock-names = "bus", "bus_a";
60-
clocks = <&rpmcc RPM_SMD_BIMC_CLK>,
61-
<&rpmcc RPM_SMD_BIMC_A_CLK>;
62-
};
53+
#include <dt-bindings/clock/qcom,rpmcc.h>
54+
55+
interconnect@fc380000 {
56+
reg = <0xfc380000 0x6a000>;
57+
compatible = "qcom,msm8974-bimc";
58+
#interconnect-cells = <1>;
59+
clock-names = "bus", "bus_a";
60+
clocks = <&rpmcc RPM_SMD_BIMC_CLK>,
61+
<&rpmcc RPM_SMD_BIMC_A_CLK>;
62+
};

Documentation/devicetree/bindings/interconnect/qcom,osm-l3.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ properties:
2828
- const: qcom,osm-l3
2929
- items:
3030
- enum:
31+
- qcom,sa8775p-epss-l3
3132
- qcom,sc7280-epss-l3
3233
- qcom,sc8280xp-epss-l3
3334
- qcom,sm6375-cpucp-l3

Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ unevaluatedProperties: false
4141

4242
examples:
4343
- |
44-
#include <dt-bindings/clock/qcom,rpmcc.h>
44+
#include <dt-bindings/clock/qcom,rpmcc.h>
4545
46-
bimc: interconnect@400000 {
47-
compatible = "qcom,msm8916-bimc";
48-
reg = <0x00400000 0x62000>;
49-
#interconnect-cells = <1>;
50-
};
46+
interconnect@400000 {
47+
compatible = "qcom,msm8916-bimc";
48+
reg = <0x00400000 0x62000>;
49+
#interconnect-cells = <1>;
50+
};

Documentation/devicetree/bindings/interconnect/qcom,rpmh.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,19 @@ unevaluatedProperties: false
127127

128128
examples:
129129
- |
130-
#include <dt-bindings/interconnect/qcom,sdm845.h>
130+
#include <dt-bindings/interconnect/qcom,sdm845.h>
131131
132-
mem_noc: interconnect@1380000 {
133-
compatible = "qcom,sdm845-mem-noc";
134-
reg = <0x01380000 0x27200>;
135-
#interconnect-cells = <1>;
136-
qcom,bcm-voters = <&apps_bcm_voter>;
137-
};
132+
interconnect@1380000 {
133+
compatible = "qcom,sdm845-mem-noc";
134+
reg = <0x01380000 0x27200>;
135+
#interconnect-cells = <1>;
136+
qcom,bcm-voters = <&apps_bcm_voter>;
137+
};
138138
139-
mmss_noc: interconnect@1740000 {
140-
compatible = "qcom,sdm845-mmss-noc";
141-
reg = <0x01740000 0x1c1000>;
142-
#interconnect-cells = <1>;
143-
qcom,bcm-voter-names = "apps", "disp";
144-
qcom,bcm-voters = <&apps_bcm_voter>, <&disp_bcm_voter>;
145-
};
139+
interconnect@1740000 {
140+
compatible = "qcom,sdm845-mmss-noc";
141+
reg = <0x01740000 0x1c1000>;
142+
#interconnect-cells = <1>;
143+
qcom,bcm-voter-names = "apps", "disp";
144+
qcom,bcm-voters = <&apps_bcm_voter>, <&disp_bcm_voter>;
145+
};

Documentation/devicetree/bindings/interconnect/qcom,sdx75-rpmh.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ examples:
7878
#include <dt-bindings/clock/qcom,rpmh.h>
7979
8080
clk_virt: interconnect-0 {
81-
compatible = "qcom,sdx75-clk-virt";
82-
#interconnect-cells = <2>;
83-
qcom,bcm-voters = <&apps_bcm_voter>;
84-
clocks = <&rpmhcc RPMH_QPIC_CLK>;
81+
compatible = "qcom,sdx75-clk-virt";
82+
#interconnect-cells = <2>;
83+
qcom,bcm-voters = <&apps_bcm_voter>;
84+
clocks = <&rpmhcc RPMH_QPIC_CLK>;
8585
};
8686
8787
system_noc: interconnect@1640000 {
88-
compatible = "qcom,sdx75-system-noc";
89-
reg = <0x1640000 0x4b400>;
90-
#interconnect-cells = <2>;
91-
qcom,bcm-voters = <&apps_bcm_voter>;
88+
compatible = "qcom,sdx75-system-noc";
89+
reg = <0x1640000 0x4b400>;
90+
#interconnect-cells = <2>;
91+
qcom,bcm-voters = <&apps_bcm_voter>;
9292
};

drivers/interconnect/core.c

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
#include "internal.h"
2222

23+
#define ICC_DYN_ID_START 10000
24+
2325
#define CREATE_TRACE_POINTS
2426
#include "trace.h"
2527

@@ -826,7 +828,12 @@ static struct icc_node *icc_node_create_nolock(int id)
826828
if (!node)
827829
return ERR_PTR(-ENOMEM);
828830

829-
id = idr_alloc(&icc_idr, node, id, id + 1, GFP_KERNEL);
831+
/* dynamic id allocation */
832+
if (id == ICC_ALLOC_DYN_ID)
833+
id = idr_alloc(&icc_idr, node, ICC_DYN_ID_START, 0, GFP_KERNEL);
834+
else
835+
id = idr_alloc(&icc_idr, node, id, id + 1, GFP_KERNEL);
836+
830837
if (id < 0) {
831838
WARN(1, "%s: couldn't get idr\n", __func__);
832839
kfree(node);
@@ -838,6 +845,25 @@ static struct icc_node *icc_node_create_nolock(int id)
838845
return node;
839846
}
840847

848+
/**
849+
* icc_node_create_dyn() - create a node with dynamic id
850+
*
851+
* Return: icc_node pointer on success, or ERR_PTR() on error
852+
*/
853+
struct icc_node *icc_node_create_dyn(void)
854+
{
855+
struct icc_node *node;
856+
857+
mutex_lock(&icc_lock);
858+
859+
node = icc_node_create_nolock(ICC_ALLOC_DYN_ID);
860+
861+
mutex_unlock(&icc_lock);
862+
863+
return node;
864+
}
865+
EXPORT_SYMBOL_GPL(icc_node_create_dyn);
866+
841867
/**
842868
* icc_node_create() - create a node
843869
* @id: node id
@@ -884,6 +910,56 @@ void icc_node_destroy(int id)
884910
}
885911
EXPORT_SYMBOL_GPL(icc_node_destroy);
886912

913+
/**
914+
* icc_link_nodes() - create link between two nodes
915+
* @src_node: source node
916+
* @dst_node: destination node
917+
*
918+
* Create a link between two nodes. The nodes might belong to different
919+
* interconnect providers and the @dst_node might not exist (if the
920+
* provider driver has not probed yet). So just create the @dst_node
921+
* and when the actual provider driver is probed, the rest of the node
922+
* data is filled.
923+
*
924+
* Return: 0 on success, or an error code otherwise
925+
*/
926+
int icc_link_nodes(struct icc_node *src_node, struct icc_node **dst_node)
927+
{
928+
struct icc_node **new;
929+
int ret = 0;
930+
931+
if (!src_node->provider)
932+
return -EINVAL;
933+
934+
mutex_lock(&icc_lock);
935+
936+
if (!*dst_node) {
937+
*dst_node = icc_node_create_nolock(ICC_ALLOC_DYN_ID);
938+
939+
if (IS_ERR(*dst_node)) {
940+
ret = PTR_ERR(*dst_node);
941+
goto out;
942+
}
943+
}
944+
945+
new = krealloc(src_node->links,
946+
(src_node->num_links + 1) * sizeof(*src_node->links),
947+
GFP_KERNEL);
948+
if (!new) {
949+
ret = -ENOMEM;
950+
goto out;
951+
}
952+
953+
src_node->links = new;
954+
src_node->links[src_node->num_links++] = *dst_node;
955+
956+
out:
957+
mutex_unlock(&icc_lock);
958+
959+
return ret;
960+
}
961+
EXPORT_SYMBOL_GPL(icc_link_nodes);
962+
887963
/**
888964
* icc_link_create() - create a link between two nodes
889965
* @node: source node id
@@ -962,6 +1038,10 @@ void icc_node_add(struct icc_node *node, struct icc_provider *provider)
9621038
node->avg_bw = node->init_avg;
9631039
node->peak_bw = node->init_peak;
9641040

1041+
if (node->id >= ICC_DYN_ID_START)
1042+
node->name = devm_kasprintf(provider->dev, GFP_KERNEL, "%s@%s",
1043+
node->name, dev_name(provider->dev));
1044+
9651045
if (node->avg_bw || node->peak_bw) {
9661046
if (provider->pre_aggregate)
9671047
provider->pre_aggregate(node);

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)