summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinay Kalia <vinaykalia@google.com>2022-06-25 01:28:20 +0000
committerRuofei Ma <ruofeim@google.com>2022-09-14 14:12:03 -0700
commitc965e024911283b3881a1f63f89b609091524565 (patch)
treeaac7599913f0c79fb4eb899dcf666a57031b963b
parent6f9b65f19e49653b2e435728de61b0b282c9563e (diff)
downloadgchips-c965e024911283b3881a1f63f89b609091524565.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 bug: 237706931 Signed-off-by: Vinay Kalia <vinaykalia@google.com> Change-Id: I1bc85a1f9fd043413eb55602e95d107b1d6564db (cherry picked from commit 2571eaf565fb151e284c3ed6bd922800e398df70)
-rw-r--r--bigo_pm.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/bigo_pm.c b/bigo_pm.c
index 3d36a0b..a672b93 100644
--- a/bigo_pm.c
+++ b/bigo_pm.c
@@ -115,12 +115,16 @@ 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;
- pr_debug("BW: load: %llu, rd: %u, wr: %u, pk: %u", load, bw->read, bw->write, bw->peak);
+ 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);
}
static int bigo_scale_bw(struct bigo_core *core)