From: Alex Deucher <alexander.deucher@amd.com>
To: <amd-gfx@lists.freedesktop.org>, <christian.koenig@amd.com>,
<sasundar@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Subject: [PATCH 12/33] drm/amdgpu/gfx11: re-emit unprocessed state on ring reset
Date: Thu, 26 Jun 2025 23:39:41 -0400 [thread overview]
Message-ID: <20250627034002.5590-13-alexander.deucher@amd.com> (raw)
In-Reply-To: <20250627034002.5590-1-alexander.deucher@amd.com>
Re-emit the unprocessed state after resetting the queue.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 35 +++-----------------------
1 file changed, 4 insertions(+), 31 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
index 37dcec2d07841..04b2e3def5098 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
@@ -6283,21 +6283,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,
@@ -6821,7 +6806,7 @@ static int gfx_v11_0_reset_kgq(struct amdgpu_ring *ring,
if (amdgpu_sriov_vf(adev))
return -EINVAL;
- drm_sched_wqueue_stop(&ring->sched);
+ amdgpu_ring_reset_helper_begin(ring, timedout_fence);
r = amdgpu_mes_reset_legacy_queue(ring->adev, ring, vmid, false);
if (r) {
@@ -6844,12 +6829,7 @@ static int gfx_v11_0_reset_kgq(struct amdgpu_ring *ring,
return r;
}
- r = amdgpu_ring_test_ring(ring);
- if (r)
- return r;
- amdgpu_fence_driver_force_completion(ring);
- drm_sched_wqueue_start(&ring->sched);
- return 0;
+ return amdgpu_ring_reset_helper_end(ring, timedout_fence);
}
static int gfx_v11_0_reset_compute_pipe(struct amdgpu_ring *ring)
@@ -6992,7 +6972,7 @@ static int gfx_v11_0_reset_kcq(struct amdgpu_ring *ring,
if (amdgpu_sriov_vf(adev))
return -EINVAL;
- drm_sched_wqueue_stop(&ring->sched);
+ amdgpu_ring_reset_helper_begin(ring, timedout_fence);
r = amdgpu_mes_reset_legacy_queue(ring->adev, ring, vmid, true);
if (r) {
@@ -7013,12 +6993,7 @@ static int gfx_v11_0_reset_kcq(struct amdgpu_ring *ring,
return r;
}
- r = amdgpu_ring_test_ring(ring);
- if (r)
- return r;
- amdgpu_fence_driver_force_completion(ring);
- drm_sched_wqueue_start(&ring->sched);
- return 0;
+ return amdgpu_ring_reset_helper_end(ring, timedout_fence);
}
static void gfx_v11_ip_print(struct amdgpu_ip_block *ip_block, struct drm_printer *p)
@@ -7254,7 +7229,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,
@@ -7296,7 +7270,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,
--
2.50.0
next prev parent reply other threads:[~2025-06-27 3:40 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-27 3:39 [PATCH V12 00/33] Reset improvements Alex Deucher
2025-06-27 3:39 ` [PATCH 01/33] drm/amdgpu/gfx10: fix KGQ reset sequence Alex Deucher
2025-06-30 8:37 ` Christian König
2025-06-27 3:39 ` [PATCH 02/33] drm/amdgpu/sdma: consolidate engine reset handling Alex Deucher
2025-06-30 8:40 ` Christian König
2025-06-30 13:47 ` Alex Deucher
2025-06-27 3:39 ` [PATCH 03/33] drm/amdgpu/sdma: allow caller to handle kernel rings in engine reset Alex Deucher
2025-06-27 3:39 ` [PATCH 04/33] drm/amdgpu/sdma5: clean up resume code Alex Deucher
2025-06-30 8:52 ` Christian König
2025-06-27 3:39 ` [PATCH 05/33] drm/amdgpu/sdma5.2: " Alex Deucher
2025-06-30 8:53 ` Christian König
2025-06-27 3:39 ` [PATCH 06/33] drm/amdgpu/sdma6: " Alex Deucher
2025-06-30 8:55 ` Christian König
2025-06-27 3:39 ` [PATCH 07/33] drm/amdgpu/sdma7: " Alex Deucher
2025-06-30 8:56 ` Christian König
2025-06-27 3:39 ` [PATCH 08/33] drm/amdgpu: track ring state associated with a fence Alex Deucher
2025-06-27 3:39 ` [PATCH 09/33] drm/amdgpu/gfx9: re-emit unprocessed state on kcq reset Alex Deucher
2025-06-27 3:39 ` [PATCH 10/33] drm/amdgpu/gfx9.4.3: " Alex Deucher
2025-06-27 3:39 ` [PATCH 11/33] drm/amdgpu/gfx10: re-emit unprocessed state on ring reset Alex Deucher
2025-06-27 3:39 ` Alex Deucher [this message]
2025-06-27 3:39 ` [PATCH 13/33] drm/amdgpu/gfx12: " Alex Deucher
2025-06-27 3:39 ` [PATCH 14/33] drm/amdgpu/sdma5: " Alex Deucher
2025-06-27 3:39 ` [PATCH 15/33] drm/amdgpu/sdma5.2: " Alex Deucher
2025-06-27 3:39 ` [PATCH 16/33] drm/amdgpu/sdma6: " Alex Deucher
2025-06-27 3:39 ` [PATCH 17/33] drm/amdgpu/sdma7: " Alex Deucher
2025-06-27 3:39 ` [PATCH 18/33] drm/amdgpu/jpeg2: " Alex Deucher
2025-06-27 3:39 ` [PATCH 19/33] drm/amdgpu/jpeg2.5: " Alex Deucher
2025-06-27 3:39 ` [PATCH 20/33] drm/amdgpu/jpeg3: " Alex Deucher
2025-06-27 3:39 ` [PATCH 21/33] drm/amdgpu/jpeg4: " Alex Deucher
2025-06-27 3:39 ` [PATCH 22/33] drm/amdgpu/jpeg4.0.3: " Alex Deucher
2025-06-27 3:39 ` [PATCH 23/33] drm/amdgpu/jpeg4.0.5: add queue reset Alex Deucher
2025-06-27 3:39 ` [PATCH 24/33] drm/amdgpu/jpeg5: " Alex Deucher
2025-06-27 3:39 ` [PATCH 25/33] drm/amdgpu/jpeg5.0.1: re-emit unprocessed state on ring reset Alex Deucher
2025-06-27 3:39 ` [PATCH 26/33] drm/amdgpu/vcn4: " Alex Deucher
2025-06-27 3:39 ` [PATCH 27/33] drm/amdgpu/vcn4.0.3: " Alex Deucher
2025-06-27 3:39 ` [PATCH 28/33] drm/amdgpu/vcn4.0.5: " Alex Deucher
2025-06-27 3:39 ` [PATCH 29/33] drm/amdgpu/vcn5: " Alex Deucher
2025-06-27 3:39 ` [PATCH 30/33] drm/amdgpu/vcn: add a helper framework for engine resets Alex Deucher
2025-06-27 3:40 ` [PATCH 31/33] drm/amdgpu/vcn2: implement ring reset Alex Deucher
2025-06-27 3:40 ` [PATCH 32/33] drm/amdgpu/vcn2.5: " Alex Deucher
2025-06-27 3:40 ` [PATCH 33/33] drm/amdgpu/vcn3: " Alex Deucher
2025-07-01 15:25 ` [PATCH V12 00/33] Reset improvements Krzysztof Łopatowski
2025-07-01 15:30 ` Alex Deucher
-- strict thread matches above, loose matches on Subject: below --
2025-07-11 22:39 [PATCH V15 " Alex Deucher
2025-07-11 22:40 ` [PATCH 12/33] drm/amdgpu/gfx11: re-emit unprocessed state on ring reset Alex Deucher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250627034002.5590-13-alexander.deucher@amd.com \
--to=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=sasundar@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.