summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2014-07-17 08:39:13 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:10:31 -0400
commita84dc62b5ef54d6f714172359a4e0fe68f8802ca (patch)
tree956baedc48d24ac1a735d4c8a7d9090958dcd7eb /drivers
parentd98099c9b6b8d54dd5c8563cb824805ddce6aec4 (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 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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/pmu_gk20a.c4
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 c23d83cf..3abf1b43 100644
--- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
@@ -1227,7 +1227,7 @@ int pmu_mutex_acquire(struct pmu_gk20a *pmu, u32 id, u32 *token)
1227 u32 data, owner, max_retry; 1227 u32 data, owner, max_retry;
1228 1228
1229 if (!pmu->initialized) 1229 if (!pmu->initialized)
1230 return 0; 1230 return -EINVAL;
1231 1231
1232 BUG_ON(!token); 1232 BUG_ON(!token);
1233 BUG_ON(!PMU_MUTEX_ID_IS_VALID(id)); 1233 BUG_ON(!PMU_MUTEX_ID_IS_VALID(id));
@@ -1296,7 +1296,7 @@ int pmu_mutex_release(struct pmu_gk20a *pmu, u32 id, u32 *token)
1296 u32 owner, data; 1296 u32 owner, data;
1297 1297
1298 if (!pmu->initialized) 1298 if (!pmu->initialized)
1299 return 0; 1299 return -EINVAL;
1300 1300
1301 BUG_ON(!token); 1301 BUG_ON(!token);
1302 BUG_ON(!PMU_MUTEX_ID_IS_VALID(id)); 1302 BUG_ON(!PMU_MUTEX_ID_IS_VALID(id));