Skip to content

Commit 7b8d925

Browse files
committed
drm/amdgpu/gfx9: fix driver reload with KIQ
Drop the KCQ disabling via KIQ. We disable the MEC shortly after anyway, so there is no need to wait for all of this. Doing so seems to leave the MEC in a bad way. Acked-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent dcf7584 commit 7b8d925

File tree

1 file changed

+0
-51
lines changed

1 file changed

+0
-51
lines changed

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2502,56 +2502,6 @@ static int gfx_v9_0_kiq_kcq_enable(struct amdgpu_device *adev)
25022502
return r;
25032503
}
25042504

2505-
static int gfx_v9_0_kiq_kcq_disable(struct amdgpu_device *adev)
2506-
{
2507-
struct amdgpu_ring *kiq_ring = &adev->gfx.kiq.ring;
2508-
uint32_t scratch, tmp = 0;
2509-
int r, i;
2510-
2511-
r = amdgpu_gfx_scratch_get(adev, &scratch);
2512-
if (r) {
2513-
DRM_ERROR("Failed to get scratch reg (%d).\n", r);
2514-
return r;
2515-
}
2516-
WREG32(scratch, 0xCAFEDEAD);
2517-
2518-
r = amdgpu_ring_alloc(kiq_ring, 6 + 3);
2519-
if (r) {
2520-
DRM_ERROR("Failed to lock KIQ (%d).\n", r);
2521-
amdgpu_gfx_scratch_free(adev, scratch);
2522-
return r;
2523-
}
2524-
/* unmap queues */
2525-
amdgpu_ring_write(kiq_ring, PACKET3(PACKET3_UNMAP_QUEUES, 4));
2526-
amdgpu_ring_write(kiq_ring,
2527-
PACKET3_UNMAP_QUEUES_ACTION(1)| /* RESET_QUEUES */
2528-
PACKET3_UNMAP_QUEUES_QUEUE_SEL(2)); /* select all queues */
2529-
amdgpu_ring_write(kiq_ring, 0);
2530-
amdgpu_ring_write(kiq_ring, 0);
2531-
amdgpu_ring_write(kiq_ring, 0);
2532-
amdgpu_ring_write(kiq_ring, 0);
2533-
/* write to scratch for completion */
2534-
amdgpu_ring_write(kiq_ring, PACKET3(PACKET3_SET_UCONFIG_REG, 1));
2535-
amdgpu_ring_write(kiq_ring, (scratch - PACKET3_SET_UCONFIG_REG_START));
2536-
amdgpu_ring_write(kiq_ring, 0xDEADBEEF);
2537-
amdgpu_ring_commit(kiq_ring);
2538-
2539-
for (i = 0; i < adev->usec_timeout; i++) {
2540-
tmp = RREG32(scratch);
2541-
if (tmp == 0xDEADBEEF)
2542-
break;
2543-
DRM_UDELAY(1);
2544-
}
2545-
if (i >= adev->usec_timeout) {
2546-
DRM_ERROR("KCQ disable failed (scratch(0x%04X)=0x%08X)\n",
2547-
scratch, tmp);
2548-
r = -EINVAL;
2549-
}
2550-
amdgpu_gfx_scratch_free(adev, scratch);
2551-
2552-
return r;
2553-
}
2554-
25552505
static int gfx_v9_0_mqd_init(struct amdgpu_ring *ring)
25562506
{
25572507
struct amdgpu_device *adev = ring->adev;
@@ -2996,7 +2946,6 @@ static int gfx_v9_0_hw_fini(void *handle)
29962946
pr_debug("For SRIOV client, shouldn't do anything.\n");
29972947
return 0;
29982948
}
2999-
gfx_v9_0_kiq_kcq_disable(adev);
30002949
gfx_v9_0_cp_enable(adev, false);
30012950
gfx_v9_0_rlc_stop(adev);
30022951

0 commit comments

Comments
 (0)