drm/amdgpu: print warning when input address is invalid
authorGuchun Chen <guchun.chen@amd.com>
Fri, 22 May 2020 07:50:15 +0000 (15:50 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 28 May 2020 18:00:49 +0000 (14:00 -0400)
This will assist debug in error injection case.

Signed-off-by: Guchun Chen <guchun.chen@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 50fe08bf2f727656d8680fa998795d490d6df218..9475891ee98940babbba8d07a82b35934130f1f7 100644 (file)
@@ -318,6 +318,9 @@ static ssize_t amdgpu_ras_debugfs_ctrl_write(struct file *f, const char __user *
        case 2:
                if ((data.inject.address >= adev->gmc.mc_vram_size) ||
                    (data.inject.address >= RAS_UMC_INJECT_ADDR_LIMIT)) {
+                       dev_warn(adev->dev, "RAS WARN: input address "
+                                       "0x%llx is invalid.",
+                                       data.inject.address);
                        ret = -EINVAL;
                        break;
                }