diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2014-07-17 18:09:13 +0530 |
---|---|---|
committer | Matthew Pedro <mapedro@nvidia.com> | 2014-07-23 09:19:11 -0700 |
commit | 18aa7b3f4a96ea569d9d9797fd2ad152a403f5a2 (patch) | |
tree | a12352c1cc2b42219849b7c05486a17e5d7f9f5f /drivers/gpu | |
parent | ed3920982b1809a232f05f3874cdec109cd040a7 (diff) |
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
Bug 200017082
Change-Id: Ifbb9e6a8e13f6478a13e3f9d98ced11792cc881f
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Signed-off-by: Naveen Kumar S <nkumars@nvidia.com>
Reviewed-on: http://git-master/r/439333
(cherry picked from commit 50497d4031103df1067f14ce4c1e14b15713efb9)
Reviewed-on: http://git-master/r/440747
GVS: Gerrit_Virtual_Submit
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index 0895f3dbb226..c69ab97252ce 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c @@ -1155,7 +1155,7 @@ int pmu_mutex_acquire(struct pmu_gk20a *pmu, u32 id, u32 *token) u32 data, owner, max_retry; if (!pmu->initialized) - return 0; + return -EINVAL; BUG_ON(!token); BUG_ON(!PMU_MUTEX_ID_IS_VALID(id)); @@ -1224,7 +1224,7 @@ int pmu_mutex_release(struct pmu_gk20a *pmu, u32 id, u32 *token) u32 owner, data; if (!pmu->initialized) - return 0; + return -EINVAL; BUG_ON(!token); BUG_ON(!PMU_MUTEX_ID_IS_VALID(id)); |