Re: [PATCH] interconnect: Aggregate bandwidth votes for unused nodes in sync_state()

From: Matthias Kaehlcke
Date: Mon Jun 21 2021 - 13:00:53 EST


On Sat, Jun 19, 2021 at 10:38:29PM +0530, Odelu Kukatla wrote:
> When removing the initial bandwidth votes in sync_state(), make sure
> to call the aggregate() function for nodes which don't have any
> clients yet. aggregate_requests() does not invoke aggregate()
> for unused nodes.
>
> Signed-off-by: Odelu Kukatla <okukatla@xxxxxxxxxxxxxx>

It seems this should have a 'Fixes' tag for b1d681d8d324 ("interconnect:
Add sync state support")', to make sure the change makes it into the
stable trees.

> ---
> drivers/interconnect/core.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
> index 8a1e70e..1d9a00a 100644
> --- a/drivers/interconnect/core.c
> +++ b/drivers/interconnect/core.c
> @@ -1106,7 +1106,16 @@ void icc_sync_state(struct device *dev)
> dev_dbg(p->dev, "interconnect provider is in synced state\n");
> list_for_each_entry(n, &p->nodes, node_list) {
> if (n->init_avg || n->init_peak) {
> - aggregate_requests(n);
> + if (hlist_empty(&n->req_list)) {

nit: consider handling the common case in the 'if' branch and the exception of
the initial votes in 'else'.

> + if (p->pre_aggregate)
> + p->pre_aggregate(n);
> +
> + p->aggregate(n, 0, 0, 0, &n->avg_bw,
> + &n->peak_bw);
> + } else {
> + aggregate_requests(n);
> + }
> +
> p->set(n, n);
> }
> }