diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/pmu_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index c4bfe527..e9e0c26f 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | |||
@@ -1270,15 +1270,10 @@ static int pmu_queue_lock(struct pmu_gk20a *pmu, | |||
1270 | 1270 | ||
1271 | if (PMU_IS_SW_COMMAND_QUEUE(queue->id)) { | 1271 | if (PMU_IS_SW_COMMAND_QUEUE(queue->id)) { |
1272 | mutex_lock(&queue->mutex); | 1272 | mutex_lock(&queue->mutex); |
1273 | queue->locked = true; | ||
1274 | return 0; | 1273 | return 0; |
1275 | } | 1274 | } |
1276 | 1275 | ||
1277 | err = pmu_mutex_acquire(pmu, queue->mutex_id, | 1276 | err = pmu_mutex_acquire(pmu, queue->mutex_id, &queue->mutex_lock); |
1278 | &queue->mutex_lock); | ||
1279 | if (err == 0) | ||
1280 | queue->locked = true; | ||
1281 | |||
1282 | return err; | 1277 | return err; |
1283 | } | 1278 | } |
1284 | 1279 | ||
@@ -1292,18 +1287,11 @@ static int pmu_queue_unlock(struct pmu_gk20a *pmu, | |||
1292 | 1287 | ||
1293 | if (PMU_IS_SW_COMMAND_QUEUE(queue->id)) { | 1288 | if (PMU_IS_SW_COMMAND_QUEUE(queue->id)) { |
1294 | mutex_unlock(&queue->mutex); | 1289 | mutex_unlock(&queue->mutex); |
1295 | queue->locked = false; | ||
1296 | return 0; | 1290 | return 0; |
1297 | } | 1291 | } |
1298 | 1292 | ||
1299 | if (queue->locked) { | 1293 | err = pmu_mutex_release(pmu, queue->mutex_id, &queue->mutex_lock); |
1300 | err = pmu_mutex_release(pmu, queue->mutex_id, | 1294 | return err; |
1301 | &queue->mutex_lock); | ||
1302 | if (err == 0) | ||
1303 | queue->locked = false; | ||
1304 | } | ||
1305 | |||
1306 | return 0; | ||
1307 | } | 1295 | } |
1308 | 1296 | ||
1309 | /* called by pmu_read_message, no lock */ | 1297 | /* called by pmu_read_message, no lock */ |
@@ -1327,8 +1315,6 @@ static bool pmu_queue_has_room(struct pmu_gk20a *pmu, | |||
1327 | u32 head, tail, free; | 1315 | u32 head, tail, free; |
1328 | bool rewind = false; | 1316 | bool rewind = false; |
1329 | 1317 | ||
1330 | BUG_ON(!queue->locked); | ||
1331 | |||
1332 | size = ALIGN(size, QUEUE_ALIGNMENT); | 1318 | size = ALIGN(size, QUEUE_ALIGNMENT); |
1333 | 1319 | ||
1334 | pmu_queue_head(pmu, queue, &head, QUEUE_GET); | 1320 | pmu_queue_head(pmu, queue, &head, QUEUE_GET); |