From 3684ed8fd65ea3a13a99dc17c036899ba3165a44 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Tue, 20 Oct 2015 17:15:52 +0530 Subject: gpu: nvgpu: use railgate instead of reset_assert In gk20a_do_idle(), if can_railgate = false, we do reset_assert() on the GPU But asserting reset might have dependencies on specific h/w seqeunce for ensuring proper reset Hence avoid calling reset_assert() and directly call platform specific unrailgate() and railgate() APIs which take care of the correct reset sequence Bug 200142989 Bug 200137963 Bug 1678611 Change-Id: Ide886dd88b8422ad36de52d54378b1edd9c7bbd6 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/820322 (cherry picked from commit d621ddd49da976a75c14aa7aaa37f700fb4e83f2) Reviewed-on: http://git-master/r/822515 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Sachin Nikam --- drivers/gpu/nvgpu/gk20a/gk20a.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index a44ce996..0d74099e 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -1854,23 +1854,23 @@ int __gk20a_do_idle(struct platform_device *pdev, bool force_reset) } else { /* * Case 2 : GPU railgate is not supported or we explicitly - * do not want to do railgate + * do not want to depend on runtime PM * * if GPU is now idle, call prepare_poweroff() to save the - * state and then assert the reset + * state and then do explicit railgate * - * __gk20a_do_unidle() needs to deassert reset, call + * __gk20a_do_unidle() needs to unrailgate, call * finalize_poweron(), and then call pm_runtime_put_sync() * to balance the GPU usage counter */ - if (!platform->reset_assert || !platform->reset_deassert) - goto fail_drop_usage_count; /* Save the GPU state */ gk20a_pm_prepare_poweroff(&pdev->dev); - /* assert GPU reset */ - platform->reset_assert(pdev); + gk20a_pm_disable_clk(&pdev->dev); + + /* railgate GPU */ + platform->railgate(pdev); udelay(10); @@ -1915,10 +1915,12 @@ int __gk20a_do_unidle(struct platform_device *pdev) if (g->forced_reset) { /* - * If we did a reset (and not railgate), - * then deassert the GPU reset here first + * If we did a forced-reset/railgate + * then unrailgate the GPU here first */ - platform->reset_deassert(pdev); + platform->unrailgate(pdev); + + gk20a_pm_enable_clk(&pdev->dev); /* restore the GPU state */ gk20a_pm_finalize_poweron(&pdev->dev); -- cgit v1.2.2