diff options
author | Christian König <christian.koenig@amd.com> | 2018-10-29 05:55:23 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-11-05 14:21:25 -0500 |
commit | af70a471bf067d4e808eff2b9c464e6055c98d49 (patch) | |
tree | 2d8189e23cd24dbd3d42ae978db720393fef1c4c | |
parent | dc9eeff84c77080f545575a30062af0ac65b1eb0 (diff) |
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>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c index fc74f40a5912..c514bb9e94a0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | |||
@@ -347,11 +347,11 @@ int amdgpu_ib_ring_tests(struct amdgpu_device *adev) | |||
347 | tmo_gfx = 8 * AMDGPU_IB_TEST_TIMEOUT; | 347 | tmo_gfx = 8 * AMDGPU_IB_TEST_TIMEOUT; |
348 | } | 348 | } |
349 | 349 | ||
350 | for (i = 0; i < AMDGPU_MAX_RINGS; ++i) { | 350 | for (i = 0; i < adev->num_rings; ++i) { |
351 | struct amdgpu_ring *ring = adev->rings[i]; | 351 | struct amdgpu_ring *ring = adev->rings[i]; |
352 | long tmo; | 352 | long tmo; |
353 | 353 | ||
354 | if (!ring || !ring->sched.ready) | 354 | if (!ring->sched.ready) |
355 | continue; | 355 | continue; |
356 | 356 | ||
357 | /* skip IB tests for KIQ in general for the below reasons: | 357 | /* skip IB tests for KIQ in general for the below reasons: |
@@ -374,20 +374,23 @@ int amdgpu_ib_ring_tests(struct amdgpu_device *adev) | |||
374 | tmo = tmo_gfx; | 374 | tmo = tmo_gfx; |
375 | 375 | ||
376 | r = amdgpu_ring_test_ib(ring, tmo); | 376 | r = amdgpu_ring_test_ib(ring, tmo); |
377 | if (r) { | 377 | if (!r) { |
378 | ring->sched.ready = false; | 378 | DRM_DEV_DEBUG(adev->dev, "ib test on %s succeeded\n", |
379 | 379 | ring->name); | |
380 | if (ring == &adev->gfx.gfx_ring[0]) { | 380 | continue; |
381 | /* oh, oh, that's really bad */ | 381 | } |
382 | DRM_ERROR("amdgpu: failed testing IB on GFX ring (%d).\n", r); | 382 | |
383 | adev->accel_working = false; | 383 | ring->sched.ready = false; |
384 | return r; | 384 | DRM_DEV_ERROR(adev->dev, "IB test failed on %s (%d).\n", |
385 | 385 | ring->name, r); | |
386 | } else { | 386 | |
387 | /* still not good, but we can live with it */ | 387 | if (ring == &adev->gfx.gfx_ring[0]) { |
388 | DRM_ERROR("amdgpu: failed testing IB on ring %d (%d).\n", i, r); | 388 | /* oh, oh, that's really bad */ |
389 | ret = r; | 389 | adev->accel_working = false; |
390 | } | 390 | return r; |
391 | |||
392 | } else { | ||
393 | ret = r; | ||
391 | } | 394 | } |
392 | } | 395 | } |
393 | return ret; | 396 | return ret; |