gpu: nvgpu: Add boost once GPU is initialized
Terje Bergstrom [Wed, 6 Aug 2014 07:41:07 +0000 (10:41 +0300)]
Workaround for GPU hang if boost turns GPU on before it is
initialized.

Bug 1435870

Change-Id: I07d0617049612344ca7c494da8cb8d75789984e5
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/453375
(cherry picked from commit 260cf3d3fab941126eebf4bc977cb408587492eb)
Reviewed-on: http://git-master/r/655951
Tested-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

drivers/gpu/nvgpu/gk20a/gk20a.c
drivers/gpu/nvgpu/gk20a/gk20a.h

index bf882f2..fdfc926 100644 (file)
@@ -919,6 +919,13 @@ static int gk20a_pm_finalize_poweron(struct device *dev)
 
        gk20a_scale_resume(pdev);
 
+#ifdef CONFIG_INPUT_CFBOOST
+       if (!g->boost_added) {
+               gk20a_dbg_info("add touch boost");
+               cfb_add_device(dev);
+               g->boost_added = true;
+       }
+#endif
 done:
        return err;
 }
@@ -1463,10 +1470,6 @@ static int gk20a_probe(struct platform_device *dev)
        gk20a_pmu_debugfs_init(dev);
 #endif
 
-#ifdef CONFIG_INPUT_CFBOOST
-       cfb_add_device(&dev->dev);
-#endif
-
        gk20a_init_gr(gk20a);
 
        return 0;
@@ -1478,7 +1481,8 @@ static int __exit gk20a_remove(struct platform_device *dev)
        gk20a_dbg_fn("");
 
 #ifdef CONFIG_INPUT_CFBOOST
-       cfb_remove_device(&dev->dev);
+       if (g->boost_added)
+               cfb_remove_device(&dev->dev);
 #endif
 
        if (g->remove_support)
index ae49007..d8f902b 100644 (file)
@@ -214,6 +214,9 @@ struct gk20a {
        void __iomem *bar1;
 
        bool power_on;
+#ifdef CONFIG_INPUT_CFBOOST
+       bool boost_added;
+#endif
 
        struct rw_semaphore busy_lock;