]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
media: tegra: nvavp: Fix corruption in secure playback after lp0
authorAllen Yu <alleny@nvidia.com>
Wed, 23 Apr 2014 17:39:37 +0000 (01:39 +0800)
committerSimone Willett <swillett@nvidia.com>
Sat, 26 Apr 2014 02:24:09 +0000 (19:24 -0700)
If vde partition is powergated before suspend, access to BSEV registers
that happens immediately after lp0 exit will go wrong. This WAR unpowergate
vde partition in suspend callback and powergate it again in the first place
of resume callback so that we won't keep vde powergate always on. Resume of
vde if needed will be taken care of afterwards.

Bug 1502013

Change-Id: Iaf4c36ac377c64e8d09d56f79e6e946ec47c686b
Signed-off-by: Allen Yu <alleny@nvidia.com>
Reviewed-on: http://git-master/r/401252
Tested-by: Praveen Kumar Reddy M.V. <pkreddy@nvidia.com>
Reviewed-by: Hunk Lin <hulin@nvidia.com>
Reviewed-by: Todd Poynter <tpoynter@nvidia.com>
drivers/media/platform/tegra/nvavp/nvavp_dev.c

index 7a2fe8a0d2a42c430e81a76a499f821a38449fa7..0a8754a4ada3801aeef490fcbe25f503328b52a1 100644 (file)
@@ -2572,6 +2572,9 @@ static int tegra_nvavp_resume(struct device *dev)
 
        mutex_lock(&nvavp->open_lock);
 
+       /* To balance the unpowergate in suspend routine */
+       nvavp_powergate_vde(nvavp);
+
        tegra_nvavp_runtime_resume(dev);
 
        mutex_unlock(&nvavp->open_lock);
@@ -2588,6 +2591,11 @@ static int tegra_nvavp_suspend(struct device *dev)
 
        tegra_nvavp_runtime_suspend(dev);
 
+       /* WAR: Leave partition vde on before suspend so that access
+        * to BSEV registers immediatly after LP0 exit won't fail.
+        */
+       nvavp_unpowergate_vde(nvavp);
+
        mutex_unlock(&nvavp->open_lock);
 
        return 0;