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 1338326

Change-Id: I838eb05b313f9ddc287226c25f23e115fe117599
Signed-off-by: Karthik Ramakrishnan <karthikr@nvidia.com>
Reviewed-on: http://git-master/r/278131
(cherry picked from commit bbc6fff3b3fc0f964dba1ed6a22280d45119bd16)
Reviewed-on: http://git-master/r/280205
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Puneet Saxena <puneets@nvidia.com>
Tested-by: Puneet Saxena <puneets@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
(cherry picked from commit fc68f39f4010db692892723086f4ae00622140ac)
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>

arch/arm/mach-tegra/tegra3_actmon.c

index 4960146..f76554d 100644 (file)
@@ -257,6 +257,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();