drm/amdgpu/gfx11: use the new MQD helper for queue reset

And while we are at it remove the reset parameter as it's
no longer needed.

Reviewed-by: Jesse Zhang <jesse.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Alex Deucher 2026-05-19 15:58:26 -04:00
parent a3cc796501
commit 0f1c75242b

View File

@ -4219,13 +4219,13 @@ static int gfx_v11_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
return 0;
}
static int gfx_v11_0_kgq_init_queue(struct amdgpu_ring *ring, bool reset)
static int gfx_v11_0_kgq_init_queue(struct amdgpu_ring *ring)
{
struct amdgpu_device *adev = ring->adev;
struct v11_gfx_mqd *mqd = ring->mqd_ptr;
int mqd_idx = ring - &adev->gfx.gfx_ring[0];
if (!reset && !amdgpu_in_reset(adev) && !adev->in_suspend) {
if (!amdgpu_in_reset(adev) && !adev->in_suspend) {
memset((void *)mqd, 0, sizeof(*mqd));
mutex_lock(&adev->srbm_mutex);
soc21_grbm_select(adev, ring->me, ring->pipe, ring->queue, 0);
@ -4252,7 +4252,7 @@ static int gfx_v11_0_cp_async_gfx_ring_resume(struct amdgpu_device *adev)
int r, i;
for (i = 0; i < adev->gfx.num_gfx_rings; i++) {
r = gfx_v11_0_kgq_init_queue(&adev->gfx.gfx_ring[i], false);
r = gfx_v11_0_kgq_init_queue(&adev->gfx.gfx_ring[i]);
if (r)
return r;
}
@ -4589,13 +4589,13 @@ static int gfx_v11_0_kiq_init_queue(struct amdgpu_ring *ring)
return 0;
}
static int gfx_v11_0_kcq_init_queue(struct amdgpu_ring *ring, bool reset)
static int gfx_v11_0_kcq_init_queue(struct amdgpu_ring *ring)
{
struct amdgpu_device *adev = ring->adev;
struct v11_compute_mqd *mqd = ring->mqd_ptr;
int mqd_idx = ring - &adev->gfx.compute_ring[0];
if (!reset && !amdgpu_in_reset(adev) && !adev->in_suspend) {
if (!amdgpu_in_reset(adev) && !adev->in_suspend) {
memset((void *)mqd, 0, sizeof(*mqd));
mutex_lock(&adev->srbm_mutex);
soc21_grbm_select(adev, ring->me, ring->pipe, ring->queue, 0);
@ -4632,7 +4632,7 @@ static int gfx_v11_0_kcq_resume(struct amdgpu_device *adev)
gfx_v11_0_cp_compute_enable(adev, true);
for (i = 0; i < adev->gfx.num_compute_rings; i++) {
r = gfx_v11_0_kcq_init_queue(&adev->gfx.compute_ring[i], false);
r = gfx_v11_0_kcq_init_queue(&adev->gfx.compute_ring[i]);
if (r)
return r;
}
@ -6829,11 +6829,7 @@ static int gfx_v11_0_reset_kgq(struct amdgpu_ring *ring,
return r;
if (use_mmio) {
r = gfx_v11_0_kgq_init_queue(ring, true);
if (r) {
dev_err(adev->dev, "failed to init kgq\n");
return r;
}
amdgpu_gfx_mqd_reset_restore(ring);
r = amdgpu_mes_map_legacy_queue(adev, ring, 0);
if (r) {
@ -6860,11 +6856,8 @@ static int gfx_v11_0_reset_kcq(struct amdgpu_ring *ring,
return r;
if (use_mmio) {
r = gfx_v11_0_kcq_init_queue(ring, true);
if (r) {
dev_err(adev->dev, "fail to init kcq\n");
return r;
}
amdgpu_gfx_mqd_reset_restore(ring);
r = amdgpu_mes_map_legacy_queue(adev, ring, 0);
if (r) {
dev_err(adev->dev, "failed to remap kcq\n");