]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commit
gpu: nvgpu: return error from mutex_acquire() if pmu not initialized
authorDeepak Nibade <dnibade@nvidia.com>
Thu, 17 Jul 2014 12:39:13 +0000 (18:09 +0530)
committerArto Merilainen <amerilainen@nvidia.com>
Tue, 22 Jul 2014 10:20:41 +0000 (03:20 -0700)
commit50497d4031103df1067f14ce4c1e14b15713efb9
treee534ae529d5ce90aaa25c8ab2e25250e35fbebc3
parent5d238ee585fd8ef8603f959d7fc5a2937dc237c4
gpu: nvgpu: return error from mutex_acquire() if pmu not initialized

In pmu_mutex_acquire(), we return zero (success) if
pmu->initialized is not set

Since mutex_acquire() was successful, we then call
pmu_mutex_release()

If now pmu->initialized is set in some other thread
then we proceed to validate the mutex owner and
end up causing below warning :

pmu_mutex_release: requester 0x00000000 NOT match owner 0x00000008

Hence to fix this return error from mutex_acquire()
and mutex_release() if pmu->initialized is not yet set
and in that case we proceed to call elpg enable/disable

Bug 1533644

Change-Id: Ifbb9e6a8e13f6478a13e3f9d98ced11792cc881f
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/439333
GVS: Gerrit_Virtual_Submit
Reviewed-by: Naveen Kumar S <nkumars@nvidia.com>
Tested-by: Naveen Kumar S <nkumars@nvidia.com>
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
drivers/gpu/nvgpu/gk20a/pmu_gk20a.c