It is useful to minimize collateral damage during an IP block
soft reset. We can clear the COND_EXEC condition so that
only the currently executing submission is at risk.

Signed-off-by: Timur Kristóf <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index 6d69d49539ae..3c181628d87e 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -6790,10 +6790,12 @@ static const struct amdgpu_ring_funcs 
gfx_v8_0_ring_funcs_compute = {
        .get_wptr = gfx_v8_0_ring_get_wptr_compute,
        .set_wptr = gfx_v8_0_ring_set_wptr_compute,
        .emit_frame_size =
+               5 + /* gfx_v8_0_ring_emit_init_cond_exec (from 
amdgpu_ib_schedule) */
                20 + /* gfx_v8_0_ring_emit_gds_switch */
                7 + /* gfx_v8_0_ring_emit_hdp_flush */
                5 + /* hdp_invalidate */
                7 + /* gfx_v8_0_ring_emit_pipeline_sync */
+               5 + /* gfx_v8_0_ring_emit_init_cond_exec (from amdgpu_vm_flush) 
*/
                VI_FLUSH_GPU_TLB_NUM_WREG * 5 + 7 + /* 
gfx_v8_0_ring_emit_vm_flush */
                7 + 7 + 7 + /* gfx_v8_0_ring_emit_fence_compute x3 for user 
fence, vm fence */
                7 + /* gfx_v8_0_emit_mem_sync_compute */
@@ -6814,6 +6816,7 @@ static const struct amdgpu_ring_funcs 
gfx_v8_0_ring_funcs_compute = {
        .soft_recovery = gfx_v8_0_ring_soft_recovery,
        .emit_mem_sync = gfx_v8_0_emit_mem_sync_compute,
        .emit_wave_limit = gfx_v8_0_emit_wave_limit,
+       .init_cond_exec = gfx_v8_0_ring_emit_init_cond_exec,
 };
 
 static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_kiq = {
-- 
2.54.0

Reply via email to