Commit b27eda5c authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'icc-5.9-rc4' of https://git.linaro.org/people/georgi.djakov/linux into char-misc-linus

Georgi writes:

interconnect fixes for v5.9

This contains two fixes:
- Fix the core to show correctly the bandwidth for disabled paths.
- Fix a driver to make sure small values are not truncated.
Signed-off-by: default avatarGeorgi Djakov <georgi.djakov@linaro.org>

* tag 'icc-5.9-rc4' of https://git.linaro.org/people/georgi.djakov/linux:
  interconnect: qcom: Fix small BW votes being truncated to zero
  interconnect: Show bandwidth for disabled paths as zero in debugfs
parents e22a2205 91e045b9
...@@ -55,12 +55,18 @@ static int icc_summary_show(struct seq_file *s, void *data) ...@@ -55,12 +55,18 @@ static int icc_summary_show(struct seq_file *s, void *data)
icc_summary_show_one(s, n); icc_summary_show_one(s, n);
hlist_for_each_entry(r, &n->req_list, req_node) { hlist_for_each_entry(r, &n->req_list, req_node) {
u32 avg_bw = 0, peak_bw = 0;
if (!r->dev) if (!r->dev)
continue; continue;
if (r->enabled) {
avg_bw = r->avg_bw;
peak_bw = r->peak_bw;
}
seq_printf(s, " %-27s %12u %12u %12u\n", seq_printf(s, " %-27s %12u %12u %12u\n",
dev_name(r->dev), r->tag, r->avg_bw, dev_name(r->dev), r->tag, avg_bw, peak_bw);
r->peak_bw);
} }
} }
} }
......
...@@ -52,8 +52,20 @@ static int cmp_vcd(void *priv, struct list_head *a, struct list_head *b) ...@@ -52,8 +52,20 @@ static int cmp_vcd(void *priv, struct list_head *a, struct list_head *b)
return 1; return 1;
} }
static u64 bcm_div(u64 num, u32 base)
{
/* Ensure that small votes aren't lost. */
if (num && num < base)
return 1;
do_div(num, base);
return num;
}
static void bcm_aggregate(struct qcom_icc_bcm *bcm) static void bcm_aggregate(struct qcom_icc_bcm *bcm)
{ {
struct qcom_icc_node *node;
size_t i, bucket; size_t i, bucket;
u64 agg_avg[QCOM_ICC_NUM_BUCKETS] = {0}; u64 agg_avg[QCOM_ICC_NUM_BUCKETS] = {0};
u64 agg_peak[QCOM_ICC_NUM_BUCKETS] = {0}; u64 agg_peak[QCOM_ICC_NUM_BUCKETS] = {0};
...@@ -61,22 +73,21 @@ static void bcm_aggregate(struct qcom_icc_bcm *bcm) ...@@ -61,22 +73,21 @@ static void bcm_aggregate(struct qcom_icc_bcm *bcm)
for (bucket = 0; bucket < QCOM_ICC_NUM_BUCKETS; bucket++) { for (bucket = 0; bucket < QCOM_ICC_NUM_BUCKETS; bucket++) {
for (i = 0; i < bcm->num_nodes; i++) { for (i = 0; i < bcm->num_nodes; i++) {
temp = bcm->nodes[i]->sum_avg[bucket] * bcm->aux_data.width; node = bcm->nodes[i];
do_div(temp, bcm->nodes[i]->buswidth * bcm->nodes[i]->channels); temp = bcm_div(node->sum_avg[bucket] * bcm->aux_data.width,
node->buswidth * node->channels);
agg_avg[bucket] = max(agg_avg[bucket], temp); agg_avg[bucket] = max(agg_avg[bucket], temp);
temp = bcm->nodes[i]->max_peak[bucket] * bcm->aux_data.width; temp = bcm_div(node->max_peak[bucket] * bcm->aux_data.width,
do_div(temp, bcm->nodes[i]->buswidth); node->buswidth);
agg_peak[bucket] = max(agg_peak[bucket], temp); agg_peak[bucket] = max(agg_peak[bucket], temp);
} }
temp = agg_avg[bucket] * 1000ULL; temp = agg_avg[bucket] * 1000ULL;
do_div(temp, bcm->aux_data.unit); bcm->vote_x[bucket] = bcm_div(temp, bcm->aux_data.unit);
bcm->vote_x[bucket] = temp;
temp = agg_peak[bucket] * 1000ULL; temp = agg_peak[bucket] * 1000ULL;
do_div(temp, bcm->aux_data.unit); bcm->vote_y[bucket] = bcm_div(temp, bcm->aux_data.unit);
bcm->vote_y[bucket] = temp;
} }
if (bcm->keepalive && bcm->vote_x[QCOM_ICC_BUCKET_AMC] == 0 && if (bcm->keepalive && bcm->vote_x[QCOM_ICC_BUCKET_AMC] == 0 &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment