summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinay Kalia <vinaykalia@google.com>2022-06-25 01:28:20 +0000
committerVinay Kalia <vinaykalia@google.com>2022-06-30 22:07:38 +0000
commit2571eaf565fb151e284c3ed6bd922800e398df70 (patch)
tree75469d80e8beaa6e37cf1bc90e65b8cd640aec33
parenta1c535151fb58e765ef327f9bcd408b2e4112876 (diff)
downloadgchips-2571eaf565fb151e284c3ed6bd922800e398df70.tar.gz
bigocean: Remove bigocean BW votes when not needed
When all the bigocean instances close, all the BW votes should be removed. bug: 233707844 Signed-off-by: Vinay Kalia <vinaykalia@google.com> Change-Id: I864e105977a965f7376de321df2899541e5f0f36
-rw-r--r--bigo_pm.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/bigo_pm.c b/bigo_pm.c
index cafc3fd..8bd0e2a 100644
--- a/bigo_pm.c
+++ b/bigo_pm.c
@@ -110,11 +110,14 @@ static void bigo_scale_freq(struct bigo_core *core)
static void bigo_get_bw(struct bigo_core *core, struct bts_bw *bw)
{
u32 load = bigo_get_total_load(core);
- struct bigo_bw *bandwidth = bigo_get_target_bw(core, load);
-
- bw->read = bandwidth->rd_bw;
- bw->write = bandwidth->wr_bw;
- bw->peak = bandwidth->pk_bw;
+ if (load) {
+ struct bigo_bw *bandwidth = bigo_get_target_bw(core, load);
+ bw->read = bandwidth->rd_bw;
+ bw->write = bandwidth->wr_bw;
+ bw->peak = bandwidth->pk_bw;
+ } else {
+ memset(bw, 0, sizeof(*bw));
+ }
pr_debug("BW: load: %u, rd: %u, wr: %u, pk: %u", load, bw->read, bw->write, bw->peak);
}