Skip to content

Commit

Permalink
interconnect: qcom: icc-rpmh: Add BCMs to commit list in pre_aggregate
Browse files Browse the repository at this point in the history
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 <[email protected]>
[georgi: remove icc_sync_state for platforms with incomplete support]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Georgi Djakov <[email protected]>
  • Loading branch information
Mike Tipton authored and Georgi Djakov committed Nov 30, 2021
1 parent fa55b7d commit b95b668
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
10 changes: 5 additions & 5 deletions drivers/interconnect/qcom/icc-rpmh.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,18 @@ void qcom_icc_pre_aggregate(struct icc_node *node)
{
size_t i;
struct qcom_icc_node *qn;
struct qcom_icc_provider *qp;

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

for (i = 0; i < QCOM_ICC_NUM_BUCKETS; i++) {
qn->sum_avg[i] = 0;
qn->max_peak[i] = 0;
}

for (i = 0; i < qn->num_bcms; i++)
qcom_icc_bcm_voter_add(qp->voter, qn->bcms[i]);
}
EXPORT_SYMBOL_GPL(qcom_icc_pre_aggregate);

Expand All @@ -45,10 +50,8 @@ int qcom_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw,
{
size_t i;
struct qcom_icc_node *qn;
struct qcom_icc_provider *qp;

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

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

for (i = 0; i < qn->num_bcms; i++)
qcom_icc_bcm_voter_add(qp->voter, qn->bcms[i]);

return 0;
}
EXPORT_SYMBOL_GPL(qcom_icc_aggregate);
Expand Down
1 change: 0 additions & 1 deletion drivers/interconnect/qcom/sm8150.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@ static struct platform_driver qnoc_driver = {
.driver = {
.name = "qnoc-sm8150",
.of_match_table = qnoc_of_match,
.sync_state = icc_sync_state,
},
};
module_platform_driver(qnoc_driver);
Expand Down
1 change: 0 additions & 1 deletion drivers/interconnect/qcom/sm8250.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,6 @@ static struct platform_driver qnoc_driver = {
.driver = {
.name = "qnoc-sm8250",
.of_match_table = qnoc_of_match,
.sync_state = icc_sync_state,
},
};
module_platform_driver(qnoc_driver);
Expand Down
1 change: 0 additions & 1 deletion drivers/interconnect/qcom/sm8350.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,6 @@ static struct platform_driver qnoc_driver = {
.driver = {
.name = "qnoc-sm8350",
.of_match_table = qnoc_of_match,
.sync_state = icc_sync_state,
},
};
module_platform_driver(qnoc_driver);
Expand Down

0 comments on commit b95b668

Please sign in to comment.