arm: tegra: Handle down interrupt of actmon
Karthik Ramakrishnan [Tue, 24 Sep 2013 04:47:26 +0000 (21:47 -0700)]
When the cpu load starts going down, the down interrupt is
disabled. This stops further interrupts and if missed, the emc
frequency is locked to high.

The change re-enables down watermark interrupts if gets disabled
due to emc lock.

Bug 1352917

Change-Id: I838eb05b313f9ddc287226c25f23e115fe117599
Signed-off-by: Karthik Ramakrishnan <karthikr@nvidia.com>
Reviewed-on: http://git-master/r/278131
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Puneet Saxena <puneets@nvidia.com>
Reviewed-by: Wen Yi <wyi@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>

arch/arm/mach-tegra/tegra3_actmon.c

index a1e14ee..a58286b 100644 (file)
@@ -258,6 +258,14 @@ irqreturn_t actmon_dev_isr(int irq, void *dev_id)
                }
                actmon_writel(val, offs(ACTMON_DEV_CTRL));
        }
+       if (dev->avg_dependency_threshold) {
+               val = actmon_readl(offs(ACTMON_DEV_CTRL));
+               if (dev->avg_count >= dev->avg_dependency_threshold)
+                       val |= ACTMON_DEV_CTRL_DOWN_WMARK_ENB;
+               else if (dev->boost_freq == 0)
+                       val &= ~ACTMON_DEV_CTRL_DOWN_WMARK_ENB;
+               actmon_writel(val, offs(ACTMON_DEV_CTRL));
+       }
 
        actmon_writel(0xffffffff, offs(ACTMON_DEV_INTR_STATUS)); /* clr all */
        actmon_wmb();