From 3688fc654a47a27abeb29a6f4136ac949717396b Mon Sep 17 00:00:00 2001 From: Raviteja Laggyshetty Date: Wed, 29 Jul 2026 15:35:06 +0530 Subject: [PATCH] interconnect: core: ignore duplicate bw requests Ignore the icc_set_bw requests from the client if there is no change with respect to tag, avg_bw and peak_bw values from previous request. Signed-off-by: Raviteja Laggyshetty --- drivers/interconnect/core.c | 10 +++++++++- drivers/interconnect/internal.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 6cc979b26151e..e0b6d57fd181b 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -651,8 +651,10 @@ void icc_set_tag(struct icc_path *path, u32 tag) mutex_lock(&icc_lock); - for (i = 0; i < path->num_nodes; i++) + for (i = 0; i < path->num_nodes; i++) { + path->reqs[i].prev_tag = path->reqs[i].tag; path->reqs[i].tag = tag; + } mutex_unlock(&icc_lock); } @@ -709,6 +711,12 @@ int icc_set_bw(struct icc_path *path, u32 avg_bw, u32 peak_bw) old_avg = path->reqs[0].avg_bw; old_peak = path->reqs[0].peak_bw; + if (path->reqs[0].prev_tag == path->reqs[0].tag && + (avg_bw == old_avg && peak_bw == old_peak)) { + mutex_unlock(&icc_bw_lock); + return 0; + } + for (i = 0; i < path->num_nodes; i++) { node = path->reqs[i].node; diff --git a/drivers/interconnect/internal.h b/drivers/interconnect/internal.h index 3b9d50589c01a..a12279c9c3d72 100644 --- a/drivers/interconnect/internal.h +++ b/drivers/interconnect/internal.h @@ -25,6 +25,7 @@ struct icc_req { struct device *dev; bool enabled; u32 tag; + u32 prev_tag; u32 avg_bw; u32 peak_bw; };