Skip to contentSkip to conversation

drm/amdgpu: use IP version check in sysfs creation conditional logic

PATCH In review Ce Sun 2 participants 2 messages Jul 9

Subsystems (2)
lore
Share & tools
lore

Ce Sun

author
#0 lore raw

PATCH 1/1 drm/amdgpu: use IP version check in sysfs creation conditional logic

avoid sysfs node creation faults when performing NPS mode switching

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +5 -3
index 0183b2622d50..631afb5c10b4 100644
@@ -3788,9 +3788,11 @@ int amdgpu_ras_block_late_init(struct amdgpu_device *adev,
 			goto cleanup;
 	}
 
-	if (amdgpu_uniras_enabled(adev) || (ras_obj->hw_ops &&
-	    (ras_obj->hw_ops->query_ras_error_count ||
-	     ras_obj->hw_ops->query_ras_error_status))) {
+	if ((ras_obj->hw_ops && (ras_obj->hw_ops->query_ras_error_count ||
+	     ras_obj->hw_ops->query_ras_error_status)) ||
+	     amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 14) ||
+	     amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 12) ||
+	     amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 6)) {
 		r = amdgpu_ras_sysfs_create(adev, ras_block);
 		if (r)
 			goto interrupt;
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

AMD General

We can set uniras_enabled earlier in the next step, anyway, the patch is:

Quoted 40 lines

-----Original Message-----
From: Sun, Ce(Overlord) <[email protected]>
Sent: Thursday, July 9, 2026 2:24 PM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Chai, Thomas <[email protected]>; Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>; Sun, Ce(Overlord) <[email protected]>
Subject: [PATCH] drm/amdgpu: use IP version check in sysfs creation conditional logic

avoid sysfs node creation faults when performing NPS mode switching

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +5 -3
index 0183b2622d50..631afb5c10b4 100644
@@ -3788,9 +3788,11 @@ int amdgpu_ras_block_late_init(struct amdgpu_device
 *adev,
                      goto cleanup;
      }
 
-     if (amdgpu_uniras_enabled(adev) || (ras_obj->hw_ops &&
-         (ras_obj->hw_ops->query_ras_error_count ||
-          ras_obj->hw_ops->query_ras_error_status))) {
+     if ((ras_obj->hw_ops && (ras_obj->hw_ops->query_ras_error_count ||
+          ras_obj->hw_ops->query_ras_error_status)) ||
+          amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 14) ||
+          amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 12) ||
+          amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 6)) {
              r = amdgpu_ras_sysfs_create(adev, ras_block);
              if (r)
                      goto interrupt;

--
2.34.1