Skip to contentSkip to conversation

drm/amdgpu: print warning when input address is invalid

PATCH In review Guchun Chen 2 participants 2 messages May 22, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: print warning when input address is invalid

This will assist debug in error injection case.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +3 -0
index 50fe08bf2f72..9475891ee989 100644
@@ -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;
 		}
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Acked-by Nirmoy Das on v1 1/1
#1 lore raw

LGTM

Quoted 13 lines · Guchun Chen

This will assist debug in error injection case.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0 -0
index 50fe08bf2f72..9475891ee989 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c static ssize_t amdgpu_ras_debugfs_ctrl_write(struct file *f, const char __user * · line 326

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +3 -0
@@ -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;
  		}

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx