Skip to content

Commit ce5a595

Browse files
Mike TiptonGeorgi Djakov
authored andcommitted
interconnect: qcom: icc-rpmh: Ensure floor BW is enforced for all nodes
We currently only enforce BW floors for a subset of nodes in a path. All BCMs that need updating are queued in the pre_aggregate/aggregate phase. The first set() commits all queued BCMs and subsequent set() calls short-circuit without committing anything. Since the floor BW isn't set in sum_avg/max_peak until set(), then some BCMs are committed before their associated nodes reflect the floor. Set the floor as each node is being aggregated. This ensures that all all relevant floors are set before the BCMs are committed. Fixes: 266cd33 ("interconnect: qcom: Ensure that the floor bandwidth value is enforced") Signed-off-by: Mike Tipton <[email protected]> Link: https://lore.kernel.org/r/[email protected] [georgi: Removed unused variable] Signed-off-by: Georgi Djakov <[email protected]>
1 parent 73606ba commit ce5a595

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/interconnect/qcom/icc-rpmh.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ int qcom_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw,
5757
qn->sum_avg[i] += avg_bw;
5858
qn->max_peak[i] = max_t(u32, qn->max_peak[i], peak_bw);
5959
}
60+
61+
if (node->init_avg || node->init_peak) {
62+
qn->sum_avg[i] = max_t(u64, qn->sum_avg[i], node->init_avg);
63+
qn->max_peak[i] = max_t(u64, qn->max_peak[i], node->init_peak);
64+
}
6065
}
6166

6267
*agg_avg += avg_bw;
@@ -79,7 +84,6 @@ EXPORT_SYMBOL_GPL(qcom_icc_aggregate);
7984
int qcom_icc_set(struct icc_node *src, struct icc_node *dst)
8085
{
8186
struct qcom_icc_provider *qp;
82-
struct qcom_icc_node *qn;
8387
struct icc_node *node;
8488

8589
if (!src)
@@ -88,12 +92,6 @@ int qcom_icc_set(struct icc_node *src, struct icc_node *dst)
8892
node = src;
8993

9094
qp = to_qcom_provider(node->provider);
91-
qn = node->data;
92-
93-
qn->sum_avg[QCOM_ICC_BUCKET_AMC] = max_t(u64, qn->sum_avg[QCOM_ICC_BUCKET_AMC],
94-
node->avg_bw);
95-
qn->max_peak[QCOM_ICC_BUCKET_AMC] = max_t(u64, qn->max_peak[QCOM_ICC_BUCKET_AMC],
96-
node->peak_bw);
9795

9896
qcom_icc_bcm_voter_commit(qp->voter);
9997

0 commit comments

Comments
 (0)