mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 03:10:30 -04:00
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: Georgi 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
This commit is contained in:
@@ -55,12 +55,18 @@ static int icc_summary_show(struct seq_file *s, void *data)
|
||||
|
||||
icc_summary_show_one(s, n);
|
||||
hlist_for_each_entry(r, &n->req_list, req_node) {
|
||||
u32 avg_bw = 0, peak_bw = 0;
|
||||
|
||||
if (!r->dev)
|
||||
continue;
|
||||
|
||||
if (r->enabled) {
|
||||
avg_bw = r->avg_bw;
|
||||
peak_bw = r->peak_bw;
|
||||
}
|
||||
|
||||
seq_printf(s, " %-27s %12u %12u %12u\n",
|
||||
dev_name(r->dev), r->tag, r->avg_bw,
|
||||
r->peak_bw);
|
||||
dev_name(r->dev), r->tag, avg_bw, peak_bw);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,8 +52,20 @@ static int cmp_vcd(void *priv, struct list_head *a, struct list_head *b)
|
||||
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)
|
||||
{
|
||||
struct qcom_icc_node *node;
|
||||
size_t i, bucket;
|
||||
u64 agg_avg[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)
|
||||
|
||||
for (bucket = 0; bucket < QCOM_ICC_NUM_BUCKETS; bucket++) {
|
||||
for (i = 0; i < bcm->num_nodes; i++) {
|
||||
temp = bcm->nodes[i]->sum_avg[bucket] * bcm->aux_data.width;
|
||||
do_div(temp, bcm->nodes[i]->buswidth * bcm->nodes[i]->channels);
|
||||
node = bcm->nodes[i];
|
||||
temp = bcm_div(node->sum_avg[bucket] * bcm->aux_data.width,
|
||||
node->buswidth * node->channels);
|
||||
agg_avg[bucket] = max(agg_avg[bucket], temp);
|
||||
|
||||
temp = bcm->nodes[i]->max_peak[bucket] * bcm->aux_data.width;
|
||||
do_div(temp, bcm->nodes[i]->buswidth);
|
||||
temp = bcm_div(node->max_peak[bucket] * bcm->aux_data.width,
|
||||
node->buswidth);
|
||||
agg_peak[bucket] = max(agg_peak[bucket], temp);
|
||||
}
|
||||
|
||||
temp = agg_avg[bucket] * 1000ULL;
|
||||
do_div(temp, bcm->aux_data.unit);
|
||||
bcm->vote_x[bucket] = temp;
|
||||
bcm->vote_x[bucket] = bcm_div(temp, bcm->aux_data.unit);
|
||||
|
||||
temp = agg_peak[bucket] * 1000ULL;
|
||||
do_div(temp, bcm->aux_data.unit);
|
||||
bcm->vote_y[bucket] = temp;
|
||||
bcm->vote_y[bucket] = bcm_div(temp, bcm->aux_data.unit);
|
||||
}
|
||||
|
||||
if (bcm->keepalive && bcm->vote_x[QCOM_ICC_BUCKET_AMC] == 0 &&
|
||||
|
||||
Reference in New Issue
Block a user