1

interconnect fixes for v6.9-rc

Here are fixes for two reported issues. One of them is a fix for
 a driver that tries to access a non-existent resource which prints
 a warning message during boot. The other one is fixing a race
 condition in the core framework where one struct member has been
 left unprotected by mutex.
 
 - interconnect: qcom: x1e80100: Remove inexistent ACV_PERF BCM
 - interconnect: Don't access req_list while it's being manipulated
 
 Signed-off-by: Georgi Djakov <djakov@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJmBWPGAAoJEIDQzArG2BZj5EIP/im57/L6BX3IfvoS+2y3xrxD
 p8AzJnFxuiqPH1azaN9jvqH0iMNfb6ysjYklweCRbxPG0PuODeZq44SLTRbl8eF7
 YR31G/AYTftM7AZcVRiJZ+CCqFruE4g91wVTKMhnmUKH8VhQDz0bwP7S94ym5Ps2
 CUsnXa7fjoFp/Qp/uxWvr+cLD3foKj6EdSNuDYuv+ClmDOU7lUZ3jE6khDe4FioS
 9KjRVaaEO+kBC8nMOFUk/JEyxKOPpD8GItqrppkeC917gAO/2D5FL7/uO4BsU10n
 4a2X+CEr44k4KN6BXpGh/lc3PRhFjEiNYUdTLJMBCytfNALhnO58LGfkWdENiBEn
 yPpXLalJOz9wgAENS06LI52rF0LyU8kS2/QO2k9oC7WvTW8uttaCgEzUeSyxq2CO
 FUAeA0+y9uYIg7l6Zotpcl4i5CAV4A1w3zloIAGpFolnZ/YiGb0xNNp7OXu8pb86
 Kgz16jiH+HecO8RMlHkT4r7SnSKOaDtOscF5SKP7/6afhWYa5K4c4ECQXlCaAndj
 m0h70+rCAQ8GP77GGMtQQgMaycFnr2G67kvalAe7DYuI9OVg8XZMBWLWVUpb5Hch
 Kdm4bIyjHWPz79df7JweErj64hZeXsY55ggwjho5SPCPcxyZvjSDGDo9h/0RB/lq
 Jyl1o3DyBb/0ZDdTJrTg
 =FkyX
 -----END PGP SIGNATURE-----

Merge tag 'icc-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-work-linus

Georgi writes:

interconnect fixes for v6.9-rc

Here are fixes for two reported issues. One of them is a fix for
a driver that tries to access a non-existent resource which prints
a warning message during boot. The other one is fixing a race
condition in the core framework where one struct member has been
left unprotected by mutex.

- interconnect: qcom: x1e80100: Remove inexistent ACV_PERF BCM
- interconnect: Don't access req_list while it's being manipulated

Signed-off-by: Georgi Djakov <djakov@kernel.org>

* tag 'icc-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc:
  interconnect: Don't access req_list while it's being manipulated
  interconnect: qcom: x1e80100: Remove inexistent ACV_PERF BCM
This commit is contained in:
Greg Kroah-Hartman 2024-04-11 14:44:49 +02:00
commit 64fe9a8f9f
2 changed files with 8 additions and 26 deletions

View File

@ -176,6 +176,8 @@ static struct icc_path *path_init(struct device *dev, struct icc_node *dst,
path->num_nodes = num_nodes; path->num_nodes = num_nodes;
mutex_lock(&icc_bw_lock);
for (i = num_nodes - 1; i >= 0; i--) { for (i = num_nodes - 1; i >= 0; i--) {
node->provider->users++; node->provider->users++;
hlist_add_head(&path->reqs[i].req_node, &node->req_list); hlist_add_head(&path->reqs[i].req_node, &node->req_list);
@ -186,6 +188,8 @@ static struct icc_path *path_init(struct device *dev, struct icc_node *dst,
node = node->reverse; node = node->reverse;
} }
mutex_unlock(&icc_bw_lock);
return path; return path;
} }
@ -792,12 +796,16 @@ void icc_put(struct icc_path *path)
pr_err("%s: error (%d)\n", __func__, ret); pr_err("%s: error (%d)\n", __func__, ret);
mutex_lock(&icc_lock); mutex_lock(&icc_lock);
mutex_lock(&icc_bw_lock);
for (i = 0; i < path->num_nodes; i++) { for (i = 0; i < path->num_nodes; i++) {
node = path->reqs[i].node; node = path->reqs[i].node;
hlist_del(&path->reqs[i].req_node); hlist_del(&path->reqs[i].req_node);
if (!WARN_ON(!node->provider->users)) if (!WARN_ON(!node->provider->users))
node->provider->users--; node->provider->users--;
} }
mutex_unlock(&icc_bw_lock);
mutex_unlock(&icc_lock); mutex_unlock(&icc_lock);
kfree_const(path->name); kfree_const(path->name);

View File

@ -116,15 +116,6 @@ static struct qcom_icc_node xm_sdc2 = {
.links = { X1E80100_SLAVE_A2NOC_SNOC }, .links = { X1E80100_SLAVE_A2NOC_SNOC },
}; };
static struct qcom_icc_node ddr_perf_mode_master = {
.name = "ddr_perf_mode_master",
.id = X1E80100_MASTER_DDR_PERF_MODE,
.channels = 1,
.buswidth = 4,
.num_links = 1,
.links = { X1E80100_SLAVE_DDR_PERF_MODE },
};
static struct qcom_icc_node qup0_core_master = { static struct qcom_icc_node qup0_core_master = {
.name = "qup0_core_master", .name = "qup0_core_master",
.id = X1E80100_MASTER_QUP_CORE_0, .id = X1E80100_MASTER_QUP_CORE_0,
@ -688,14 +679,6 @@ static struct qcom_icc_node qns_a2noc_snoc = {
.links = { X1E80100_MASTER_A2NOC_SNOC }, .links = { X1E80100_MASTER_A2NOC_SNOC },
}; };
static struct qcom_icc_node ddr_perf_mode_slave = {
.name = "ddr_perf_mode_slave",
.id = X1E80100_SLAVE_DDR_PERF_MODE,
.channels = 1,
.buswidth = 4,
.num_links = 0,
};
static struct qcom_icc_node qup0_core_slave = { static struct qcom_icc_node qup0_core_slave = {
.name = "qup0_core_slave", .name = "qup0_core_slave",
.id = X1E80100_SLAVE_QUP_CORE_0, .id = X1E80100_SLAVE_QUP_CORE_0,
@ -1377,12 +1360,6 @@ static struct qcom_icc_bcm bcm_acv = {
.nodes = { &ebi }, .nodes = { &ebi },
}; };
static struct qcom_icc_bcm bcm_acv_perf = {
.name = "ACV_PERF",
.num_nodes = 1,
.nodes = { &ddr_perf_mode_slave },
};
static struct qcom_icc_bcm bcm_ce0 = { static struct qcom_icc_bcm bcm_ce0 = {
.name = "CE0", .name = "CE0",
.num_nodes = 1, .num_nodes = 1,
@ -1583,18 +1560,15 @@ static const struct qcom_icc_desc x1e80100_aggre2_noc = {
}; };
static struct qcom_icc_bcm * const clk_virt_bcms[] = { static struct qcom_icc_bcm * const clk_virt_bcms[] = {
&bcm_acv_perf,
&bcm_qup0, &bcm_qup0,
&bcm_qup1, &bcm_qup1,
&bcm_qup2, &bcm_qup2,
}; };
static struct qcom_icc_node * const clk_virt_nodes[] = { static struct qcom_icc_node * const clk_virt_nodes[] = {
[MASTER_DDR_PERF_MODE] = &ddr_perf_mode_master,
[MASTER_QUP_CORE_0] = &qup0_core_master, [MASTER_QUP_CORE_0] = &qup0_core_master,
[MASTER_QUP_CORE_1] = &qup1_core_master, [MASTER_QUP_CORE_1] = &qup1_core_master,
[MASTER_QUP_CORE_2] = &qup2_core_master, [MASTER_QUP_CORE_2] = &qup2_core_master,
[SLAVE_DDR_PERF_MODE] = &ddr_perf_mode_slave,
[SLAVE_QUP_CORE_0] = &qup0_core_slave, [SLAVE_QUP_CORE_0] = &qup0_core_slave,
[SLAVE_QUP_CORE_1] = &qup1_core_slave, [SLAVE_QUP_CORE_1] = &qup1_core_slave,
[SLAVE_QUP_CORE_2] = &qup2_core_slave, [SLAVE_QUP_CORE_2] = &qup2_core_slave,