Skip to content

Commit 8bf5d31

Browse files
anderssonGeorgi Djakov
authored andcommitted
interconnect: qcom: osm-l3: Use driver-specific naming
In situations were the developer screws up by e.g. not giving the OSM nodes unique identifiers the interconnect framework might mix up nodes between the OSM L3 provider and e.g. the RPMh provider. The resulting callstack contains "qcom_icc_set", which is not unique to the OSM L3 provider driver. Once the faulting qcom_icc_set() is identified it's further confusing that "qcom_icc_node" is different between the different drivers. To avoid this confusion, rename the node struct and the setter in the OSM L3 driver to include "osm_l3" in their names. Signed-off-by: Bjorn Andersson <[email protected]> Tested-by: Steev Klimaszewski <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Georgi Djakov <[email protected]>
1 parent ffef0b1 commit 8bf5d31

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

drivers/interconnect/qcom/osm-l3.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
#define OSM_L3_MAX_LINKS 1
4040

41-
#define to_qcom_provider(_provider) \
41+
#define to_osm_l3_provider(_provider) \
4242
container_of(_provider, struct qcom_osm_l3_icc_provider, provider)
4343

4444
struct qcom_osm_l3_icc_provider {
@@ -50,31 +50,31 @@ struct qcom_osm_l3_icc_provider {
5050
};
5151

5252
/**
53-
* struct qcom_icc_node - Qualcomm specific interconnect nodes
53+
* struct qcom_osm_l3_node - Qualcomm specific interconnect nodes
5454
* @name: the node name used in debugfs
5555
* @links: an array of nodes where we can go next while traversing
5656
* @id: a unique node identifier
5757
* @num_links: the total number of @links
5858
* @buswidth: width of the interconnect between a node and the bus
5959
*/
60-
struct qcom_icc_node {
60+
struct qcom_osm_l3_node {
6161
const char *name;
6262
u16 links[OSM_L3_MAX_LINKS];
6363
u16 id;
6464
u16 num_links;
6565
u16 buswidth;
6666
};
6767

68-
struct qcom_icc_desc {
69-
const struct qcom_icc_node **nodes;
68+
struct qcom_osm_l3_desc {
69+
const struct qcom_osm_l3_node **nodes;
7070
size_t num_nodes;
7171
unsigned int lut_row_size;
7272
unsigned int reg_freq_lut;
7373
unsigned int reg_perf_state;
7474
};
7575

7676
#define DEFINE_QNODE(_name, _id, _buswidth, ...) \
77-
static const struct qcom_icc_node _name = { \
77+
static const struct qcom_osm_l3_node _name = { \
7878
.name = #_name, \
7979
.id = _id, \
8080
.buswidth = _buswidth, \
@@ -85,12 +85,12 @@ struct qcom_icc_desc {
8585
DEFINE_QNODE(sdm845_osm_apps_l3, SDM845_MASTER_OSM_L3_APPS, 16, SDM845_SLAVE_OSM_L3);
8686
DEFINE_QNODE(sdm845_osm_l3, SDM845_SLAVE_OSM_L3, 16);
8787

88-
static const struct qcom_icc_node *sdm845_osm_l3_nodes[] = {
88+
static const struct qcom_osm_l3_node *sdm845_osm_l3_nodes[] = {
8989
[MASTER_OSM_L3_APPS] = &sdm845_osm_apps_l3,
9090
[SLAVE_OSM_L3] = &sdm845_osm_l3,
9191
};
9292

93-
static const struct qcom_icc_desc sdm845_icc_osm_l3 = {
93+
static const struct qcom_osm_l3_desc sdm845_icc_osm_l3 = {
9494
.nodes = sdm845_osm_l3_nodes,
9595
.num_nodes = ARRAY_SIZE(sdm845_osm_l3_nodes),
9696
.lut_row_size = OSM_LUT_ROW_SIZE,
@@ -101,12 +101,12 @@ static const struct qcom_icc_desc sdm845_icc_osm_l3 = {
101101
DEFINE_QNODE(sc7180_osm_apps_l3, SC7180_MASTER_OSM_L3_APPS, 16, SC7180_SLAVE_OSM_L3);
102102
DEFINE_QNODE(sc7180_osm_l3, SC7180_SLAVE_OSM_L3, 16);
103103

104-
static const struct qcom_icc_node *sc7180_osm_l3_nodes[] = {
104+
static const struct qcom_osm_l3_node *sc7180_osm_l3_nodes[] = {
105105
[MASTER_OSM_L3_APPS] = &sc7180_osm_apps_l3,
106106
[SLAVE_OSM_L3] = &sc7180_osm_l3,
107107
};
108108

109-
static const struct qcom_icc_desc sc7180_icc_osm_l3 = {
109+
static const struct qcom_osm_l3_desc sc7180_icc_osm_l3 = {
110110
.nodes = sc7180_osm_l3_nodes,
111111
.num_nodes = ARRAY_SIZE(sc7180_osm_l3_nodes),
112112
.lut_row_size = OSM_LUT_ROW_SIZE,
@@ -117,12 +117,12 @@ static const struct qcom_icc_desc sc7180_icc_osm_l3 = {
117117
DEFINE_QNODE(sc8180x_osm_apps_l3, SC8180X_MASTER_OSM_L3_APPS, 32, SC8180X_SLAVE_OSM_L3);
118118
DEFINE_QNODE(sc8180x_osm_l3, SC8180X_SLAVE_OSM_L3, 32);
119119

120-
static const struct qcom_icc_node *sc8180x_osm_l3_nodes[] = {
120+
static const struct qcom_osm_l3_node *sc8180x_osm_l3_nodes[] = {
121121
[MASTER_OSM_L3_APPS] = &sc8180x_osm_apps_l3,
122122
[SLAVE_OSM_L3] = &sc8180x_osm_l3,
123123
};
124124

125-
static const struct qcom_icc_desc sc8180x_icc_osm_l3 = {
125+
static const struct qcom_osm_l3_desc sc8180x_icc_osm_l3 = {
126126
.nodes = sc8180x_osm_l3_nodes,
127127
.num_nodes = ARRAY_SIZE(sc8180x_osm_l3_nodes),
128128
.lut_row_size = OSM_LUT_ROW_SIZE,
@@ -133,12 +133,12 @@ static const struct qcom_icc_desc sc8180x_icc_osm_l3 = {
133133
DEFINE_QNODE(sm8150_osm_apps_l3, SM8150_MASTER_OSM_L3_APPS, 32, SM8150_SLAVE_OSM_L3);
134134
DEFINE_QNODE(sm8150_osm_l3, SM8150_SLAVE_OSM_L3, 32);
135135

136-
static const struct qcom_icc_node *sm8150_osm_l3_nodes[] = {
136+
static const struct qcom_osm_l3_node *sm8150_osm_l3_nodes[] = {
137137
[MASTER_OSM_L3_APPS] = &sm8150_osm_apps_l3,
138138
[SLAVE_OSM_L3] = &sm8150_osm_l3,
139139
};
140140

141-
static const struct qcom_icc_desc sm8150_icc_osm_l3 = {
141+
static const struct qcom_osm_l3_desc sm8150_icc_osm_l3 = {
142142
.nodes = sm8150_osm_l3_nodes,
143143
.num_nodes = ARRAY_SIZE(sm8150_osm_l3_nodes),
144144
.lut_row_size = OSM_LUT_ROW_SIZE,
@@ -149,24 +149,24 @@ static const struct qcom_icc_desc sm8150_icc_osm_l3 = {
149149
DEFINE_QNODE(sm8250_epss_apps_l3, SM8250_MASTER_EPSS_L3_APPS, 32, SM8250_SLAVE_EPSS_L3);
150150
DEFINE_QNODE(sm8250_epss_l3, SM8250_SLAVE_EPSS_L3, 32);
151151

152-
static const struct qcom_icc_node *sm8250_epss_l3_nodes[] = {
152+
static const struct qcom_osm_l3_node *sm8250_epss_l3_nodes[] = {
153153
[MASTER_EPSS_L3_APPS] = &sm8250_epss_apps_l3,
154154
[SLAVE_EPSS_L3_SHARED] = &sm8250_epss_l3,
155155
};
156156

157-
static const struct qcom_icc_desc sm8250_icc_epss_l3 = {
157+
static const struct qcom_osm_l3_desc sm8250_icc_epss_l3 = {
158158
.nodes = sm8250_epss_l3_nodes,
159159
.num_nodes = ARRAY_SIZE(sm8250_epss_l3_nodes),
160160
.lut_row_size = EPSS_LUT_ROW_SIZE,
161161
.reg_freq_lut = EPSS_REG_FREQ_LUT,
162162
.reg_perf_state = EPSS_REG_PERF_STATE,
163163
};
164164

165-
static int qcom_icc_set(struct icc_node *src, struct icc_node *dst)
165+
static int qcom_osm_l3_set(struct icc_node *src, struct icc_node *dst)
166166
{
167167
struct qcom_osm_l3_icc_provider *qp;
168168
struct icc_provider *provider;
169-
const struct qcom_icc_node *qn;
169+
const struct qcom_osm_l3_node *qn;
170170
struct icc_node *n;
171171
unsigned int index;
172172
u32 agg_peak = 0;
@@ -175,7 +175,7 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst)
175175

176176
qn = src->data;
177177
provider = src->provider;
178-
qp = to_qcom_provider(provider);
178+
qp = to_osm_l3_provider(provider);
179179

180180
list_for_each_entry(n, &provider->nodes, node_list)
181181
provider->aggregate(n, 0, n->avg_bw, n->peak_bw,
@@ -208,10 +208,10 @@ static int qcom_osm_l3_probe(struct platform_device *pdev)
208208
u32 info, src, lval, i, prev_freq = 0, freq;
209209
static unsigned long hw_rate, xo_rate;
210210
struct qcom_osm_l3_icc_provider *qp;
211-
const struct qcom_icc_desc *desc;
211+
const struct qcom_osm_l3_desc *desc;
212212
struct icc_onecell_data *data;
213213
struct icc_provider *provider;
214-
const struct qcom_icc_node **qnodes;
214+
const struct qcom_osm_l3_node **qnodes;
215215
struct icc_node *node;
216216
size_t num_nodes;
217217
struct clk *clk;
@@ -281,7 +281,7 @@ static int qcom_osm_l3_probe(struct platform_device *pdev)
281281

282282
provider = &qp->provider;
283283
provider->dev = &pdev->dev;
284-
provider->set = qcom_icc_set;
284+
provider->set = qcom_osm_l3_set;
285285
provider->aggregate = icc_std_aggregate;
286286
provider->xlate = of_icc_xlate_onecell;
287287
INIT_LIST_HEAD(&provider->nodes);
@@ -303,7 +303,7 @@ static int qcom_osm_l3_probe(struct platform_device *pdev)
303303
}
304304

305305
node->name = qnodes[i]->name;
306-
/* Cast away const and add it back in qcom_icc_set() */
306+
/* Cast away const and add it back in qcom_osm_l3_set() */
307307
node->data = (void *)qnodes[i];
308308
icc_node_add(node, provider);
309309

0 commit comments

Comments
 (0)