Skip to contentSkip to conversation

drm/amdgpu/userq: add a warning if fw does not support userqueues

PATCH In review Sunil Khatri 2 participants 2 messages Aug 31

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

PATCH 1/1 drm/amdgpu/userq: add a warning if fw does not support userqueues

Creating a queue could fail due to various reasons and returning -EINVAL does not suffice in case where fw does not support the uq's

It's better to add a one time log that saves unnecessary debug effort.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +18 -0
index 4c6e080671a7..f16af852725a 100644
@@ -659,6 +659,24 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
 
 	uq_funcs = adev->userq_funcs[args->in.ip_type];
 	if (!uq_funcs) {
+		switch (args->in.ip_type) {
+		case AMDGPU_HW_IP_GFX:
+		case AMDGPU_HW_IP_COMPUTE:
+			dev_warn_once(adev->dev,
+				      "Usermode queues for GFX/COMPUTE is not supported by the fw "
+				      "on this ASIC (me: %u, pfp: %u, mec: %u, mes: %u)\n",
+				      adev->gfx.me_fw_version, adev->gfx.pfp_fw_version,
+				      adev->gfx.mec_fw_version, adev->mes.fw_version[0]);
+			break;
+		case AMDGPU_HW_IP_DMA:
+			dev_warn_once(adev->dev,
+				      "Usermode queues for SDMA is not supported by the fw "
+				      "on this ASIC (sdma: %u)\n",
+				      adev->sdma.instance[0].fw_version);
+			break;
+		default:
+			break;
+		}
 		r = -EINVAL;
 		goto err_pm_runtime;
 	}
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Sunil Khatri

Creating a queue could fail due to various reasons and returning -EINVAL does not suffice in case where fw does not support the uq's

It's better to add a one time log that saves unnecessary debug effort.

Quoted 36 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +18 -1
index 4c6e080671a7..f16af852725a 100644
@@ -659,6 +659,24 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
 
        uq_funcs = adev->userq_funcs[args->in.ip_type];
        if (!uq_funcs) {
+               switch (args->in.ip_type) {
+               case AMDGPU_HW_IP_GFX:
+               case AMDGPU_HW_IP_COMPUTE:
+                       dev_warn_once(adev->dev,
+                                     "Usermode queues for GFX/COMPUTE is not supported by the fw "
+                                     "on this ASIC (me: %u, pfp: %u, mec: %u, mes: %u)\n",
+                                     adev->gfx.me_fw_version, adev->gfx.pfp_fw_version,
+                                     adev->gfx.mec_fw_version, adev->mes.fw_version[0]);
+                       break;
+               case AMDGPU_HW_IP_DMA:
+                       dev_warn_once(adev->dev,
+                                     "Usermode queues for SDMA is not supported by the fw "
+                                     "on this ASIC (sdma: %u)\n",
+                                     adev->sdma.instance[0].fw_version);
+                       break;
+               default:
+                       break;
+               }
                r = -EINVAL;
                goto err_pm_runtime;
        }
--

2.34.1