Skip to contentSkip to conversation

drm/amdgpu: Resolve RAS GFX error count issue v2

PATCH Superseded Candice Li 2 participants 3 messages Jun 1, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Candice Li

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Resolve RAS GFX error count issue v2

Fix misleading indentation

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +5 -4
index 99c1a2d3dae84d..424990e1bec10c 100644
@@ -599,14 +599,15 @@ int amdgpu_gfx_ras_late_init(struct amdgpu_device *adev, struct ras_common_if *r
 		if (!amdgpu_persistent_edc_harvesting_supported(adev))
 			amdgpu_ras_reset_error_status(adev, AMDGPU_RAS_BLOCK__GFX);
 
-	r = amdgpu_ras_block_late_init(adev, ras_block);
-	if (r)
-		return r;
+		r = amdgpu_ras_block_late_init(adev, ras_block);
+		if (r)
+			return r;
 
 		r = amdgpu_irq_get(adev, &adev->gfx.cp_ecc_error_irq, 0);
 		if (r)
 			goto late_fini;
-	}
+	} else
+		amdgpu_ras_feature_enable_on_boot(adev, ras_block, 0);
 
 	return 0;
 late_fini:
Signature · 1 line
2.17.1
#1 lore raw
Quoted 3 lines · Candice Li

Fix misleading indentation

Might want to split this into two patches, one to fix the indentation and one to fix the missing function call. Also you should mention the missing function call in the else case.

Quoted 16 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0 -3
index 99c1a2d3dae84d..424990e1bec10c 100644
@@ -599,14 +599,15 @@ int amdgpu_gfx_ras_late_init(struct amdgpu_device *adev, struct ras_common_if *r
                if (!amdgpu_persistent_edc_harvesting_supported(adev))
                        amdgpu_ras_reset_error_status(adev, AMDGPU_RAS_BLOCK__GFX);
 
-       r = amdgpu_ras_block_late_init(adev, ras_block);
-       if (r)
-               return r;

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c int amdgpu_gfx_ras_late_init(struct amdgpu_device *adev, struct ras_common_if *r · line 610

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +5 -1
+               r = amdgpu_ras_block_late_init(adev, ras_block);
+               if (r)
+                       return r;
 
                r = amdgpu_irq_get(adev, &adev->gfx.cp_ecc_error_irq, 0);
                if (r)
                        goto late_fini;
-       }
+       } else
+               amdgpu_ras_feature_enable_on_boot(adev, ras_block, 0);

Coding style. The else case needs { } as well to match kernel coding style guidelines.

Alex

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0 -1
        return 0;
 late_fini:
--

2.17.1

#2 lore raw

[Public]

Thanks for the review.
To fix the indentation will require the else case to let amdgpu_ras_block_late_init can go to ras unsupported code path. That's why I want to keep them in one patch.
I will update the commit message and coding style as you suggested.

Thanks,
Candice

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Thursday, June 2, 2022 1:19 AM
To: Li, Candice <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: Resolve RAS GFX error count issue v2

Quoted 3 lines · Candice Li

Fix misleading indentation

Might want to split this into two patches, one to fix the indentation and one to fix the missing function call. Also you should mention the missing function call in the else case.

Quoted 16 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0 -3
index 99c1a2d3dae84d..424990e1bec10c 100644
@@ -599,14 +599,15 @@ int amdgpu_gfx_ras_late_init(struct amdgpu_device *adev, struct ras_common_if *r
                if (!amdgpu_persistent_edc_harvesting_supported(adev))
                        amdgpu_ras_reset_error_status(adev, AMDGPU_RAS_BLOCK__GFX);
 
-       r = amdgpu_ras_block_late_init(adev, ras_block);
-       if (r)
-               return r;

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c int amdgpu_gfx_ras_late_init(struct amdgpu_device *adev, struct ras_common_if *r · line 610

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +5 -1
+               r = amdgpu_ras_block_late_init(adev, ras_block);
+               if (r)
+                       return r;
 
                r = amdgpu_irq_get(adev, &adev->gfx.cp_ecc_error_irq, 0);
                if (r)
                        goto late_fini;
-       }
+       } else
+               amdgpu_ras_feature_enable_on_boot(adev, ras_block, 0);

Coding style. The else case needs { } as well to match kernel coding style guidelines.

Alex

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0 -1
        return 0;
 late_fini:
--

2.17.1