drm/amdgpu: optimize gfx ras features flag clean
authorStanley.Yang <Stanley.Yang@amd.com>
Mon, 19 Apr 2021 03:33:10 +0000 (11:33 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 23 Apr 2021 21:15:52 +0000 (17:15 -0400)
Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

index b0d2fc9454caadb0d5e5410a63022406c01ac835..bb0d02755f1127fd90e0cf6d6e7f5157ddc09c9d 100644 (file)
@@ -658,11 +658,7 @@ static int __amdgpu_ras_feature_enable(struct amdgpu_device *adev,
                con->features |= BIT(head->block);
        } else {
                if (obj && amdgpu_ras_is_feature_enabled(adev, head)) {
-                       /* skip clean gfx ras context feature for VEGA20 Gaming.
-                        * will clean later
-                        */
-                       if (!(!adev->ras_features && con->features & BIT(AMDGPU_RAS_BLOCK__GFX)))
-                               con->features &= ~BIT(head->block);
+                       con->features &= ~BIT(head->block);
                        put_obj(obj);
                }
        }
@@ -770,6 +766,10 @@ int amdgpu_ras_feature_enable_on_boot(struct amdgpu_device *adev,
                                con->features |= BIT(head->block);
 
                        ret = amdgpu_ras_feature_enable(adev, head, 0);
+
+                       /* clean gfx block ras features flag */
+                       if (adev->ras_features && head->block == AMDGPU_RAS_BLOCK__GFX)
+                               con->features &= ~BIT(head->block);
                }
        } else
                ret = amdgpu_ras_feature_enable(adev, head, enable);