Manually disallow and then allow gfxoff in begin_use and end_use to avoid any potential FW races when ringing the doorbell. There are no known issues with gfxoff that this solves, but it shouldn't hurt anything and shouldn't affect power usage since we are only toggling it around the doorbell update. Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx> --- drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c index b764550834a07..cb4d253b22b2b 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c @@ -1944,6 +1944,16 @@ static void sdma_v5_0_dump_ip_state(struct amdgpu_ip_block *ip_block) amdgpu_gfx_off_ctrl(adev, true); } +static void sdma_v5_0_ring_begin_use(struct amdgpu_ring *ring) +{ + amdgpu_gfx_off_ctrl_immediate(ring->adev, false); +} + +static void sdma_v5_0_ring_end_use(struct amdgpu_ring *ring) +{ + amdgpu_gfx_off_ctrl_immediate(ring->adev, true); +} + static const struct amd_ip_funcs sdma_v5_0_ip_funcs = { .name = "sdma_v5_0", .early_init = sdma_v5_0_early_init, @@ -1998,6 +2008,8 @@ static const struct amdgpu_ring_funcs sdma_v5_0_ring_funcs = { .init_cond_exec = sdma_v5_0_ring_init_cond_exec, .preempt_ib = sdma_v5_0_ring_preempt_ib, .reset = sdma_v5_0_reset_queue, + .begin_use = sdma_v5_0_ring_begin_use, + .end_use = sdma_v5_0_ring_end_use, }; static void sdma_v5_0_set_ring_funcs(struct amdgpu_device *adev) -- 2.48.1