Reset improvements for GC10+
Subsystems (2)
Alex Deucher
maintainerv4 cover Reset improvements for GC10+
This set improves per queue reset support for GC10+. When we reset the queue, the queue is lost so we need to re-emit the unprocessed state from subsequent submissions. To that end, in order to make sure we actually restore unprocessed state, we need to enable legacy enforce isolation so that we can safely re-emit the unprocessed state. If we don't multiple jobs can run in parallel and we may not end up resetting the correct one. This is similar to how windows handles queues. This also gives us correct guilty tracking for GC.
Tested on GC 10 and 11 chips with a game running and then running hang tests. The game pauses when the hang happens, then continues after the queue reset.
I tried this same approach and GC8 and 9, but it was not as reliable as soft recovery. As such, I've dropped the KGQ reset code for pre-GC10.
The same approach can be extended to SDMA and VCN in the future. They don't need enforce isolation because those engines are single threaded so they always operate serially.
Rework re-emit to signal the seq number of the bad job and verify that to verify that the reset worked, then re-emit the rest of the non-guilty state. This way we are not waiting on the rest of the state to complete, and if the subsequent state also contains a bad job, we'll end up in queue reset again rather than adapter reset.
v4: Drop explicit padding patches
Drop new timeout macro
Rework re-emit sequence
Alex Deucher (15):
drm/amdgpu/gfx10: enable legacy enforce isolation drm/amdgpu/gfx11: enable legacy enforce isolation drm/amdgpu/gfx12: enable legacy enforce isolation drm/amdgpu/gfx7: drop reset_kgq
drm/amdgpu/gfx8: drop reset_kgq
drm/amdgpu/gfx9: drop reset_kgq
drm/amdgpu: track ring state associated with a job drm/amdgpu/gfx10: re-emit unprocessed state on kgq reset drm/amdgpu/gfx11: re-emit unprocessed state on kgq reset drm/amdgpu/gfx12: re-emit unprocessed state on kgq reset drm/amdgpu/gfx9: re-emit unprocessed state on kcq reset drm/amdgpu/gfx9.4.3: re-emit unprocessed state on kcq reset drm/amdgpu/gfx10: re-emit unprocessed state on kcq reset drm/amdgpu/gfx11: re-emit unprocessed state on kcq reset drm/amdgpu/gfx12: re-emit unprocessed state on kcq reset
Christian König (1):
drm/amdgpu: rework queue reset scheduler interaction
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 6 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 32 ++++++----- drivers/gpu/drm/amd/amdgpu/amdgpu_job.h | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 23 ++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 5 ++ drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 67 +++++++++++++--------- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 60 +++++++++++++------- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 60 +++++++++++++------- drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 71 ------------------------ drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 71 ------------------------ drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 65 ++++++---------------- drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 21 ++++++- 12 files changed, 214 insertions(+), 269 deletions(-)
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v4 1/16 drm/amdgpu/gfx10: enable legacy enforce isolation
Enable legacy enforce isolation (just serialize kernel GC submissions). This way we can reset a ring and only affect the the process currently using that ring. This mirrors what windows does.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +9 -0
@@ -7788,6 +7788,15 @@ static void gfx_v10_0_ring_emit_gds_switch(struct amdgpu_ring *ring,static int gfx_v10_0_early_init (struct amdgpu_ip_block *ip_block) {struct amdgpu_device *adev = ip_block->adev; +int i; + +if (amdgpu_enforce_isolation ==-1 ) { +for (i =0 ; i <MAX_XCP ; i++) { +/* enable legacy mode by default */ + adev->enforce_isolation[i] = +AMDGPU_ENFORCE_ISOLATION_ENABLE_LEGACY ; + } + } adev->gfx.funcs = &gfx_v10_0_gfx_funcs;
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v4 2/16 drm/amdgpu/gfx11: enable legacy enforce isolation
In reply to Alex DeucherEnable legacy enforce isolation (just serialize kernel GC submissions). This way we can reset a ring and only affect the the process currently using that ring. This mirrors what windows does.
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +9 -0
@@ -5189,6 +5189,15 @@ static void gfx_v11_0_ring_emit_gds_switch(struct amdgpu_ring *ring,static int gfx_v11_0_early_init (struct amdgpu_ip_block *ip_block) {struct amdgpu_device *adev = ip_block->adev; +int i; + +if (amdgpu_enforce_isolation ==-1 ) { +for (i =0 ; i <MAX_XCP ; i++) { +/* enable legacy mode by default */ + adev->enforce_isolation[i] = +AMDGPU_ENFORCE_ISOLATION_ENABLE_LEGACY ; + } + }switch (amdgpu_user_queue) {case -1 :
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v4 3/16 drm/amdgpu/gfx12: enable legacy enforce isolation
In reply to Alex DeucherEnable legacy enforce isolation (just serialize kernel GC submissions). This way we can reset a ring and only affect the the process currently using that ring. This mirrors what windows does.
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +9 -0
@@ -3823,6 +3823,15 @@ static uint64_t gfx_v12_0_get_gpu_clock_counter(struct amdgpu_device *adev)static int gfx_v12_0_early_init (struct amdgpu_ip_block *ip_block) {struct amdgpu_device *adev = ip_block->adev; +int i; + +if (amdgpu_enforce_isolation ==-1 ) { +for (i =0 ; i <MAX_XCP ; i++) { +/* enable legacy mode by default */ + adev->enforce_isolation[i] = +AMDGPU_ENFORCE_ISOLATION_ENABLE_LEGACY ; + } + }switch (amdgpu_user_queue) {case -1 :
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v4 4/16 drm/amdgpu/gfx7: drop reset_kgq
In reply to Alex DeucherIt doesn't work reliably and we have soft recover and full adapter reset so drop this.
--- drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 71 --------------------------- 1 file changed, 71 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +0 -71
@@ -4884,76 +4884,6 @@ static void gfx_v7_0_emit_mem_sync_compute(struct amdgpu_ring *ring)amdgpu_ring_write (ring,0x0000000A );/* poll interval */ } -static void gfx_v7_0_wait_reg_mem (struct amdgpu_ring *ring,int eng_sel, -int mem_space,int opt,uint32_t addr0, -uint32_t addr1,uint32_t ref,uint32_t mask, -uint32_t inv) -{ -amdgpu_ring_write (ring,PACKET3 (PACKET3_WAIT_REG_MEM ,5 )); -amdgpu_ring_write (ring, -/* memory (1) or register (0) */ - (WAIT_REG_MEM_MEM_SPACE (mem_space) | -WAIT_REG_MEM_OPERATION (opt) |/* wait */ -WAIT_REG_MEM_FUNCTION (3 ) |/* equal */ -WAIT_REG_MEM_ENGINE (eng_sel))); - -if (mem_space) -BUG_ON (addr0 &0x3 );/* Dword align */ -amdgpu_ring_write (ring, addr0); -amdgpu_ring_write (ring, addr1); -amdgpu_ring_write (ring, ref); -amdgpu_ring_write (ring, mask); -amdgpu_ring_write (ring, inv);/* poll interval */ -} - -static void gfx_v7_0_ring_emit_reg_wait (struct amdgpu_ring *ring,uint32_t reg, -uint32_t val,uint32_t mask) -{ -gfx_v7_0_wait_reg_mem (ring,0 ,0 ,0 , reg,0 , val, mask,0x20 ); -} - -static int gfx_v7_0_reset_kgq (struct amdgpu_ring *ring,unsigned int vmid) -{ -struct amdgpu_device *adev = ring->adev; -struct amdgpu_kiq *kiq = &adev->gfx.kiq[0 ]; -struct amdgpu_ring *kiq_ring = &kiq->ring; -unsigned long flags; -u32 tmp; -int r; - -if (amdgpu_sriov_vf (adev)) -return -EINVAL ; - -if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues) -return -EINVAL ; - -spin_lock_irqsave (&kiq->ring_lock, flags); - -if (amdgpu_ring_alloc (kiq_ring,5 )) { -spin_unlock_irqrestore (&kiq->ring_lock, flags); -return -ENOMEM ; - } - - tmp =REG_SET_FIELD (0 ,CP_VMID_RESET ,RESET_REQUEST ,1 << vmid); -gfx_v7_0_ring_emit_wreg (kiq_ring, mmCP_VMID_RESET, tmp); -amdgpu_ring_commit (kiq_ring); - -spin_unlock_irqrestore (&kiq->ring_lock, flags); - - r =amdgpu_ring_test_ring (kiq_ring); -if (r) -return r; - -if (amdgpu_ring_alloc (ring,7 +12 +5 )) -return -ENOMEM ; -gfx_v7_0_ring_emit_fence_gfx (ring, ring->fence_drv.gpu_addr, - ring->fence_drv.sync_seq,AMDGPU_FENCE_FLAG_EXEC ); -gfx_v7_0_ring_emit_reg_wait (ring, mmCP_VMID_RESET,0 ,0xffff ); -gfx_v7_0_ring_emit_wreg (ring, mmCP_VMID_RESET,0 ); - -return amdgpu_ring_test_ring (ring); -} -static const struct amd_ip_funcs gfx_v7_0_ip_funcs = { .name ="gfx_v7_0" , .early_init = gfx_v7_0_early_init,
@@ -5003,7 +4933,6 @@ static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_gfx = { .emit_wreg = gfx_v7_0_ring_emit_wreg, .soft_recovery = gfx_v7_0_ring_soft_recovery, .emit_mem_sync = gfx_v7_0_emit_mem_sync, - .reset = gfx_v7_0_reset_kgq, };static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_compute = {
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v4 5/16 drm/amdgpu/gfx8: drop reset_kgq
In reply to Alex DeucherIt doesn't work reliably and we have soft recover and full adapter reset so drop this.
--- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 71 --------------------------- 1 file changed, 71 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0 -71
@@ -6339,34 +6339,6 @@ static void gfx_v8_0_ring_emit_wreg(struct amdgpu_ring *ring, uint32_t reg,amdgpu_ring_write (ring, val); } -static void gfx_v8_0_wait_reg_mem (struct amdgpu_ring *ring,int eng_sel, -int mem_space,int opt,uint32_t addr0, -uint32_t addr1,uint32_t ref,uint32_t mask, -uint32_t inv) -{ -amdgpu_ring_write (ring,PACKET3 (PACKET3_WAIT_REG_MEM ,5 )); -amdgpu_ring_write (ring, -/* memory (1) or register (0) */ - (WAIT_REG_MEM_MEM_SPACE (mem_space) | -WAIT_REG_MEM_OPERATION (opt) |/* wait */ -WAIT_REG_MEM_FUNCTION (3 ) |/* equal */ -WAIT_REG_MEM_ENGINE (eng_sel))); - -if (mem_space) -BUG_ON (addr0 &0x3 );/* Dword align */ -amdgpu_ring_write (ring, addr0); -amdgpu_ring_write (ring, addr1); -amdgpu_ring_write (ring, ref); -amdgpu_ring_write (ring, mask); -amdgpu_ring_write (ring, inv);/* poll interval */ -} - -static void gfx_v8_0_ring_emit_reg_wait (struct amdgpu_ring *ring,uint32_t reg, -uint32_t val,uint32_t mask) -{ -gfx_v8_0_wait_reg_mem (ring,0 ,0 ,0 , reg,0 , val, mask,0x20 ); -} -static void gfx_v8_0_ring_soft_recovery (struct amdgpu_ring *ring,unsigned vmid) {struct amdgpu_device *adev = ring->adev;
@@ -6843,48 +6815,6 @@ static void gfx_v8_0_emit_wave_limit(struct amdgpu_ring *ring, bool enable) } -static int gfx_v8_0_reset_kgq (struct amdgpu_ring *ring,unsigned int vmid) -{ -struct amdgpu_device *adev = ring->adev; -struct amdgpu_kiq *kiq = &adev->gfx.kiq[0 ]; -struct amdgpu_ring *kiq_ring = &kiq->ring; -unsigned long flags; -u32 tmp; -int r; - -if (amdgpu_sriov_vf (adev)) -return -EINVAL ; - -if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues) -return -EINVAL ; - -spin_lock_irqsave (&kiq->ring_lock, flags); - -if (amdgpu_ring_alloc (kiq_ring,5 )) { -spin_unlock_irqrestore (&kiq->ring_lock, flags); -return -ENOMEM ; - } - - tmp =REG_SET_FIELD (0 ,CP_VMID_RESET ,RESET_REQUEST ,1 << vmid); -gfx_v8_0_ring_emit_wreg (kiq_ring, mmCP_VMID_RESET, tmp); -amdgpu_ring_commit (kiq_ring); - -spin_unlock_irqrestore (&kiq->ring_lock, flags); - - r =amdgpu_ring_test_ring (kiq_ring); -if (r) -return r; - -if (amdgpu_ring_alloc (ring,7 +12 +5 )) -return -ENOMEM ; -gfx_v8_0_ring_emit_fence_gfx (ring, ring->fence_drv.gpu_addr, - ring->fence_drv.sync_seq,AMDGPU_FENCE_FLAG_EXEC ); -gfx_v8_0_ring_emit_reg_wait (ring, mmCP_VMID_RESET,0 ,0xffff ); -gfx_v8_0_ring_emit_wreg (ring, mmCP_VMID_RESET,0 ); - -return amdgpu_ring_test_ring (ring); -} -static const struct amd_ip_funcs gfx_v8_0_ip_funcs = { .name ="gfx_v8_0" , .early_init = gfx_v8_0_early_init,
@@ -6950,7 +6880,6 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = { .emit_wreg = gfx_v8_0_ring_emit_wreg, .soft_recovery = gfx_v8_0_ring_soft_recovery, .emit_mem_sync = gfx_v8_0_emit_mem_sync, - .reset = gfx_v8_0_reset_kgq, };static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_compute = {
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v4 6/16 drm/amdgpu/gfx9: drop reset_kgq
In reply to Alex DeucherIt doesn't work reliably and we have soft recover and full adapter reset so drop this.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 46 --------------------------- 1 file changed, 46 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -46
@@ -7152,51 +7152,6 @@ static void gfx_v9_ring_insert_nop(struct amdgpu_ring *ring, uint32_t num_nop)amdgpu_ring_insert_nop (ring, num_nop -1 ); } -static int gfx_v9_0_reset_kgq (struct amdgpu_ring *ring,unsigned int vmid) -{ -struct amdgpu_device *adev = ring->adev; -struct amdgpu_kiq *kiq = &adev->gfx.kiq[0 ]; -struct amdgpu_ring *kiq_ring = &kiq->ring; -unsigned long flags; -u32 tmp; -int r; - -if (amdgpu_sriov_vf (adev)) -return -EINVAL ; - -if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues) -return -EINVAL ; - -spin_lock_irqsave (&kiq->ring_lock, flags); - -if (amdgpu_ring_alloc (kiq_ring,5 )) { -spin_unlock_irqrestore (&kiq->ring_lock, flags); -return -ENOMEM ; - } - - tmp =REG_SET_FIELD (0 ,CP_VMID_RESET ,RESET_REQUEST ,1 << vmid); -gfx_v9_0_ring_emit_wreg (kiq_ring, -SOC15_REG_OFFSET (GC ,0 , mmCP_VMID_RESET), tmp); -amdgpu_ring_commit (kiq_ring); - -spin_unlock_irqrestore (&kiq->ring_lock, flags); - - r =amdgpu_ring_test_ring (kiq_ring); -if (r) -return r; - -if (amdgpu_ring_alloc (ring,7 +7 +5 )) -return -ENOMEM ; -gfx_v9_0_ring_emit_fence (ring, ring->fence_drv.gpu_addr, - ring->fence_drv.sync_seq,AMDGPU_FENCE_FLAG_EXEC ); -gfx_v9_0_ring_emit_reg_wait (ring, -SOC15_REG_OFFSET (GC ,0 , mmCP_VMID_RESET),0 ,0xffff ); -gfx_v9_0_ring_emit_wreg (ring, -SOC15_REG_OFFSET (GC ,0 , mmCP_VMID_RESET),0 ); - -return amdgpu_ring_test_ring (ring); -} -static int gfx_v9_0_reset_kcq (struct amdgpu_ring *ring,unsigned int vmid) {
@@ -7477,7 +7432,6 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_gfx = { .emit_reg_write_reg_wait = gfx_v9_0_ring_emit_reg_write_reg_wait, .soft_recovery = gfx_v9_0_ring_soft_recovery, .emit_mem_sync = gfx_v9_0_emit_mem_sync, - .reset = gfx_v9_0_reset_kgq, .emit_cleaner_shader = gfx_v9_0_ring_emit_cleaner_shader, .begin_use = amdgpu_gfx_enforce_isolation_ring_begin_use, .end_use = amdgpu_gfx_enforce_isolation_ring_end_use,
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v4 7/16 drm/amdgpu: rework queue reset scheduler interaction
In reply to Alex DeucherFrom: Christian König <[email protected]>
Stopping the scheduler for queue reset is generally a good idea because it prevents any worker from touching the ring buffer.
But using amdgpu_fence_driver_force_completion() before restarting it was a really bad idea because it marked fences as failed while the work was potentially still running.
Stop doing that and cleanup the comment a bit.
v2: keep amdgpu_fence_driver_force_completion() for non-gfx rings
v3: drop amdgpu_fence_driver_force_completion() for compute ring
--- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 27 ++++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +15 -12
@@ -136,10 +136,12 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct drm_sched_job *s_job) }else if (amdgpu_gpu_recovery && ring->funcs->reset) {bool is_guilty; -dev_err (adev->dev,"Starting %s ring reset\n" , s_job->sched->name); -/* stop the scheduler, but don't mess with the -* bad job yet because if ring reset fails -* we'll fall back to full GPU reset. +dev_err (adev->dev,"Starting %s ring reset\n" , + s_job->sched->name); + +/* +* Stop the scheduler to prevent anybody else from touching the +* ring buffer. */ drm_sched_wqueue_stop (&ring->sched);
@@ -157,19 +159,20 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct drm_sched_job *s_job) r =amdgpu_ring_reset (ring, job->vmid);if (!r) { -if (amdgpu_ring_sched_ready (ring)) -drm_sched_stop (&ring->sched, s_job);if (is_guilty) {atomic_inc (&ring->adev->gpu_reset_counter); -amdgpu_fence_driver_force_completion (ring); +if ((ring->funcs->type !=AMDGPU_RING_TYPE_GFX ) && + (ring->funcs->type !=AMDGPU_RING_TYPE_COMPUTE )) +amdgpu_fence_driver_force_completion (ring); } -if (amdgpu_ring_sched_ready (ring)) -drm_sched_start (&ring->sched,0 ); -dev_err (adev->dev,"Ring %s reset succeeded\n" , ring->sched.name); -drm_dev_wedged_event (adev_to_drm (adev),DRM_WEDGE_RECOVERY_NONE ); +drm_sched_wqueue_start (&ring->sched); +dev_err (adev->dev,"Ring %s reset succeeded\n" , + ring->sched.name); +drm_dev_wedged_event (adev_to_drm (adev), +DRM_WEDGE_RECOVERY_NONE ); goto exit; } -dev_err (adev->dev,"Ring %s reset failure\n" , ring->sched.name); +dev_err (adev->dev,"Ring %s reset failed\n" , ring->sched.name); }dma_fence_set_error (&s_job->s_fence->finished, -ETIME );
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v4 8/16 drm/amdgpu: track ring state associated with a job
In reply to Alex DeucherWe need to know the wptr and sequence number associated with a job so that we can re-emit the unprocessed state after a ring reset. Pre-allocate storage space for the ring buffer contents and add a helper to save off the unprocessed state so that it can be re-emitted after the queue is reset.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 6 ++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 5 ++++- drivers/gpu/drm/amd/amdgpu/amdgpu_job.h | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 23 +++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 5 +++++ 5 files changed, 40 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +6 -0
@@ -306,6 +306,12 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs,amdgpu_ring_ib_end (ring);amdgpu_ring_commit (ring); +/* This must be last for resets to work properly +* as we need to save the wptr associated with this +* job. +*/ +if (job) + job->ring_wptr = ring->wptr;return 0 ; }
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +4 -1
@@ -91,6 +91,7 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct drm_sched_job *s_job)struct amdgpu_job *job =to_amdgpu_job (s_job);struct amdgpu_task_info *ti;struct amdgpu_device *adev = ring->adev; +struct dma_fence *fence = &job->hw_fence;int idx;int r;
@@ -154,8 +155,10 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct drm_sched_job *s_job)else is_guilty = true; -if (is_guilty) +if (is_guilty) { +amdgpu_ring_backup_unprocessed_jobs (ring, job->ring_wptr, fence->seqno);dma_fence_set_error (&s_job->s_fence->finished, -ETIME ); + } r =amdgpu_ring_reset (ring, job->vmid);if (!r) {
drivers/gpu/drm/amd/amdgpu/amdgpu_job.h +2 -0
@@ -79,6 +79,8 @@ struct amdgpu_job {/* enforce isolation */ bool enforce_isolation;bool run_cleaner_shader; +/* wptr for the job for resets */ +uint32_t ring_wptr;uint32_t num_ibs;struct amdgpu_ib ibs[];
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +23 -0
@@ -333,6 +333,12 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,/* Initialize cached_rptr to 0 */ ring->cached_rptr =0 ; +if (!ring->ring_backup) { + ring->ring_backup =kvzalloc (ring->ring_size,GFP_KERNEL ); +if (!ring->ring_backup) +return -ENOMEM ; + } +/* Allocate ring buffer */ if (ring->ring_obj ==NULL ) { r = amdgpu_bo_create_kernel(adev, ring->ring_size + ring->funcs->extra_dw, PAGE_SIZE,
@@ -342,6 +348,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, (void **)&ring->ring);if (r) {dev_err (adev->dev,"(%d) ring create failed\n" , r); +kvfree (ring->ring_backup);return r; }amdgpu_ring_clear_ring (ring);
@@ -385,6 +392,8 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring)amdgpu_bo_free_kernel (&ring->ring_obj, &ring->gpu_addr, (void **)&ring->ring); +kvfree (ring->ring_backup); + ring->ring_backup =NULL ;dma_fence_put (ring->vmid_wait); ring->vmid_wait =NULL ;
@@ -753,3 +762,17 @@ bool amdgpu_ring_sched_ready(struct amdgpu_ring *ring)return true; } + +void amdgpu_ring_backup_unprocessed_jobs (struct amdgpu_ring *ring, +u64 bad_wptr,u32 bad_seq) +{ +unsigned int entries_to_copy = ring->wptr - bad_wptr; +unsigned int idx, i; + +for (i =0 ; i < entries_to_copy; i++) { + idx = (bad_wptr + i) & ring->buf_mask; + ring->ring_backup[i] = ring->ring[idx]; + } + ring->ring_backup_entries_to_copy = entries_to_copy; + ring->ring_backup_seq = bad_seq; +}
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +5 -0
@@ -268,6 +268,9 @@ struct amdgpu_ring {struct amdgpu_bo *ring_obj;uint32_t *ring; +uint32_t *ring_backup; +uint32_t ring_backup_seq; +unsigned int ring_backup_entries_to_copy;unsigned rptr_offs;u64 rptr_gpu_addr;volatile u32 *rptr_cpu_addr;
@@ -534,4 +537,6 @@ int amdgpu_ib_pool_init(struct amdgpu_device *adev);void amdgpu_ib_pool_fini (struct amdgpu_device *adev);int amdgpu_ib_ring_tests (struct amdgpu_device *adev);bool amdgpu_ring_sched_ready (struct amdgpu_ring *ring); +void amdgpu_ring_backup_unprocessed_jobs (struct amdgpu_ring *ring, +u64 bad_wptr,u32 bad_seq);#endif
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v4 9/16 drm/amdgpu/gfx10: re-emit unprocessed state on kgq reset
In reply to Alex DeucherRe-emit the unprocessed state after resetting the queue.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +18 -7
@@ -9537,6 +9537,7 @@ static int gfx_v10_0_reset_kgq(struct amdgpu_ring *ring, unsigned int vmid)struct amdgpu_kiq *kiq = &adev->gfx.kiq[0 ];struct amdgpu_ring *kiq_ring = &kiq->ring;unsigned long flags; +unsigned int i;u32 tmp;u64 addr;int r;
@@ -9571,10 +9572,8 @@ static int gfx_v10_0_reset_kgq(struct amdgpu_ring *ring, unsigned int vmid) SOC15_REG_OFFSET(GC, 0, mmCP_VMID_RESET), 0, 0xffffffff); kiq->pmf->kiq_map_queues (kiq_ring, ring);amdgpu_ring_commit (kiq_ring); - -spin_unlock_irqrestore (&kiq->ring_lock, flags); - r =amdgpu_ring_test_ring (kiq_ring); +spin_unlock_irqrestore (&kiq->ring_lock, flags);if (r)return r;
@@ -9584,7 +9583,21 @@ static int gfx_v10_0_reset_kgq(struct amdgpu_ring *ring, unsigned int vmid)return r; } -return amdgpu_ring_test_ring (ring); +if (amdgpu_ring_alloc (ring,8 )) +return -ENOMEM ; +amdgpu_ring_emit_fence (ring, ring->fence_drv.gpu_addr, + ring->ring_backup_seq,0 ); +amdgpu_ring_commit (ring); + r =amdgpu_ring_test_ring (ring); +if (r) +return r; +if (amdgpu_ring_alloc (ring, ring->ring_backup_entries_to_copy)) +return -ENOMEM ; +for (i =0 ; i < ring->ring_backup_entries_to_copy; i++) +amdgpu_ring_write (ring, ring->ring_backup[i]); +amdgpu_ring_commit (ring); + +return r; } static int gfx_v10_0_reset_kcq(struct amdgpu_ring *ring,
@@ -9612,9 +9625,8 @@ static int gfx_v10_0_reset_kcq(struct amdgpu_ring *ring, kiq->pmf->kiq_unmap_queues (kiq_ring, ring,RESET_QUEUES ,0 ,0 );amdgpu_ring_commit (kiq_ring); -spin_unlock_irqrestore (&kiq->ring_lock, flags); - r =amdgpu_ring_test_ring (kiq_ring); +spin_unlock_irqrestore (&kiq->ring_lock, flags);if (r)return r;
@@ -9891,7 +9903,6 @@ static const struct amdgpu_ring_funcs gfx_v10_0_ring_funcs_gfx = { .emit_wreg = gfx_v10_0_ring_emit_wreg, .emit_reg_wait = gfx_v10_0_ring_emit_reg_wait, .emit_reg_write_reg_wait = gfx_v10_0_ring_emit_reg_write_reg_wait, - .soft_recovery = gfx_v10_0_ring_soft_recovery, .emit_mem_sync = gfx_v10_0_emit_mem_sync, .reset = gfx_v10_0_reset_kgq, .emit_cleaner_shader = gfx_v10_0_ring_emit_cleaner_shader,
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v4 10/16 drm/amdgpu/gfx11: re-emit unprocessed state on kgq reset
In reply to Alex DeucherRe-emit the unprocessed state after resetting the queue.
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +16 -2
@@ -6818,6 +6818,7 @@ static int gfx_v11_reset_gfx_pipe(struct amdgpu_ring *ring)static int gfx_v11_0_reset_kgq (struct amdgpu_ring *ring,unsigned int vmid) {struct amdgpu_device *adev = ring->adev; +unsigned int i;int r;if (amdgpu_sriov_vf (adev))
@@ -6844,7 +6845,21 @@ static int gfx_v11_0_reset_kgq(struct amdgpu_ring *ring, unsigned int vmid)return r; } -return amdgpu_ring_test_ring (ring); +if (amdgpu_ring_alloc (ring,8 )) +return -ENOMEM ; +amdgpu_ring_emit_fence (ring, ring->fence_drv.gpu_addr, + ring->ring_backup_seq,0 ); +amdgpu_ring_commit (ring); + r =amdgpu_ring_test_ring (ring); +if (r) +return r; +if (amdgpu_ring_alloc (ring, ring->ring_backup_entries_to_copy)) +return -ENOMEM ; +for (i =0 ; i < ring->ring_backup_entries_to_copy; i++) +amdgpu_ring_write (ring, ring->ring_backup[i]); +amdgpu_ring_commit (ring); + +return r; }static int gfx_v11_0_reset_compute_pipe (struct amdgpu_ring *ring)
@@ -7240,7 +7255,6 @@ static const struct amdgpu_ring_funcs gfx_v11_0_ring_funcs_gfx = { .emit_wreg = gfx_v11_0_ring_emit_wreg, .emit_reg_wait = gfx_v11_0_ring_emit_reg_wait, .emit_reg_write_reg_wait = gfx_v11_0_ring_emit_reg_write_reg_wait, - .soft_recovery = gfx_v11_0_ring_soft_recovery, .emit_mem_sync = gfx_v11_0_emit_mem_sync, .reset = gfx_v11_0_reset_kgq, .emit_cleaner_shader = gfx_v11_0_ring_emit_cleaner_shader,
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v4 11/16 drm/amdgpu/gfx12: re-emit unprocessed state on kgq reset
In reply to Alex DeucherRe-emit the unprocessed state after resetting the queue.
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +16 -2
@@ -5319,6 +5319,7 @@ static int gfx_v12_reset_gfx_pipe(struct amdgpu_ring *ring)static int gfx_v12_0_reset_kgq (struct amdgpu_ring *ring,unsigned int vmid) {struct amdgpu_device *adev = ring->adev; +unsigned int i;int r;if (amdgpu_sriov_vf (adev))
@@ -5344,7 +5345,21 @@ static int gfx_v12_0_reset_kgq(struct amdgpu_ring *ring, unsigned int vmid)return r; } -return amdgpu_ring_test_ring (ring); +if (amdgpu_ring_alloc (ring,8 )) +return -ENOMEM ; +amdgpu_ring_emit_fence (ring, ring->fence_drv.gpu_addr, + ring->ring_backup_seq,0 ); +amdgpu_ring_commit (ring); + r =amdgpu_ring_test_ring (ring); +if (r) +return r; +if (amdgpu_ring_alloc (ring, ring->ring_backup_entries_to_copy)) +return -ENOMEM ; +for (i =0 ; i < ring->ring_backup_entries_to_copy; i++) +amdgpu_ring_write (ring, ring->ring_backup[i]); +amdgpu_ring_commit (ring); + +return r; }static int gfx_v12_0_reset_compute_pipe (struct amdgpu_ring *ring)
@@ -5535,7 +5550,6 @@ static const struct amdgpu_ring_funcs gfx_v12_0_ring_funcs_gfx = { .emit_wreg = gfx_v12_0_ring_emit_wreg, .emit_reg_wait = gfx_v12_0_ring_emit_reg_wait, .emit_reg_write_reg_wait = gfx_v12_0_ring_emit_reg_write_reg_wait, - .soft_recovery = gfx_v12_0_ring_soft_recovery, .emit_mem_sync = gfx_v12_0_emit_mem_sync, .reset = gfx_v12_0_reset_kgq, .emit_cleaner_shader = gfx_v12_0_ring_emit_cleaner_shader,
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v4 12/16 drm/amdgpu/gfx9: re-emit unprocessed state on kcq reset
In reply to Alex DeucherRe-emit the unprocessed state after resetting the queue.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +17 -2
@@ -7216,13 +7216,28 @@ static int gfx_v9_0_reset_kcq(struct amdgpu_ring *ring, } kiq->pmf->kiq_map_queues (kiq_ring, ring);amdgpu_ring_commit (kiq_ring); -spin_unlock_irqrestore (&kiq->ring_lock, flags); r =amdgpu_ring_test_ring (kiq_ring); +spin_unlock_irqrestore (&kiq->ring_lock, flags);if (r) {DRM_ERROR ("fail to remap queue\n" );return r; } -return amdgpu_ring_test_ring (ring); + +if (amdgpu_ring_alloc (ring,8 )) +return -ENOMEM ; +amdgpu_ring_emit_fence (ring, ring->fence_drv.gpu_addr, + ring->ring_backup_seq,0 ); +amdgpu_ring_commit (ring); + r =amdgpu_ring_test_ring (ring); +if (r) +return r; +if (amdgpu_ring_alloc (ring, ring->ring_backup_entries_to_copy)) +return -ENOMEM ; +for (i =0 ; i < ring->ring_backup_entries_to_copy; i++) +amdgpu_ring_write (ring, ring->ring_backup[i]); +amdgpu_ring_commit (ring); + +return r; }static void gfx_v9_ip_print (struct amdgpu_ip_block *ip_block,struct drm_printer *p)
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v4 13/16 drm/amdgpu/gfx9.4.3: re-emit unprocessed state on kcq reset
In reply to Alex DeucherRe-emit the unprocessed state after resetting the queue.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +18 -3
@@ -3558,6 +3558,7 @@ static int gfx_v9_4_3_reset_kcq(struct amdgpu_ring *ring,struct amdgpu_kiq *kiq = &adev->gfx.kiq[ring->xcc_id];struct amdgpu_ring *kiq_ring = &kiq->ring;unsigned long flags; +unsigned int i;int r;if (amdgpu_sriov_vf (adev))
@@ -3612,14 +3613,28 @@ static int gfx_v9_4_3_reset_kcq(struct amdgpu_ring *ring, } kiq->pmf->kiq_map_queues (kiq_ring, ring);amdgpu_ring_commit (kiq_ring); -spin_unlock_irqrestore (&kiq->ring_lock, flags); - r =amdgpu_ring_test_ring (kiq_ring); +spin_unlock_irqrestore (&kiq->ring_lock, flags);if (r) {dev_err (adev->dev,"fail to remap queue\n" );return r; } -return amdgpu_ring_test_ring (ring); + +if (amdgpu_ring_alloc (ring,8 )) +return -ENOMEM ; +amdgpu_ring_emit_fence (ring, ring->fence_drv.gpu_addr, + ring->ring_backup_seq,0 ); +amdgpu_ring_commit (ring); + r =amdgpu_ring_test_ring (ring); +if (r) +return r; +if (amdgpu_ring_alloc (ring, ring->ring_backup_entries_to_copy)) +return -ENOMEM ; +for (i =0 ; i < ring->ring_backup_entries_to_copy; i++) +amdgpu_ring_write (ring, ring->ring_backup[i]); +amdgpu_ring_commit (ring); + +return r; }enum amdgpu_gfx_cp_ras_mem_id {
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v4 14/16 drm/amdgpu/gfx10: re-emit unprocessed state on kcq reset
In reply to Alex DeucherRe-emit the unprocessed state after resetting the queue.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 33 ++++++++++++-------------- 1 file changed, 15 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +15 -18
@@ -9055,21 +9055,6 @@ static void gfx_v10_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring, ref, mask); } -static void gfx_v10_0_ring_soft_recovery (struct amdgpu_ring *ring, -unsigned int vmid) -{ -struct amdgpu_device *adev = ring->adev; -uint32_t value =0 ; - - value =REG_SET_FIELD (value,SQ_CMD ,CMD ,0x03 ); - value =REG_SET_FIELD (value,SQ_CMD ,MODE ,0x01 ); - value =REG_SET_FIELD (value,SQ_CMD ,CHECK_VMID ,1 ); - value =REG_SET_FIELD (value,SQ_CMD ,VM_ID , vmid); -amdgpu_gfx_rlc_enter_safe_mode (adev,0 ); -WREG32_SOC15 (GC ,0 , mmSQ_CMD, value); -amdgpu_gfx_rlc_exit_safe_mode (adev,0 ); -} - static void gfx_v10_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev, uint32_t me, uint32_t pipe,
@@ -9662,13 +9647,26 @@ static int gfx_v10_0_reset_kcq(struct amdgpu_ring *ring, } kiq->pmf->kiq_map_queues (kiq_ring, ring);amdgpu_ring_commit (kiq_ring); + r =amdgpu_ring_test_ring (kiq_ring);spin_unlock_irqrestore (&kiq->ring_lock, flags); +if (r) +return r; - r =amdgpu_ring_test_ring (kiq_ring); +if (amdgpu_ring_alloc (ring,8 )) +return -ENOMEM ; +amdgpu_ring_emit_fence (ring, ring->fence_drv.gpu_addr, + ring->ring_backup_seq,0 ); +amdgpu_ring_commit (ring); + r =amdgpu_ring_test_ring (ring);if (r)return r; +if (amdgpu_ring_alloc (ring, ring->ring_backup_entries_to_copy)) +return -ENOMEM ; +for (i =0 ; i < ring->ring_backup_entries_to_copy; i++) +amdgpu_ring_write (ring, ring->ring_backup[i]); +amdgpu_ring_commit (ring); -return amdgpu_ring_test_ring (ring); +return r; }static void gfx_v10_ip_print (struct amdgpu_ip_block *ip_block,struct drm_printer *p)
@@ -9943,7 +9941,6 @@ static const struct amdgpu_ring_funcs gfx_v10_0_ring_funcs_compute = { .emit_wreg = gfx_v10_0_ring_emit_wreg, .emit_reg_wait = gfx_v10_0_ring_emit_reg_wait, .emit_reg_write_reg_wait = gfx_v10_0_ring_emit_reg_write_reg_wait, - .soft_recovery = gfx_v10_0_ring_soft_recovery, .emit_mem_sync = gfx_v10_0_emit_mem_sync, .reset = gfx_v10_0_reset_kcq, .emit_cleaner_shader = gfx_v10_0_ring_emit_cleaner_shader,
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v4 15/16 drm/amdgpu/gfx11: re-emit unprocessed state on kcq reset
In reply to Alex DeucherRe-emit the unprocessed state after resetting the queue.
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 33 +++++++++++++------------- 1 file changed, 16 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +16 -17
@@ -6287,21 +6287,6 @@ static void gfx_v11_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring, ref, mask, 0x20); } -static void gfx_v11_0_ring_soft_recovery (struct amdgpu_ring *ring, -unsigned vmid) -{ -struct amdgpu_device *adev = ring->adev; -uint32_t value =0 ; - - value =REG_SET_FIELD (value,SQ_CMD ,CMD ,0x03 ); - value =REG_SET_FIELD (value,SQ_CMD ,MODE ,0x01 ); - value =REG_SET_FIELD (value,SQ_CMD ,CHECK_VMID ,1 ); - value =REG_SET_FIELD (value,SQ_CMD ,VM_ID , vmid); -amdgpu_gfx_rlc_enter_safe_mode (adev,0 ); -WREG32_SOC15 (GC ,0 , regSQ_CMD, value); -amdgpu_gfx_rlc_exit_safe_mode (adev,0 ); -} - static void gfx_v11_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev, uint32_t me, uint32_t pipe,
@@ -6995,6 +6980,7 @@ static int gfx_v11_0_reset_compute_pipe(struct amdgpu_ring *ring)static int gfx_v11_0_reset_kcq (struct amdgpu_ring *ring,unsigned int vmid) {struct amdgpu_device *adev = ring->adev; +unsigned int i;int r =0 ;if (amdgpu_sriov_vf (adev))
@@ -7019,7 +7005,21 @@ static int gfx_v11_0_reset_kcq(struct amdgpu_ring *ring, unsigned int vmid)return r; } -return amdgpu_ring_test_ring (ring); +if (amdgpu_ring_alloc (ring,8 )) +return -ENOMEM ; +amdgpu_ring_emit_fence (ring, ring->fence_drv.gpu_addr, + ring->ring_backup_seq,0 ); +amdgpu_ring_commit (ring); + r =amdgpu_ring_test_ring (ring); +if (r) +return r; +if (amdgpu_ring_alloc (ring, ring->ring_backup_entries_to_copy)) +return -ENOMEM ; +for (i =0 ; i < ring->ring_backup_entries_to_copy; i++) +amdgpu_ring_write (ring, ring->ring_backup[i]); +amdgpu_ring_commit (ring); + +return r; }static void gfx_v11_ip_print (struct amdgpu_ip_block *ip_block,struct drm_printer *p)
@@ -7296,7 +7296,6 @@ static const struct amdgpu_ring_funcs gfx_v11_0_ring_funcs_compute = { .emit_wreg = gfx_v11_0_ring_emit_wreg, .emit_reg_wait = gfx_v11_0_ring_emit_reg_wait, .emit_reg_write_reg_wait = gfx_v11_0_ring_emit_reg_write_reg_wait, - .soft_recovery = gfx_v11_0_ring_soft_recovery, .emit_mem_sync = gfx_v11_0_emit_mem_sync, .reset = gfx_v11_0_reset_kcq, .emit_cleaner_shader = gfx_v11_0_ring_emit_cleaner_shader,
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v4 16/16 drm/amdgpu/gfx12: re-emit unprocessed state on kcq reset
In reply to Alex DeucherRe-emit the unprocessed state after resetting the queue.
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 33 +++++++++++++------------- 1 file changed, 16 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +16 -17
@@ -4699,21 +4699,6 @@ static void gfx_v12_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring, ref, mask, 0x20); } -static void gfx_v12_0_ring_soft_recovery (struct amdgpu_ring *ring, -unsigned vmid) -{ -struct amdgpu_device *adev = ring->adev; -uint32_t value =0 ; - - value =REG_SET_FIELD (value,SQ_CMD ,CMD ,0x03 ); - value =REG_SET_FIELD (value,SQ_CMD ,MODE ,0x01 ); - value =REG_SET_FIELD (value,SQ_CMD ,CHECK_VMID ,1 ); - value =REG_SET_FIELD (value,SQ_CMD ,VM_ID , vmid); -amdgpu_gfx_rlc_enter_safe_mode (adev,0 ); -WREG32_SOC15 (GC ,0 , regSQ_CMD, value); -amdgpu_gfx_rlc_exit_safe_mode (adev,0 ); -} - static void gfx_v12_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev, uint32_t me, uint32_t pipe,
@@ -5448,6 +5433,7 @@ static int gfx_v12_0_reset_compute_pipe(struct amdgpu_ring *ring)static int gfx_v12_0_reset_kcq (struct amdgpu_ring *ring,unsigned int vmid) {struct amdgpu_device *adev = ring->adev; +unsigned int i;int r;if (amdgpu_sriov_vf (adev))
@@ -5472,7 +5458,21 @@ static int gfx_v12_0_reset_kcq(struct amdgpu_ring *ring, unsigned int vmid)return r; } -return amdgpu_ring_test_ring (ring); +if (amdgpu_ring_alloc (ring,8 )) +return -ENOMEM ; +amdgpu_ring_emit_fence (ring, ring->fence_drv.gpu_addr, + ring->ring_backup_seq,0 ); +amdgpu_ring_commit (ring); + r =amdgpu_ring_test_ring (ring); +if (r) +return r; +if (amdgpu_ring_alloc (ring, ring->ring_backup_entries_to_copy)) +return -ENOMEM ; +for (i =0 ; i < ring->ring_backup_entries_to_copy; i++) +amdgpu_ring_write (ring, ring->ring_backup[i]); +amdgpu_ring_commit (ring); + +return r; }static void gfx_v12_0_ring_begin_use (struct amdgpu_ring *ring)
@@ -5588,7 +5588,6 @@ static const struct amdgpu_ring_funcs gfx_v12_0_ring_funcs_compute = { .emit_wreg = gfx_v12_0_ring_emit_wreg, .emit_reg_wait = gfx_v12_0_ring_emit_reg_wait, .emit_reg_write_reg_wait = gfx_v12_0_ring_emit_reg_write_reg_wait, - .soft_recovery = gfx_v12_0_ring_soft_recovery, .emit_mem_sync = gfx_v12_0_emit_mem_sync, .reset = gfx_v12_0_reset_kcq, .emit_cleaner_shader = gfx_v12_0_ring_emit_cleaner_shader,
Signature · 1 line
2.49.0