All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V15 00/33] Reset improvements
@ 2025-07-11 22:39 Alex Deucher
  2025-07-11 22:39 ` [PATCH 01/33] drm/amdgpu: clean up sdma reset functions Alex Deucher
                   ` (32 more replies)
  0 siblings, 33 replies; 48+ messages in thread
From: Alex Deucher @ 2025-07-11 22:39 UTC (permalink / raw)
  To: amd-gfx, christian.koenig, sasundar; +Cc: Alex Deucher

This set improves per queue reset support for a number of IPs.
When we reset the queue, the queue is lost so we need
to re-emit the unprocessed state from subsequent submissions.
This is handled in gfx/compute queues via switch buffer and
pipeline sync packets.  However, you can still end up with
parallel execution across queues.  For correctness in that
cause, enforce isolation needs to be enabled.  That can
impact certain use cases however and in most cases, the
guilty job is correctly identified even without enforce isolation.

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.

The same approach is extended to SDMA and VCN.
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.

Tested with HangTestSuite and IGT reset/deadlock tests.

Patches apply to the amd-staging-drm-next or drm-next branches in my
git tree.

Git tree:
https://gitlab.freedesktop.org/agd5f/linux/-/commits/kq_resets?ref_type=heads

The IGT deadlock tests need the following fixes to properly handle -ETIME fences:
https://patchwork.freedesktop.org/series/150724/

v4: Drop explicit padding patches
    Drop new timeout macro
    Rework re-emit sequence
v5: Add a helper for reemit
    Convert VCN, JPEG, SDMA to use new helpers
v6: Update SDMA 4.4.2 to use new helpers
    Move ptr tracking to amdgpu_fence
    Skip all jobs from the bad context on the ring
v7: Rework the backup logic
    Move and clean up the guilty logic for engine resets
    Integrate suggestions from Christian
    Add JPEG 4.0.5 support
v8: Add non-guilty ring backup handling
    Clean up new function signatures
    Reorder some bug fixes to the start of the series
v9: Clean up fence_emit
    SDMA 5.x fixes
    Add new reset helpers
    sched wqueue stop/start cleanup
    Add support for VCNs without unified queues
v10: Drop enforce isolation default change
     Add more documentation
     Clean up ring backup logic
v11: SDMA6/7 fixes
v12: Ring backup and reemit fixes
     SDMA cleanups
     SDMA5.x reemit support
     GFX10 KGQ reset fix
v13: drop SDMA cleaups, they caused regressions in some IGT tests
v14: Split out reset fixes as separate patches
     Add additional error handling for VCN and JPEG
     Update commit messages per feedback
v15: clean up and unify SDMA, GC, JPEG, VCN reset handling using
     reset flags.

Alex Deucher (33):
  drm/amdgpu: clean up sdma reset functions
  drm/amdgpu/jpeg2: add additional ring reset error checking
  drm/amdgpu/jpeg3: add additional ring reset error checking
  drm/amdgpu/jpeg4: add additional ring reset error checking
  drm/amdgpu/vcn: don't enable per queue resets on SR-IOV
  drm/amdgpu: clean up jpeg reset functions
  drm/amdgpu: clean up GC reset functions
  drm/amdgpu: track ring state associated with a fence
  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 ring reset
  drm/amdgpu/gfx11: re-emit unprocessed state on ring reset
  drm/amdgpu/gfx12: re-emit unprocessed state on ring reset
  drm/amdgpu/sdma5: re-emit unprocessed state on ring reset
  drm/amdgpu/sdma5.2: re-emit unprocessed state on ring reset
  drm/amdgpu/sdma6: re-emit unprocessed state on ring reset
  drm/amdgpu/sdma7: re-emit unprocessed state on ring reset
  drm/amdgpu/jpeg2: re-emit unprocessed state on ring reset
  drm/amdgpu/jpeg2.5: re-emit unprocessed state on ring reset
  drm/amdgpu/jpeg3: re-emit unprocessed state on ring reset
  drm/amdgpu/jpeg4: re-emit unprocessed state on ring reset
  drm/amdgpu/jpeg4.0.3: re-emit unprocessed state on ring reset
  drm/amdgpu/jpeg4.0.5: add queue reset
  drm/amdgpu/jpeg5: add queue reset
  drm/amdgpu/jpeg5.0.1: re-emit unprocessed state on ring reset
  drm/amdgpu/vcn4: re-emit unprocessed state on ring reset
  drm/amdgpu/vcn4.0.3: re-emit unprocessed state on ring reset
  drm/amdgpu/vcn4.0.5: re-emit unprocessed state on ring reset
  drm/amdgpu/vcn5: re-emit unprocessed state on ring reset
  drm/amdgpu/vcn: add a helper framework for engine resets
  drm/amdgpu/vcn2: implement ring reset
  drm/amdgpu/vcn2.5: implement ring reset
  drm/amdgpu/vcn3: implement ring reset

 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 90 +++++++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c    | 15 +++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c   |  4 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c  | 67 +++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h  | 18 +++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c   | 79 ++++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h   |  6 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c    |  4 +
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c    | 49 ++++--------
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c    | 54 ++++----------
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c    | 53 ++++---------
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c     | 16 ++--
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c   | 23 +++---
 drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c    | 19 +++--
 drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c    | 15 ++--
 drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c    | 19 +++--
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c    | 20 ++---
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c  | 11 +--
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c  | 23 +++++-
 drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c  | 23 +++++-
 drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c  | 11 +--
 drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c    | 20 ++++-
 drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c    | 23 ++++--
 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c    | 27 +++----
 drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c    | 27 +++----
 drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c     | 26 +++++++
 drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c     | 25 +++++++
 drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c     | 27 +++++++
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c     | 13 +---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c   | 10 +--
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c   | 13 +---
 drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c   | 13 +---
 32 files changed, 575 insertions(+), 268 deletions(-)

-- 
2.50.0


^ permalink raw reply	[flat|nested] 48+ messages in thread

end of thread, other threads:[~2025-07-16  8:44 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-11 22:39 [PATCH V15 00/33] Reset improvements Alex Deucher
2025-07-11 22:39 ` [PATCH 01/33] drm/amdgpu: clean up sdma reset functions Alex Deucher
2025-07-14 13:27   ` Christian König
2025-07-14 14:00   ` Lazar, Lijo
2025-07-15 13:33     ` Alex Deucher
2025-07-11 22:39 ` [PATCH 02/33] drm/amdgpu/jpeg2: add additional ring reset error checking Alex Deucher
2025-07-14  2:58   ` Sundararaju, Sathishkumar
2025-07-14 13:29   ` Christian König
2025-07-11 22:39 ` [PATCH 03/33] drm/amdgpu/jpeg3: " Alex Deucher
2025-07-14  3:00   ` Sundararaju, Sathishkumar
2025-07-11 22:39 ` [PATCH 04/33] drm/amdgpu/jpeg4: " Alex Deucher
2025-07-14  3:02   ` Sundararaju, Sathishkumar
2025-07-11 22:39 ` [PATCH 05/33] drm/amdgpu/vcn: don't enable per queue resets on SR-IOV Alex Deucher
2025-07-14 13:30   ` Christian König
2025-07-11 22:39 ` [PATCH 06/33] drm/amdgpu: clean up jpeg reset functions Alex Deucher
2025-07-14  3:24   ` Sundararaju, Sathishkumar
2025-07-14 13:36   ` Christian König
2025-07-11 22:39 ` [PATCH 07/33] drm/amdgpu: clean up GC " Alex Deucher
2025-07-11 22:39 ` [PATCH 08/33] drm/amdgpu: track ring state associated with a fence Alex Deucher
2025-07-14 14:02   ` Christian König
2025-07-11 22:40 ` [PATCH 09/33] drm/amdgpu/gfx9: re-emit unprocessed state on kcq reset Alex Deucher
2025-07-11 22:40 ` [PATCH 10/33] drm/amdgpu/gfx9.4.3: " Alex Deucher
2025-07-15 16:12   ` Alex Deucher
2025-07-16  2:46     ` Zhang, Jesse(Jie)
2025-07-16  8:44     ` Christian König
2025-07-11 22:40 ` [PATCH 11/33] drm/amdgpu/gfx10: re-emit unprocessed state on ring reset Alex Deucher
2025-07-11 22:40 ` [PATCH 12/33] drm/amdgpu/gfx11: " Alex Deucher
2025-07-11 22:40 ` [PATCH 13/33] drm/amdgpu/gfx12: " Alex Deucher
2025-07-11 22:40 ` [PATCH 14/33] drm/amdgpu/sdma5: " Alex Deucher
2025-07-11 22:40 ` [PATCH 15/33] drm/amdgpu/sdma5.2: " Alex Deucher
2025-07-11 22:40 ` [PATCH 16/33] drm/amdgpu/sdma6: " Alex Deucher
2025-07-11 22:40 ` [PATCH 17/33] drm/amdgpu/sdma7: " Alex Deucher
2025-07-11 22:40 ` [PATCH 18/33] drm/amdgpu/jpeg2: " Alex Deucher
2025-07-11 22:40 ` [PATCH 19/33] drm/amdgpu/jpeg2.5: " Alex Deucher
2025-07-11 22:40 ` [PATCH 20/33] drm/amdgpu/jpeg3: " Alex Deucher
2025-07-11 22:40 ` [PATCH 21/33] drm/amdgpu/jpeg4: " Alex Deucher
2025-07-11 22:40 ` [PATCH 22/33] drm/amdgpu/jpeg4.0.3: " Alex Deucher
2025-07-11 22:40 ` [PATCH 23/33] drm/amdgpu/jpeg4.0.5: add queue reset Alex Deucher
2025-07-11 22:40 ` [PATCH 24/33] drm/amdgpu/jpeg5: " Alex Deucher
2025-07-11 22:40 ` [PATCH 25/33] drm/amdgpu/jpeg5.0.1: re-emit unprocessed state on ring reset Alex Deucher
2025-07-11 22:40 ` [PATCH 26/33] drm/amdgpu/vcn4: " Alex Deucher
2025-07-11 22:40 ` [PATCH 27/33] drm/amdgpu/vcn4.0.3: " Alex Deucher
2025-07-11 22:40 ` [PATCH 28/33] drm/amdgpu/vcn4.0.5: " Alex Deucher
2025-07-11 22:40 ` [PATCH 29/33] drm/amdgpu/vcn5: " Alex Deucher
2025-07-11 22:40 ` [PATCH 30/33] drm/amdgpu/vcn: add a helper framework for engine resets Alex Deucher
2025-07-11 22:40 ` [PATCH 31/33] drm/amdgpu/vcn2: implement ring reset Alex Deucher
2025-07-11 22:40 ` [PATCH 32/33] drm/amdgpu/vcn2.5: " Alex Deucher
2025-07-11 22:40 ` [PATCH 33/33] drm/amdgpu/vcn3: " Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.