[PATCH 15/19] drm/amdgpu/gfx9: re-emit unprocessed state on kcq reset
Alex Deucher
alexdeucher at gmail.com
Wed May 28 13:43:08 UTC 2025
On Wed, May 28, 2025 at 7:50 AM Christian König
<christian.koenig at amd.com> wrote:
>
> On 5/28/25 06:19, Alex Deucher wrote:
> > Re-emit the unprocessed state after resetting the queue.
>
> I don't think we want any of this for compute queues.
Why not? This allows us to do per job resets and can be trivially
extended to all engines.
Alex
>
> Regards,
> Christian.
>
> >
> > Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> > ---
> > drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 13 +++++++++++--
> > 1 file changed, 11 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> > index d50e125fd3e0d..75681075f1fc8 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> > @@ -7216,13 +7216,22 @@ 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 + ring->ring_backup_entries_to_copy))
> > + return -ENOMEM;
> > + amdgpu_ring_emit_fence(ring, ring->fence_drv.gpu_addr,
> > + ring->ring_backup_seq, 0);
> > + for (i = 0; i < ring->ring_backup_entries_to_copy; i++)
> > + amdgpu_ring_write(ring, ring->ring_backup[i]);
> > + amdgpu_ring_commit(ring);
> > +
> > + return gfx_v9_0_ring_test_ib(ring, AMDGPU_QUEUE_RESET_TIMEOUT);
> > }
> >
> > static void gfx_v9_ip_print(struct amdgpu_ip_block *ip_block, struct drm_printer *p)
>
More information about the amd-gfx
mailing list