Skip to contentSkip to conversation

drm/amdgpu/gfx11: return early in preempt_ib()

PATCH In review Alex Deucher 3 participants 4 messages Aug 15, 2024 – Aug 27, 2024

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/2 drm/amdgpu/gfx11: return early in preempt_ib()

When MES is enabled KIQ is not available. Return an error when someone uses the debugfs preempt test interface in that case.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +3 -0
index 5685aee479df..5704ad25a49d 100644
@@ -5924,6 +5924,9 @@ static int gfx_v11_0_ring_preempt_ib(struct amdgpu_ring *ring)
 	struct amdgpu_ring *kiq_ring = &kiq->ring;
 	unsigned long flags;
 
+	if (adev->enable_mes)
+		return -EINVAL;
+
 	if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues)
 		return -EINVAL;
 
Signature · 1 line
2.46.0
author maintainer
#1 lore raw

PATCH 2/2 drm/amdgpu/gfx12: return early in preempt_ib()

When MES is enabled KIQ is not available. Return an error when someone uses the debugfs preempt test interface in that case.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +3 -0
index f14e27f86e0e..070546c8dd59 100644
@@ -4501,6 +4501,9 @@ static int gfx_v12_0_ring_preempt_ib(struct amdgpu_ring *ring)
 	struct amdgpu_ring *kiq_ring = &kiq->ring;
 	unsigned long flags;
 
+	if (adev->enable_mes)
+		return -EINVAL;
+
 	if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues)
 		return -EINVAL;
 
Signature · 1 line
2.46.0
#2 lore raw
In reply to Alex Deucher

Ping on this series?

Alex

Quoted 27 lines · Alex Deucher

When MES is enabled KIQ is not available. Return an error when someone uses the debugfs preempt test interface in that case.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +3 -1
index 5685aee479df..5704ad25a49d 100644
@@ -5924,6 +5924,9 @@ static int gfx_v11_0_ring_preempt_ib(struct amdgpu_ring *ring)
        struct amdgpu_ring *kiq_ring = &kiq->ring;
        unsigned long flags;
 
+       if (adev->enable_mes)
+               return -EINVAL;
+
        if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues)
                return -EINVAL;
 
--

2.46.0

Acked-by on v1 1/2
#3 lore raw
In reply to Alex Deucher
Quoted 14 lines · Alex Deucher

When MES is enabled KIQ is not available. Return an error when someone uses the debugfs preempt test interface in that case.

---
  drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +0 -0
index 5685aee479df..5704ad25a49d 100644

drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c static int gfx_v11_0_ring_preempt_ib(struct amdgpu_ring *ring) · line 5932

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +3 -0
@@ -5924,6 +5924,9 @@ static int gfx_v11_0_ring_preempt_ib(struct amdgpu_ring *ring)
  	struct amdgpu_ring *kiq_ring = &kiq->ring;
  	unsigned long flags;
 
+	if (adev->enable_mes)
+		return -EINVAL;
+
  	if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues)
  		return -EINVAL;
 

With MES feature enabled, based on allowing multiple command streams to be executed concurrently on the GPU Vs KIQ that is used to send commands to the GPU in a sequential manner, having both of them active at the same time could lead to conflicts.

Therefore, when the MES is enabled, the KIQ becomes unavailable.

With this understanding, this series is: