summaryrefslogtreecommitdiff
path: root/drivers/devfreq
diff options
context:
space:
mode:
authorSaravana Kannan <skannan@codeaurora.org>2014-08-20 17:30:16 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:03:51 -0700
commite0975b33871bbc2a241f7b7f5dc8caad61880600 (patch)
tree571680cd8bf948b5575f7c018b2ead651089f561 /drivers/devfreq
parent1e656ab9e99ac76d1f55f37655e31ce332d4bbab (diff)
PM / devfreq: bimc-bwmon: Reduce margin for HW workaround
The HW workaround margin being too high reduces the effectiveness of the interrupt. Try using a margin only when the measured bandwidth is too small and risks the counter wrapping around multiple times before it's read. Change-Id: Ic1e88ad360b2348dfb9ad314c42c1b0218010c1d Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
Diffstat (limited to 'drivers/devfreq')
-rw-r--r--drivers/devfreq/bimc-bwmon.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/devfreq/bimc-bwmon.c b/drivers/devfreq/bimc-bwmon.c
index a10b538da9cf..5aaa9543e2e6 100644
--- a/drivers/devfreq/bimc-bwmon.c
+++ b/drivers/devfreq/bimc-bwmon.c
@@ -163,8 +163,11 @@ static unsigned long meas_bw_and_set_irq(struct bw_hwmon *hw,
mbps = mon_get_count(m);
mbps = bytes_to_mbps(mbps, us);
- /* + 1024 is to workaround HW design issue. Needs further tuning. */
- limit = mbps_to_bytes(mbps + 1024, sample_ms, tol);
+ /*
+ * The fudging of mbps when calculating limit is to workaround a HW
+ * design issue. Needs further tuning.
+ */
+ limit = mbps_to_bytes(max(mbps, 400UL), sample_ms, tol);
mon_set_limit(m, limit);
mon_clear(m);