Skip to contentSkip to conversation

drm/amdgpu: Fix false positive error log

PATCH In review Stanley.Yang 2 participants 2 messages Sep 15, 2023 – Sep 18, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/amdgpu: Fix false positive error log

It should first check block ras obj whether be set, it should return 0 directly if block ras obj or hw_ops is not set.

Changed from V1:
return 0 directly if block ras obj or hw ops is not set

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +5 -5
index 4a6df4e24243..25514af6cf8f 100644
@@ -1105,15 +1105,15 @@ int amdgpu_ras_reset_error_status(struct amdgpu_device *adev,
 {
 	struct amdgpu_ras_block_object *block_obj = amdgpu_ras_get_ras_block(adev, block, 0);
 
-	if (!amdgpu_ras_is_supported(adev, block))
-		return -EINVAL;
-
-	if (!block_obj || !block_obj->hw_ops)   {
+	if (!block_obj || !block_obj->hw_ops) {
 		dev_dbg_once(adev->dev, "%s doesn't config RAS function\n",
 			     ras_block_str(block));
-		return -EINVAL;
+		return 0;
 	}
 
+	if (!amdgpu_ras_is_supported(adev, block))
+		return -EINVAL;
+
 	if (block_obj->hw_ops->reset_ras_error_count)
 		block_obj->hw_ops->reset_ras_error_count(adev);
 
Signature · 1 line
2.25.1
Reviewed-by on v2 1/1
#1 lore raw

[AMD Official Use Only - General]

The update is fine for me, but since "!block_obj || !block_obj->hw_ops" is not considered as error status, can we change the dev_dbg_once to dev_info_once? With that fixed, the patch is:

Quoted 48 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Stanley.Yang
Sent: Friday, September 15, 2023 7:07 PM
To: [email protected]
Cc: Yang, Stanley <[email protected]>
Subject: [PATCH Review V2 1/1] drm/amdgpu: Fix false positive error log

It should first check block ras obj whether be set, it should return 0 directly if block ras obj or hw_ops is not set.

Changed from V1:
return 0 directly if block ras obj or hw ops is not set

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +5 -6
index 4a6df4e24243..25514af6cf8f 100644
@@ -1105,15 +1105,15 @@ int amdgpu_ras_reset_error_status(struct
 amdgpu_device *adev,  {
      struct amdgpu_ras_block_object *block_obj =
 amdgpu_ras_get_ras_block(adev, block, 0);
 
-     if (!amdgpu_ras_is_supported(adev, block))
-             return -EINVAL;
-
-     if (!block_obj || !block_obj->hw_ops)   {
+     if (!block_obj || !block_obj->hw_ops) {
              dev_dbg_once(adev->dev, "%s doesn't config RAS function\n",
                           ras_block_str(block));
-             return -EINVAL;
+             return 0;
      }
 
+     if (!amdgpu_ras_is_supported(adev, block))
+             return -EINVAL;
+
      if (block_obj->hw_ops->reset_ras_error_count)
              block_obj->hw_ops->reset_ras_error_count(adev);
 
--

2.25.1