From 7f991657c102e819e90faedf74b081cc246c892e Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 6 Aug 2014 10:41:07 +0300 Subject: gpu: nvgpu: Add boost once GPU is initialized Workaround for GPU hang if boost turns GPU on before it is initialized. Bug 1435870 Change-Id: I07d0617049612344ca7c494da8cb8d75789984e5 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/453375 --- drivers/gpu/nvgpu/gk20a/gk20a.c | 15 ++++++++++----- drivers/gpu/nvgpu/gk20a/gk20a.h | 3 +++ 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 4e3beb7c..9e9a94a0 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -986,6 +986,14 @@ static int gk20a_pm_finalize_poweron(struct device *dev) if (IS_ENABLED(CONFIG_GK20A_CDE)) gk20a_init_cde_support(g); + +#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; } @@ -1526,10 +1534,6 @@ static int gk20a_probe(struct platform_device *dev) gk20a_cde_debugfs_init(dev); #endif -#ifdef CONFIG_INPUT_CFBOOST - cfb_add_device(&dev->dev); -#endif - gk20a_init_gr(gk20a); return 0; @@ -1541,7 +1545,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) diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index a03d5765..a82ad254 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -259,6 +259,9 @@ struct gk20a { void __iomem *bar1_saved; bool power_on; +#ifdef CONFIG_INPUT_CFBOOST + bool boost_added; +#endif struct rw_semaphore busy_lock; -- cgit v1.2.2