aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
diff options
context:
space:
mode:
authorMonk Liu <Monk.Liu@amd.com>2018-01-23 05:26:20 -0500
committerAlex Deucher <alexander.deucher@amd.com>2018-02-28 14:18:07 -0500
commitdbf797655a43c6318ebb90b899e6583fcadc6472 (patch)
tree0267389b869a300910335f46e3bbf2e5273e3a8d /drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
parent14a8032aac5f6c5e903dcb22e177132c15c51c25 (diff)
drm/amdgpu: adjust timeout for ib_ring_tests(v2)
issue: sometime GFX/MM ib test hit timeout under SRIOV env, root cause is that engine doesn't come back soon enough so the current IB test considered as timed out. fix: for SRIOV GFX IB test wait time need to be expanded a lot during SRIOV runtimei mode since it couldn't really begin before GFX engine come back. for SRIOV MM IB test it always need more time since MM scheduling is not go together with GFX engine, it is controled by h/w MM scheduler so no matter runtime or exclusive mode MM IB test always need more time. v2: use ring type instead of idx to judge Signed-off-by: Monk Liu <Monk.Liu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
index 7f2c314581d4..d7e39827f22a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
@@ -322,14 +322,45 @@ int amdgpu_ib_ring_tests(struct amdgpu_device *adev)
322{ 322{
323 unsigned i; 323 unsigned i;
324 int r, ret = 0; 324 int r, ret = 0;
325 long tmo_gfx, tmo_mm;
326
327 tmo_mm = tmo_gfx = AMDGPU_IB_TEST_TIMEOUT;
328 if (amdgpu_sriov_vf(adev)) {
329 /* for MM engines in hypervisor side they are not scheduled together
330 * with CP and SDMA engines, so even in exclusive mode MM engine could
331 * still running on other VF thus the IB TEST TIMEOUT for MM engines
332 * under SR-IOV should be set to a long time. 8 sec should be enough
333 * for the MM comes back to this VF.
334 */
335 tmo_mm = 8 * AMDGPU_IB_TEST_TIMEOUT;
336 }
337
338 if (amdgpu_sriov_runtime(adev)) {
339 /* for CP & SDMA engines since they are scheduled together so
340 * need to make the timeout width enough to cover the time
341 * cost waiting for it coming back under RUNTIME only
342 */
343 tmo_gfx = 8 * AMDGPU_IB_TEST_TIMEOUT;
344 }
325 345
326 for (i = 0; i < AMDGPU_MAX_RINGS; ++i) { 346 for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
327 struct amdgpu_ring *ring = adev->rings[i]; 347 struct amdgpu_ring *ring = adev->rings[i];
348 long tmo;
328 349
329 if (!ring || !ring->ready) 350 if (!ring || !ring->ready)
330 continue; 351 continue;
331 352
332 r = amdgpu_ring_test_ib(ring, AMDGPU_IB_TEST_TIMEOUT); 353 /* MM engine need more time */
354 if (ring->funcs->type == AMDGPU_RING_TYPE_UVD ||
355 ring->funcs->type == AMDGPU_RING_TYPE_VCE ||
356 ring->funcs->type == AMDGPU_RING_TYPE_UVD_ENC ||
357 ring->funcs->type == AMDGPU_RING_TYPE_VCN_DEC ||
358 ring->funcs->type == AMDGPU_RING_TYPE_VCN_ENC)
359 tmo = tmo_mm;
360 else
361 tmo = tmo_gfx;
362
363 r = amdgpu_ring_test_ib(ring, tmo);
333 if (r) { 364 if (r) {
334 ring->ready = false; 365 ring->ready = false;
335 366