diff options
author | Jia-Ju Bai <baijiaju1990@gmail.com> | 2018-08-03 20:01:02 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-08-27 12:10:02 -0400 |
commit | 4b991c54ce82e85d89babcf32d72746365163ed5 (patch) | |
tree | 8ec334782df410bf5cfdacdca49e6b83f545e05a /drivers | |
parent | 2f2debb5a162ea9aeb03ad2532827631e3a68b1a (diff) |
gpu: drm: radeon: radeon_test: Replace mdelay() with msleep()
radeon_test_ring_sync() and radeon_test_ring_sync2() are never
called in atomic context.
They call mdelay() to busily wait, which is not necessary.
mdelay() can be replaced with msleep().
This is found by a static analysis tool named DCNS written by myself.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_test.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_test.c b/drivers/gpu/drm/radeon/radeon_test.c index 0c7f228db6e3..701c4a59e3c3 100644 --- a/drivers/gpu/drm/radeon/radeon_test.c +++ b/drivers/gpu/drm/radeon/radeon_test.c | |||
@@ -348,7 +348,7 @@ void radeon_test_ring_sync(struct radeon_device *rdev, | |||
348 | if (r) | 348 | if (r) |
349 | goto out_cleanup; | 349 | goto out_cleanup; |
350 | 350 | ||
351 | mdelay(1000); | 351 | msleep(1000); |
352 | 352 | ||
353 | if (radeon_fence_signaled(fence1)) { | 353 | if (radeon_fence_signaled(fence1)) { |
354 | DRM_ERROR("Fence 1 signaled without waiting for semaphore.\n"); | 354 | DRM_ERROR("Fence 1 signaled without waiting for semaphore.\n"); |
@@ -369,7 +369,7 @@ void radeon_test_ring_sync(struct radeon_device *rdev, | |||
369 | goto out_cleanup; | 369 | goto out_cleanup; |
370 | } | 370 | } |
371 | 371 | ||
372 | mdelay(1000); | 372 | msleep(1000); |
373 | 373 | ||
374 | if (radeon_fence_signaled(fence2)) { | 374 | if (radeon_fence_signaled(fence2)) { |
375 | DRM_ERROR("Fence 2 signaled without waiting for semaphore.\n"); | 375 | DRM_ERROR("Fence 2 signaled without waiting for semaphore.\n"); |
@@ -442,7 +442,7 @@ static void radeon_test_ring_sync2(struct radeon_device *rdev, | |||
442 | if (r) | 442 | if (r) |
443 | goto out_cleanup; | 443 | goto out_cleanup; |
444 | 444 | ||
445 | mdelay(1000); | 445 | msleep(1000); |
446 | 446 | ||
447 | if (radeon_fence_signaled(fenceA)) { | 447 | if (radeon_fence_signaled(fenceA)) { |
448 | DRM_ERROR("Fence A signaled without waiting for semaphore.\n"); | 448 | DRM_ERROR("Fence A signaled without waiting for semaphore.\n"); |
@@ -462,7 +462,7 @@ static void radeon_test_ring_sync2(struct radeon_device *rdev, | |||
462 | radeon_ring_unlock_commit(rdev, ringC, false); | 462 | radeon_ring_unlock_commit(rdev, ringC, false); |
463 | 463 | ||
464 | for (i = 0; i < 30; ++i) { | 464 | for (i = 0; i < 30; ++i) { |
465 | mdelay(100); | 465 | msleep(100); |
466 | sigA = radeon_fence_signaled(fenceA); | 466 | sigA = radeon_fence_signaled(fenceA); |
467 | sigB = radeon_fence_signaled(fenceB); | 467 | sigB = radeon_fence_signaled(fenceB); |
468 | if (sigA || sigB) | 468 | if (sigA || sigB) |
@@ -487,7 +487,7 @@ static void radeon_test_ring_sync2(struct radeon_device *rdev, | |||
487 | radeon_semaphore_emit_signal(rdev, ringC->idx, semaphore); | 487 | radeon_semaphore_emit_signal(rdev, ringC->idx, semaphore); |
488 | radeon_ring_unlock_commit(rdev, ringC, false); | 488 | radeon_ring_unlock_commit(rdev, ringC, false); |
489 | 489 | ||
490 | mdelay(1000); | 490 | msleep(1000); |
491 | 491 | ||
492 | r = radeon_fence_wait(fenceA, false); | 492 | r = radeon_fence_wait(fenceA, false); |
493 | if (r) { | 493 | if (r) { |