Skip to content

Commit b95b668

Browse files
Mike TiptonGeorgi Djakov
authored andcommitted
interconnect: qcom: icc-rpmh: Add BCMs to commit list in pre_aggregate
We're only adding BCMs to the commit list in aggregate(), but there are cases where pre_aggregate() is called without subsequently calling aggregate(). In particular, in icc_sync_state() when a node with initial BW has zero requests. Since BCMs aren't added to the commit list in these cases, we don't actually send the zero BW request to HW. So the resources remain on unnecessarily. Add BCMs to the commit list in pre_aggregate() instead, which is always called even when there are no requests. Signed-off-by: Mike Tipton <mdtipton@codeaurora.org> [georgi: remove icc_sync_state for platforms with incomplete support] Link: https://lore.kernel.org/r/20211125174751.25317-1-djakov@kernel.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
1 parent fa55b7d commit b95b668

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

drivers/interconnect/qcom/icc-rpmh.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,18 @@ void qcom_icc_pre_aggregate(struct icc_node *node)
2121
{
2222
size_t i;
2323
struct qcom_icc_node *qn;
24+
struct qcom_icc_provider *qp;
2425

2526
qn = node->data;
27+
qp = to_qcom_provider(node->provider);
2628

2729
for (i = 0; i < QCOM_ICC_NUM_BUCKETS; i++) {
2830
qn->sum_avg[i] = 0;
2931
qn->max_peak[i] = 0;
3032
}
33+
34+
for (i = 0; i < qn->num_bcms; i++)
35+
qcom_icc_bcm_voter_add(qp->voter, qn->bcms[i]);
3136
}
3237
EXPORT_SYMBOL_GPL(qcom_icc_pre_aggregate);
3338

@@ -45,10 +50,8 @@ int qcom_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw,
4550
{
4651
size_t i;
4752
struct qcom_icc_node *qn;
48-
struct qcom_icc_provider *qp;
4953

5054
qn = node->data;
51-
qp = to_qcom_provider(node->provider);
5255

5356
if (!tag)
5457
tag = QCOM_ICC_TAG_ALWAYS;
@@ -68,9 +71,6 @@ int qcom_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw,
6871
*agg_avg += avg_bw;
6972
*agg_peak = max_t(u32, *agg_peak, peak_bw);
7073

71-
for (i = 0; i < qn->num_bcms; i++)
72-
qcom_icc_bcm_voter_add(qp->voter, qn->bcms[i]);
73-
7474
return 0;
7575
}
7676
EXPORT_SYMBOL_GPL(qcom_icc_aggregate);

drivers/interconnect/qcom/sm8150.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,6 @@ static struct platform_driver qnoc_driver = {
535535
.driver = {
536536
.name = "qnoc-sm8150",
537537
.of_match_table = qnoc_of_match,
538-
.sync_state = icc_sync_state,
539538
},
540539
};
541540
module_platform_driver(qnoc_driver);

drivers/interconnect/qcom/sm8250.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,6 @@ static struct platform_driver qnoc_driver = {
551551
.driver = {
552552
.name = "qnoc-sm8250",
553553
.of_match_table = qnoc_of_match,
554-
.sync_state = icc_sync_state,
555554
},
556555
};
557556
module_platform_driver(qnoc_driver);

drivers/interconnect/qcom/sm8350.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,6 @@ static struct platform_driver qnoc_driver = {
531531
.driver = {
532532
.name = "qnoc-sm8350",
533533
.of_match_table = qnoc_of_match,
534-
.sync_state = icc_sync_state,
535534
},
536535
};
537536
module_platform_driver(qnoc_driver);

0 commit comments

Comments
 (0)