ARM: tegra: clocks: state check in resume
Seshendra Gadagottu [Wed, 23 Jan 2013 03:22:04 +0000 (19:22 -0800)]
Check the validity of cl_dvfs state before calling
tegra_cl_dvfs_resume.

Change-Id: I977582b13b7570029b9018b49e8beca98095f469
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/193253
Reviewed-by: Mrutyunjay Sawant <msawant@nvidia.com>
Tested-by: Mrutyunjay Sawant <msawant@nvidia.com>

arch/arm/mach-tegra/tegra11_clocks.c
arch/arm/mach-tegra/tegra14_clocks.c

index e0e2765..06a48f2 100644 (file)
@@ -3458,8 +3458,10 @@ static void tegra11_dfll_clk_resume(struct clk *c)
        if (!(clk_readl(c->reg) & DFLL_BASE_RESET))
                return;         /* already resumed */
 
-       tegra_periph_reset_deassert(c);
-       tegra_cl_dvfs_resume(c->u.dfll.cl_dvfs);
+       if (c->state != UNINITIALIZED) {
+               tegra_periph_reset_deassert(c);
+               tegra_cl_dvfs_resume(c->u.dfll.cl_dvfs);
+       }
 }
 #endif
 
index 7699630..2bfe913 100644 (file)
@@ -3397,8 +3397,10 @@ static void tegra14_dfll_clk_resume(struct clk *c)
        if (!(clk_readl(c->reg) & DFLL_BASE_RESET))
                return;         /* already resumed */
 
-       tegra_periph_reset_deassert(c);
-       tegra_cl_dvfs_resume(c->u.dfll.cl_dvfs);
+       if (c->state != UNINTIALIZED)
+               tegra_periph_reset_deassert(c);
+               tegra_cl_dvfs_resume(c->u.dfll.cl_dvfs);
+       }
 }
 #endif