All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V11 00/30] Reset improvements
@ 2025-06-25 21:06 Alex Deucher
  2025-06-25 21:06 ` [PATCH 01/30] drm/amdgpu: remove job parameter from amdgpu_fence_emit() Alex Deucher
                   ` (29 more replies)
  0 siblings, 30 replies; 35+ messages in thread
From: Alex Deucher @ 2025-06-25 21:06 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.

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

Alex Deucher (29):
  drm/amdgpu: remove job parameter from amdgpu_fence_emit()
  drm/amdgpu: update ring reset function signature
  drm/amdgpu: move force completion into ring resets
  drm/amdgpu: move guilty handling into ring resets
  drm/amdgpu: move scheduler wqueue handling into callbacks
  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/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

Christian König (1):
  drm/amdgpu: rework queue reset scheduler interaction

 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 133 ++++++++++++++++++----
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c    |  20 +++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c   |  48 ++------
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c  |  59 ++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h  |  27 ++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c  |  17 +--
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c   |  76 +++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h   |   6 +-
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c    |  42 +++----
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c    |  33 ++----
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c    |  33 ++----
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c     |   9 +-
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c   |  11 +-
 drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c    |   7 +-
 drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c    |   7 +-
 drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c    |   7 +-
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c    |   7 +-
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c  |   7 +-
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c  |  11 ++
 drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c  |  14 +++
 drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c  |   7 +-
 drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c  |  49 ++++----
 drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c    |   9 +-
 drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c    |   9 +-
 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c    |  21 ++--
 drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c    |  21 ++--
 drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c     |  12 ++
 drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c     |  11 ++
 drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c     |  13 +++
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c     |   8 +-
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c   |   9 +-
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c   |   8 +-
 drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c   |   8 +-
 33 files changed, 532 insertions(+), 227 deletions(-)

-- 
2.50.0


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

end of thread, other threads:[~2025-06-26 17:25 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-25 21:06 [PATCH V11 00/30] Reset improvements Alex Deucher
2025-06-25 21:06 ` [PATCH 01/30] drm/amdgpu: remove job parameter from amdgpu_fence_emit() Alex Deucher
2025-06-26  9:10   ` Christian König
2025-06-25 21:06 ` [PATCH 02/30] drm/amdgpu: update ring reset function signature Alex Deucher
2025-06-25 21:06 ` [PATCH 03/30] drm/amdgpu: rework queue reset scheduler interaction Alex Deucher
2025-06-25 21:06 ` [PATCH 04/30] drm/amdgpu: move force completion into ring resets Alex Deucher
2025-06-25 21:06 ` [PATCH 05/30] drm/amdgpu: move guilty handling " Alex Deucher
2025-06-25 21:06 ` [PATCH 06/30] drm/amdgpu: move scheduler wqueue handling into callbacks Alex Deucher
2025-06-26  9:33   ` Christian König
2025-06-25 21:06 ` [PATCH 07/30] drm/amdgpu: track ring state associated with a fence Alex Deucher
2025-06-26 11:02   ` Christian König
2025-06-26 17:25     ` Alex Deucher
2025-06-25 21:06 ` [PATCH 08/30] drm/amdgpu/gfx9: re-emit unprocessed state on kcq reset Alex Deucher
2025-06-25 21:06 ` [PATCH 09/30] drm/amdgpu/gfx9.4.3: " Alex Deucher
2025-06-25 21:06 ` [PATCH 10/30] drm/amdgpu/gfx10: re-emit unprocessed state on ring reset Alex Deucher
2025-06-25 21:06 ` [PATCH 11/30] drm/amdgpu/gfx11: " Alex Deucher
2025-06-25 21:06 ` [PATCH 12/30] drm/amdgpu/gfx12: " Alex Deucher
2025-06-25 21:06 ` [PATCH 13/30] drm/amdgpu/sdma6: " Alex Deucher
2025-06-25 21:06 ` [PATCH 14/30] drm/amdgpu/sdma7: " Alex Deucher
2025-06-25 21:06 ` [PATCH 15/30] drm/amdgpu/jpeg2: " Alex Deucher
2025-06-25 21:06 ` [PATCH 16/30] drm/amdgpu/jpeg2.5: " Alex Deucher
2025-06-25 21:06 ` [PATCH 17/30] drm/amdgpu/jpeg3: " Alex Deucher
2025-06-25 21:06 ` [PATCH 18/30] drm/amdgpu/jpeg4: " Alex Deucher
2025-06-25 21:06 ` [PATCH 19/30] drm/amdgpu/jpeg4.0.3: " Alex Deucher
2025-06-25 21:06 ` [PATCH 20/30] drm/amdgpu/jpeg4.0.5: add queue reset Alex Deucher
2025-06-25 21:06 ` [PATCH 21/30] drm/amdgpu/jpeg5: " Alex Deucher
2025-06-25 21:06 ` [PATCH 22/30] drm/amdgpu/jpeg5.0.1: re-emit unprocessed state on ring reset Alex Deucher
2025-06-25 21:06 ` [PATCH 23/30] drm/amdgpu/vcn4: " Alex Deucher
2025-06-25 21:06 ` [PATCH 24/30] drm/amdgpu/vcn4.0.3: " Alex Deucher
2025-06-25 21:06 ` [PATCH 25/30] drm/amdgpu/vcn4.0.5: " Alex Deucher
2025-06-25 21:06 ` [PATCH 26/30] drm/amdgpu/vcn5: " Alex Deucher
2025-06-25 21:06 ` [PATCH 27/30] drm/amdgpu/vcn: add a helper framework for engine resets Alex Deucher
2025-06-25 21:06 ` [PATCH 28/30] drm/amdgpu/vcn2: implement ring reset Alex Deucher
2025-06-25 21:06 ` [PATCH 29/30] drm/amdgpu/vcn2.5: " Alex Deucher
2025-06-25 21:06 ` [PATCH 30/30] 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.