devfreq: Do not round up bandwidth on BWMON4 devices

Currently only BWMON5 devices increment the count for non-zero
bandwidth while BWMON4 devices increment the count all the time.
This results in a non-zero bandwidth report even when the count
is zero for BWMON4 devices leading to unnecessarily higher
bandwidth votes. Apply checks similar to BWMON5 devices for BWMON4
monitors as well.

Change-Id: I0a2d1c0ed979973966668391a32f63bf2711f981
Signed-off-by: Rama Aparna Mallavarapu <aparnam@codeaurora.org>
This commit is contained in:
Rama Aparna Mallavarapu 2019-03-15 16:25:07 -07:00 • committed by Amir Vajid
commit 9170b2bc7b

View file

@ -580,15 +580,16 @@ unsigned long get_zone_count(struct bwmon *m, unsigned int zone,
WARN(1, "Invalid\n");
return 0;
case MON2:
count = readl_relaxed(MON2_ZONE_MAX(m, zone)) + 1;
count = readl_relaxed(MON2_ZONE_MAX(m, zone));
break;
case MON3:
count = readl_relaxed(MON3_ZONE_MAX(m, zone));
if (count)
count++;
break;
}
if (count)
count++;
return count;
}