drm/amdgpu: cleanup amdgpu_ib_ring_tests
Test only initialized rings, use the ring name instead of the index in the error message and note on which device the error occured. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:

committed by
Alex Deucher

parent
dc9eeff84c
commit
af70a471bf
@@ -347,11 +347,11 @@ int amdgpu_ib_ring_tests(struct amdgpu_device *adev)
|
|||||||
tmo_gfx = 8 * AMDGPU_IB_TEST_TIMEOUT;
|
tmo_gfx = 8 * AMDGPU_IB_TEST_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
|
for (i = 0; i < adev->num_rings; ++i) {
|
||||||
struct amdgpu_ring *ring = adev->rings[i];
|
struct amdgpu_ring *ring = adev->rings[i];
|
||||||
long tmo;
|
long tmo;
|
||||||
|
|
||||||
if (!ring || !ring->sched.ready)
|
if (!ring->sched.ready)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* skip IB tests for KIQ in general for the below reasons:
|
/* skip IB tests for KIQ in general for the below reasons:
|
||||||
@@ -374,22 +374,25 @@ int amdgpu_ib_ring_tests(struct amdgpu_device *adev)
|
|||||||
tmo = tmo_gfx;
|
tmo = tmo_gfx;
|
||||||
|
|
||||||
r = amdgpu_ring_test_ib(ring, tmo);
|
r = amdgpu_ring_test_ib(ring, tmo);
|
||||||
if (r) {
|
if (!r) {
|
||||||
|
DRM_DEV_DEBUG(adev->dev, "ib test on %s succeeded\n",
|
||||||
|
ring->name);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
ring->sched.ready = false;
|
ring->sched.ready = false;
|
||||||
|
DRM_DEV_ERROR(adev->dev, "IB test failed on %s (%d).\n",
|
||||||
|
ring->name, r);
|
||||||
|
|
||||||
if (ring == &adev->gfx.gfx_ring[0]) {
|
if (ring == &adev->gfx.gfx_ring[0]) {
|
||||||
/* oh, oh, that's really bad */
|
/* oh, oh, that's really bad */
|
||||||
DRM_ERROR("amdgpu: failed testing IB on GFX ring (%d).\n", r);
|
|
||||||
adev->accel_working = false;
|
adev->accel_working = false;
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* still not good, but we can live with it */
|
|
||||||
DRM_ERROR("amdgpu: failed testing IB on ring %d (%d).\n", i, r);
|
|
||||||
ret = r;
|
ret = r;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user