Skip to contentSkip to conversation

drm/amdgpu: skip call ras_late_init if ras feature is not enabled

PATCH In review Yang Wang 2 participants 2 messages Jan 18, 2024

Subsystems (2)
lore
Share & tools
lore

Yang Wang

author
#0 lore raw

PATCH 1/1 drm/amdgpu: skip call ras_late_init if ras feature is not enabled

skip call ras_late_init callback if ras feature is not enabled.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +3 -0
index 5c817c155d72..5c73d0871220 100644
@@ -3312,6 +3312,9 @@ int amdgpu_ras_late_init(struct amdgpu_device *adev)
 		}
 
 		obj = node->ras_obj;
+		if (!amdgpu_ras_is_feature_enabled(adev, &obj->ras_comm))
+			continue;
+
 		if (obj->ras_late_init) {
 			r = obj->ras_late_init(adev, &obj->ras_comm);
 			if (r) {
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - General]

Quoted 33 lines

-----Original Message-----
From: Wang, Yang(Kevin) <[email protected]>
Sent: Thursday, January 18, 2024 3:50 PM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Wang, Yang(Kevin) <[email protected]>
Subject: [PATCH] drm/amdgpu: skip call ras_late_init if ras feature is not enabled

skip call ras_late_init callback if ras feature is not enabled.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +3 -0
index 5c817c155d72..5c73d0871220 100644
@@ -3312,6 +3312,9 @@ int amdgpu_ras_late_init(struct amdgpu_device
 *adev)
              }
 
              obj = node->ras_obj;
+             if (!amdgpu_ras_is_feature_enabled(adev, &obj->ras_comm))
+                     continue;
+
              if (obj->ras_late_init) {
                      r = obj->ras_late_init(adev, &obj->ras_comm);
                      if (r) {

--
2.34.1