Skip to contentSkip to conversation

drm/amdgpu: enable gfx12 queue reset flag

PATCH In review [email protected] 2 participants 3 messages Jan 6, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/amdgpu: enable gfx12 queue reset flag

Enable the kcg and kcq queue reset flag

---
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +9 -1
index 3aa34c55554d..69941442f00b 100644
@@ -1477,11 +1477,19 @@ static int gfx_v12_0_sw_init(struct amdgpu_ip_block *ip_block)
 		}
 	}
 
-	/* TODO: Add queue reset mask when FW fully supports it */
 	adev->gfx.gfx_supported_reset =
 		amdgpu_get_soft_full_reset_mask(&adev->gfx.gfx_ring[0]);
 	adev->gfx.compute_supported_reset =
 		amdgpu_get_soft_full_reset_mask(&adev->gfx.compute_ring[0]);
+	switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
+	case IP_VERSION(12, 0, 0):
+	case IP_VERSION(12, 0, 1):
+		if ((adev->gfx.me_fw_version >= 2660) &&
+			    (adev->gfx.mec_fw_version >= 2920)) {
+				adev->gfx.compute_supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE;
+				adev->gfx.gfx_supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE;
+		}
+	}
 
 	if (!adev->enable_mes_kiq) {
 		r = amdgpu_gfx_kiq_init(adev, GFX12_MEC_HPD_SIZE, 0);
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 drm/amdgpu/gfx12: implement kgq reset via mmio

replace MES kgq reset with MMIO.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +2 -2
index 69941442f00b..ba2ab9296eb4 100644
@@ -5254,9 +5254,9 @@ static int gfx_v12_0_reset_kgq(struct amdgpu_ring *ring, unsigned int vmid)
 	if (amdgpu_sriov_vf(adev))
 		return -EINVAL;
 
-	r = amdgpu_mes_reset_legacy_queue(ring->adev, ring, vmid, false);
+	r = amdgpu_mes_reset_legacy_queue(ring->adev, ring, vmid, true);
 	if (r) {
-		dev_err(adev->dev, "reset via MES failed %d\n", r);
+		dev_err(adev->dev, "reset via MMIO failed %d\n", r);
 		return r;
 	}
 
Signature · 1 line
2.25.1
Reviewed-by on v1 1/2
#2 lore raw
In reply to [email protected]

[Public]

Hi Jesse,

Quoted 10 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Monday, January 6, 2025 3:17 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Huang, Tim <[email protected]>; Zhu, Jiadong <[email protected]>; Zhang, Jesse(Jie) <[email protected]>
Subject: [PATCH 1/2] drm/amdgpu: enable gfx12 queue reset flag

Enable the kcg and kcq queue reset flag

A typo here, it should be "kgq" ?

With this addressed, this series is

Tim

Quoted 37 lines
---
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +9 -1
index 3aa34c55554d..69941442f00b 100644
@@ -1477,11 +1477,19 @@ static int gfx_v12_0_sw_init(struct
 amdgpu_ip_block *ip_block)
              }
      }
 
-     /* TODO: Add queue reset mask when FW fully supports it */
      adev->gfx.gfx_supported_reset =
              amdgpu_get_soft_full_reset_mask(&adev->gfx.gfx_ring[0]);
      adev->gfx.compute_supported_reset =
              amdgpu_get_soft_full_reset_mask(&adev->gfx.compute_ring[0]);
+     switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
+     case IP_VERSION(12, 0, 0):
+     case IP_VERSION(12, 0, 1):
+             if ((adev->gfx.me_fw_version >= 2660) &&
+                         (adev->gfx.mec_fw_version >= 2920)) {
+                             adev->gfx.compute_supported_reset |=
 AMDGPU_RESET_TYPE_PER_QUEUE;
+                             adev->gfx.gfx_supported_reset |=
 AMDGPU_RESET_TYPE_PER_QUEUE;
+             }
+     }
      if (!adev->enable_mes_kiq) {
              r = amdgpu_gfx_kiq_init(adev, GFX12_MEC_HPD_SIZE, 0);

--
2.25.1