ARM: tegra: clock: Fix activity monitor resume
Alex Frid [Mon, 18 Jul 2011 23:20:54 +0000 (16:20 -0700)]
Move call to clock get rate API (can sleep) outside of activity
monitor resume section protected by spin lock.

Original-Change-Id: I78d5bb8728f3a728a6ff952b1f3cba19b9dec0a0
Reviewed-on: http://git-master/r/41626
Reviewed-by: Narendra Damahe <ndamahe@nvidia.com>
Tested-by: Narendra Damahe <ndamahe@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-by: Scott Williams <scwilliams@nvidia.com>

Rebase-Id: R1ab0bb59a88f078f85f125b968546c09aab9d176

arch/arm/mach-tegra/tegra3_actmon.c

index 1cc0e51..b7fc895 100644 (file)
@@ -410,12 +410,12 @@ static void actmon_dev_suspend(struct actmon_dev *dev)
 static void actmon_dev_resume(struct actmon_dev *dev)
 {
        u32 val;
-       unsigned long flags, freq;
+       unsigned long flags;
+       unsigned long freq = clk_get_rate(dev->clk) / 1000;
 
        spin_lock_irqsave(&dev->lock, flags);
 
        if (dev->state == ACTMON_SUSPENDED) {
-               freq = clk_get_rate(dev->clk) / 1000;
                actmon_dev_configure(dev, freq);
                dev->state = dev->saved_state;
                if (dev->state == ACTMON_ON) {