]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
Merge tag 'for-linus-5.13-ofs-1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_ras.c
index 44dfb3613e377f9773077f3861b94dda33283831..b0d2fc9454caadb0d5e5410a63022406c01ac835 100644 (file)
@@ -221,7 +221,7 @@ static int amdgpu_ras_debugfs_ctrl_parse_data(struct file *f,
                op = 1;
        else if (sscanf(str, "inject %32s %8s", block_name, err) == 2)
                op = 2;
-       else if (sscanf(str, "retire_page") == 0)
+       else if (strstr(str, "retire_page") != NULL)
                op = 3;
        else if (str[0] && str[1] && str[2] && str[3])
                /* ascii string, but commands are not matched. */
@@ -229,7 +229,8 @@ static int amdgpu_ras_debugfs_ctrl_parse_data(struct file *f,
 
        if (op != -1) {
                if (op == 3) {
-                       if (sscanf(str, "%*s %llx", &address) != 1)
+                       if (sscanf(str, "%*s 0x%llx", &address) != 1 &&
+                           sscanf(str, "%*s %llu", &address) != 1)
                                return -EINVAL;
 
                        data->op = op;
@@ -253,7 +254,9 @@ static int amdgpu_ras_debugfs_ctrl_parse_data(struct file *f,
                data->op = op;
 
                if (op == 2) {
-                       if (sscanf(str, "%*s %*s %*s %x %llx %llx",
+                       if (sscanf(str, "%*s %*s %*s 0x%x 0x%llx 0x%llx",
+                                  &sub_block, &address, &value) != 3 &&
+                           sscanf(str, "%*s %*s %*s %u %llu %llu",
                                   &sub_block, &address, &value) != 3)
                                return -EINVAL;
                        data->head.sub_block_index = sub_block;
@@ -498,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);
 }
This page took 0.038138 seconds and 4 git commands to generate.