]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/amdgpu: Reset RAS error count and status regs
authorMukul Joshi <mukul.joshi@amd.com>
Wed, 24 Mar 2021 15:36:33 +0000 (11:36 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 21 Apr 2021 01:45:10 +0000 (21:45 -0400)
Reset the RAS error count and error status registers after
reading to prevent over reporting error counts on Aldebaran.

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Reviewed-By: John Clements <John.Clements@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

index 7438d4e847763fb3a0e42dc86cf689cbb76a6e49..b0d2fc9454caadb0d5e5410a63022406c01ac835 100644 (file)
@@ -501,6 +501,12 @@ static ssize_t amdgpu_ras_sysfs_read(struct device *dev,
        if (amdgpu_ras_query_error_status(obj->adev, &info))
                return -EINVAL;
 
+
+       if (obj->adev->asic_type == CHIP_ALDEBARAN) {
+               if (amdgpu_ras_reset_error_status(obj->adev, info.head.block))
+                       DRM_WARN("Failed to reset error counter and error status");
+       }
+
        return sysfs_emit(buf, "%s: %lu\n%s: %lu\n", "ue", info.ue_count,
                          "ce", info.ce_count);
 }