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>
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJfUiUEAAoJEIDQzArG2BZjjWAQAIFFjTruXia5MTuiUR5VPv2l
 yI9+5NrT8yagv0sc8KsdO4g5LAde/1RbqcSXTnnSlVb7ipnXMhGKYIYIaTCIDqhY
 oWSi+UjFk8lkPX0cFSojvmscYRvWw3LWQoC4wellcSOiHSJ4gpBYDVXavyG/B3W3
 jku30cGtUwQ/HtGPaXDeLgKvbkNjHW0oF3fKLkZoskYT+zNxYwL4Dwn380hZLdOw
 uLfCc2bIJPGd+USaNHpKnscZGP9HztV1vpxZeoxSnvl2Dhg08DZX8YfpRE7ulcPI
 cgmsu946eeXQ9wqA7lsVfJh4+EtY1uu8xQUlAdZlXCDiirk6gI4UQiPPHYAiF8tA
 oyTxflK/SzqaEuWmaAqDi8DeOozjSIoKieoTi+mOR/QNhl7nf6mXfvUXaEUYGH/V
 a3ocmrK9RfSGBxkWV6gVS34uV4tb39M5EYvfgYh07g1jR4aFCc9LozRiRCzDAJmF
 7ZBIjI7FhYROYXywIUGzujqNHE8I6BY+Cde/5BpLHWUPdUc+3r2cG0djox0dImO5
 keoGQNJLMFyugHLwSyqP4LdipzY+39S3OcSyX2/d+nh2oToh0EQY+6dUWms9NL4S
 WLAAbkPfjtrx87GWzWGCejxy6DcVyWCCQATgwD3510YdKQtKsD8io+CSM30hGvXO
 ywXiziupRdRddnSFLjNG
 =JjGY
 -----END PGP SIGNATURE-----

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:
Greg Kroah-Hartman 2020-09-04 13:52:03 +02:00
Родитель e22a220515 91e045b93d
Коммит b27eda5ce1
2 изменённых файлов: 27 добавлений и 10 удалений

Просмотреть файл

@ -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 &&