drm/amdgpu: use IP version check in sysfs creation conditional logic
authorCe Sun <cesun102@amd.com>
Thu, 9 Jul 2026 06:22:51 +0000 (14:22 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 14 Jul 2026 23:12:36 +0000 (19:12 -0400)
avoid sysfs node creation faults when performing NPS mode switching

Signed-off-by: Ce Sun <cesun102@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

index fd2c0cc..19067df 100644 (file)
@@ -3777,8 +3777,11 @@ int amdgpu_ras_block_late_init(struct amdgpu_device *adev,
        }
 
        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))) {
+          (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;