Skip to contentSkip to conversation

drm/amdgpu: skip call ras_late_init if ras block is not supported

PATCH In review Yang Wang 2 participants 2 messages Jan 22, 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 block is not supported

skip call ras_late_init callback if ras block is not supported.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +5 -2
index f4fcb008d7ba..61ba7cd8345d 100644
@@ -3346,12 +3346,15 @@ int amdgpu_ras_late_init(struct amdgpu_device *adev)
 		amdgpu_ras_set_mca_debug_mode(adev, false);
 
 	list_for_each_entry_safe(node, tmp, &adev->ras_list, node) {
-		if (!node->ras_obj) {
+		obj = node->ras_obj;
+		if (!obj) {
 			dev_warn(adev->dev, "Warning: abnormal ras list node.\n");
 			continue;
 		}
 
-		obj = node->ras_obj;
+		if (!amdgpu_ras_is_supported(adev, obj->ras_comm.block))
+			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 42 lines

-----Original Message-----
From: Wang, Yang(Kevin) <[email protected]>
Sent: Monday, January 22, 2024 1:29 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 block is not supported

skip call ras_late_init callback if ras block is not supported.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +5 -2
index f4fcb008d7ba..61ba7cd8345d 100644
@@ -3346,12 +3346,15 @@ int amdgpu_ras_late_init(struct amdgpu_device
 *adev)
              amdgpu_ras_set_mca_debug_mode(adev, false);
 
      list_for_each_entry_safe(node, tmp, &adev->ras_list, node) {
-             if (!node->ras_obj) {
+             obj = node->ras_obj;
+             if (!obj) {
                      dev_warn(adev->dev, "Warning: abnormal ras list
 node.\n");
                      continue;
              }
 
-             obj = node->ras_obj;
+             if (!amdgpu_ras_is_supported(adev, obj->ras_comm.block))
+                     continue;
+
              if (obj->ras_late_init) {
                      r = obj->ras_late_init(adev, &obj->ras_comm);
                      if (r) {

--
2.34.1