]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commit
gpu: nvgpu: wait for running jobs to finish before shutdown
authorDeepak Nibade <dnibade@nvidia.com>
Thu, 23 Apr 2015 11:40:42 +0000 (17:10 +0530)
committerBharat Nihalani <bnihalani@nvidia.com>
Fri, 8 May 2015 06:50:44 +0000 (23:50 -0700)
commit27cf1156d6e07bcaa860e19cfaa333dc40606b11
tree4fb993736f3dc053ef22b95517f5dd5988a6b42d
parent2d55ae37bc35e58d041e0856ba76b7a622bc935c
gpu: nvgpu: wait for running jobs to finish before shutdown

In gk20a_pm_shutdown(), we currently call __pm_runtime_disable()
which prevents h/w access to new requests made after shutdown() call
Also, once gk20a_pm_shutdown() completes, platform code will
just rail gate the GPU

But it is possible that some other thread is already accessing
h/w while shutdown() was triggered and this can result in hang

Hence, wait until all currently executing jobs are finished
before returning from gk20a_pm_shutdown()

Also, we need to wait for GPU's usage count to become 1 since
platform code will increase the usage count and then call
shutdown(). Hence usage count of 1 indicates that GPU is idle

Bug 200099940

Change-Id: I1f2457829e2737c07302d13f355353a30c3b4e67
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/734920
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
drivers/gpu/nvgpu/gk20a/gk20a.c