Commit 4b991c54 authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by Alex Deucher

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: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2f2debb5
...@@ -348,7 +348,7 @@ void radeon_test_ring_sync(struct radeon_device *rdev, ...@@ -348,7 +348,7 @@ void radeon_test_ring_sync(struct radeon_device *rdev,
if (r) if (r)
goto out_cleanup; goto out_cleanup;
mdelay(1000); msleep(1000);
if (radeon_fence_signaled(fence1)) { if (radeon_fence_signaled(fence1)) {
DRM_ERROR("Fence 1 signaled without waiting for semaphore.\n"); DRM_ERROR("Fence 1 signaled without waiting for semaphore.\n");
...@@ -369,7 +369,7 @@ void radeon_test_ring_sync(struct radeon_device *rdev, ...@@ -369,7 +369,7 @@ void radeon_test_ring_sync(struct radeon_device *rdev,
goto out_cleanup; goto out_cleanup;
} }
mdelay(1000); msleep(1000);
if (radeon_fence_signaled(fence2)) { if (radeon_fence_signaled(fence2)) {
DRM_ERROR("Fence 2 signaled without waiting for semaphore.\n"); 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,7 +442,7 @@ static void radeon_test_ring_sync2(struct radeon_device *rdev,
if (r) if (r)
goto out_cleanup; goto out_cleanup;
mdelay(1000); msleep(1000);
if (radeon_fence_signaled(fenceA)) { if (radeon_fence_signaled(fenceA)) {
DRM_ERROR("Fence A signaled without waiting for semaphore.\n"); 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,7 +462,7 @@ static void radeon_test_ring_sync2(struct radeon_device *rdev,
radeon_ring_unlock_commit(rdev, ringC, false); radeon_ring_unlock_commit(rdev, ringC, false);
for (i = 0; i < 30; ++i) { for (i = 0; i < 30; ++i) {
mdelay(100); msleep(100);
sigA = radeon_fence_signaled(fenceA); sigA = radeon_fence_signaled(fenceA);
sigB = radeon_fence_signaled(fenceB); sigB = radeon_fence_signaled(fenceB);
if (sigA || sigB) if (sigA || sigB)
...@@ -487,7 +487,7 @@ static void radeon_test_ring_sync2(struct radeon_device *rdev, ...@@ -487,7 +487,7 @@ static void radeon_test_ring_sync2(struct radeon_device *rdev,
radeon_semaphore_emit_signal(rdev, ringC->idx, semaphore); radeon_semaphore_emit_signal(rdev, ringC->idx, semaphore);
radeon_ring_unlock_commit(rdev, ringC, false); radeon_ring_unlock_commit(rdev, ringC, false);
mdelay(1000); msleep(1000);
r = radeon_fence_wait(fenceA, false); r = radeon_fence_wait(fenceA, false);
if (r) { if (r) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment