Once boosting value is 0, then further consecutive-down events won't do
anything useful since the only purpose of those consecutive events to
boost the freq and de-boosting is over in the case of 0. Note that upper
watermark is infinitely high in a case of frequency max out and thus the
upper events are stopping by themselves. In a result of this change all
parasite interrupts are fixed now and interrupts activity is nearly
non-existent now!

Signed-off-by: Dmitry Osipenko <dig...@gmail.com>
---
 drivers/devfreq/tegra30-devfreq.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/devfreq/tegra30-devfreq.c 
b/drivers/devfreq/tegra30-devfreq.c
index 6fb3ca125438..81449cc1392b 100644
--- a/drivers/devfreq/tegra30-devfreq.c
+++ b/drivers/devfreq/tegra30-devfreq.c
@@ -424,6 +424,8 @@ static void actmon_isr_device(struct tegra_devfreq *tegra,
                                             dev->config->boost_up_coeff);
                dev->boost_freq += ACTMON_BOOST_FREQ_STEP;
 
+               dev_ctrl |= ACTMON_DEV_CTRL_CONSECUTIVE_BELOW_WMARK_EN;
+
                if (dev->boost_freq >= tegra->max_freq && !low_activity)
                        dev->boost_freq = tegra->max_freq;
 
@@ -442,6 +444,10 @@ static void actmon_isr_device(struct tegra_devfreq *tegra,
                tegra_devfreq_update_wmark(tegra, dev);
        }
 
+       /* no boosting => no need for consecutive-down interrupt */
+       if (dev->boost_freq == 0)
+               dev_ctrl &= ~ACTMON_DEV_CTRL_CONSECUTIVE_BELOW_WMARK_EN;
+
        device_writel(dev, dev_ctrl, ACTMON_DEV_CTRL);
 
        device_writel(dev, ACTMON_INTR_STATUS_CLEAR, ACTMON_DEV_INTR_STATUS);
-- 
2.22.0

Reply via email to