]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commit
gpu: nvgpu: fix possible PMU isr race
authorDeepak Nibade <dnibade@nvidia.com>
Wed, 25 Jun 2014 13:27:23 +0000 (18:57 +0530)
committerMandar Padmawar <mpadmawar@nvidia.com>
Fri, 27 Jun 2014 06:39:38 +0000 (23:39 -0700)
commit9a37528314f2a2504e4530719f817a93db9a5bf0
tree6c06b7b5ac03d2434f8c241bfe20117611b3e758
parent04343434f91c1155648f57c6ab44bfb908972b1f
gpu: nvgpu: fix possible PMU isr race

Possible race description :
- while PMU is booting, it sends messages to kernel which we process
  in gk20a_pmu_isr()
- but when messages are processed it is possible that we are on the way
  to rail gate the GPU and we have already called pmu_destroy()
- this could lead to hangs if while processing messages, GR is
  already off

To fix this, introduce another mutex isr_enable_lock and a flag to
turn on/off ISRs
- when we enable PMU, get the lock and set the flag
- in pmu_destroy(), get the lock and remove the flag
- in pmu_isr(), take the lock, check if flag is set or not. If flag
  is not set return, otherwise proceed with the messages

Bug 200014542
Bug 200014887

Change-Id: I0204d8a00e4563859eebc807d4ac7d26161316ea
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/428371
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
drivers/gpu/nvgpu/gk20a/pmu_gk20a.h