Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9170b2bc authored by Rama Aparna Mallavarapu's avatar Rama Aparna Mallavarapu Committed by Amir Vajid
Browse files

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: default avatarRama Aparna Mallavarapu <aparnam@codeaurora.org>
parent 3f646032
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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;
}