drm/amdgpu: Support poison error injection via ras_ctrl debugfs
authorCandice Li <candice.li@amd.com>
Thu, 4 Jan 2024 02:27:10 +0000 (10:27 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 9 Jan 2024 20:44:13 +0000 (15:44 -0500)
Support poison error injection.

Signed-off-by: Candice Li <candice.li@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

index 9a64584318e028ae61d50ce4ab09ec30a52df721..3f7f5c12961d33402833e5ce25d0ec315a35bde3 100644 (file)
@@ -305,11 +305,13 @@ static int amdgpu_ras_debugfs_ctrl_parse_data(struct file *f,
                        return -EINVAL;
 
                data->head.block = block_id;
-               /* only ue and ce errors are supported */
+               /* only ue, ce and poison errors are supported */
                if (!memcmp("ue", err, 2))
                        data->head.type = AMDGPU_RAS_ERROR__MULTI_UNCORRECTABLE;
                else if (!memcmp("ce", err, 2))
                        data->head.type = AMDGPU_RAS_ERROR__SINGLE_CORRECTABLE;
+               else if (!memcmp("poison", err, 6))
+                       data->head.type = AMDGPU_RAS_ERROR__POISON;
                else
                        return -EINVAL;
 
@@ -431,9 +433,10 @@ static void amdgpu_ras_instance_mask_check(struct amdgpu_device *adev,
  * The block is one of: umc, sdma, gfx, etc.
  *     see ras_block_string[] for details
  *
- * The error type is one of: ue, ce, where,
+ * The error type is one of: ue, ce and poison where,
  *     ue is multi-uncorrectable
  *     ce is single-correctable
+ *     poison is poison
  *
  * The sub-block is a the sub-block index, pass 0 if there is no sub-block.
  * The address and value are hexadecimal numbers, leading 0x is optional.