]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commit
gpu: nvgpu: jump to fail path if pm_runtime_get_sync() fails
authorDeepak Nibade <dnibade@nvidia.com>
Mon, 4 May 2015 11:13:56 +0000 (16:43 +0530)
committerTerje Bergstrom <tbergstrom@nvidia.com>
Thu, 7 May 2015 15:50:57 +0000 (08:50 -0700)
commitfc16a6743f06a04623a38080563dda9cf0535156
tree7b5ff9b3bb1ae66416d018f4875ed5420cda1f72
parent9fc6e7917a07e476ccc4213e486871c608564ac3
gpu: nvgpu: jump to fail path if pm_runtime_get_sync() fails

Currently we execute pm_runtime_get_sync() and then
gk20a_scale_notify_busy() without checking return value of
pm_runtime_get_sync()

In case of shutdown of GPU is already initiate, we get
a hard hang due to this as per below sequence :
- one thread invokes GPU shutdown and then forcibly rail
  gates the GPU
- another thread (unaware of shutdown) calls gk20a_busy()
- since runtime PM is disabled in shutdown path,
  pm_runtime_get_sync() fails
- but we still go on running gk20a_scale_notify_busy() which
  tries to access some GPU registers and hangs

Fix this by jumping to failure path in case
pm_runtime_get_sync() fails

Bug 200099940

Change-Id: I022f2dfa9408f640fb44e6f4b10a437688779c0a
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/738509
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/gpu/nvgpu/gk20a/gk20a.c