Skip to contentSkip to conversation

drm/amdgpu: print warning when input address is invalid

PATCH In review Guchun Chen 2 participants 5 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.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +2 -0
index 6e911ca97038..5c73f444eaef 100644
@@ -318,6 +318,8 @@ 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, "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
#1 lore raw

[AMD Official Use Only - Internal Distribution Only]

Quoted 29 lines

-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: 2020年5月22日 15:53
To: [email protected]; Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Clements, John <[email protected]>; Li, Dennis <[email protected]>
Cc: Chen, Guchun <[email protected]>
Subject: [PATCH] drm/amdgpu: print warning when input address is invalid

This will assist debug.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0 -0
index 6e911ca97038..5c73f444eaef 100644
@@ -318,6 +318,8 @@ static ssize_t amdgpu_ras_debugfs_ctrl_write(struct

file *f, const char __user *

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +1 -0
 	case 2:
 		if ((data.inject.address >= adev->gmc.mc_vram_size) ||
 		    (data.inject.address >= RAS_UMC_INJECT_ADDR_LIMIT)) {
+			dev_warn(adev->dev, "Input address 0x%llx is

invalid.",

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

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +1 -0
+					data.inject.address);

[Tao] How about this way:
dev_warn(adev->dev, "RAS injection address 0x%llx exceeds limit 0x%llx.",

				data.inject.address, RAS_UMC_INJECT_ADDR_LIMIT);
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0 -1
 			ret = -EINVAL;
 			break;
 		}
--

2.17.1

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

#2 lore raw

[AMD Public Use]

Hi Tao,

Please see my response inline.

Regards,
Guchun

-----Original Message-----
From: Zhou1, Tao <[email protected]>
Sent: Friday, May 22, 2020 4:11 PM
To: Chen, Guchun <[email protected]>; [email protected]; Zhang, Hawking <[email protected]>; Clements, John <[email protected]>; Li, Dennis <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: print warning when input address is invalid

[AMD Official Use Only - Internal Distribution Only]

Quoted 30 lines

-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: 2020年5月22日 15:53
To: [email protected]; Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Clements, John <[email protected]>; Li, Dennis <[email protected]>
Cc: Chen, Guchun <[email protected]>
Subject: [PATCH] drm/amdgpu: print warning when input address is invalid

This will assist debug.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0 -0
index 6e911ca97038..5c73f444eaef 100644
@@ -318,6 +318,8 @@ static ssize_t 

amdgpu_ras_debugfs_ctrl_write(struct
file *f, const char __user *

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +1 -0
 	case 2:
 		if ((data.inject.address >= adev->gmc.mc_vram_size) ||
 		    (data.inject.address >= RAS_UMC_INJECT_ADDR_LIMIT)) {
+			dev_warn(adev->dev, "Input address 0x%llx is

invalid.",

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

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +1 -0
+					data.inject.address);

[Tao] How about this way:
dev_warn(adev->dev, "RAS injection address 0x%llx exceeds limit 0x%llx.",

				data.inject.address, RAS_UMC_INJECT_ADDR_LIMIT);

[Guchun]There are two cases for invalid input address, one is limited by board vram size, and one is by RAS_UMC_INJECT_ADDR_LIMIT. So it's not necessary to distinguish here, just print warning to let user knows the input address is not correct, and this error injection is blocked.

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0 -1
 			ret = -EINVAL;
 			break;
 		}
--

2.17.1

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

Reviewed-by
#3 lore raw

[AMD Public Use]

OK, but I still suggest adding "RAS" in the print to indicate its module, with this addressed the patch is:

Quoted 65 lines

-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: 2020年5月22日 16:31
To: Zhou1, Tao <[email protected]>; [email protected]; Zhang, Hawking <[email protected]>; Clements, John <[email protected]>; Li, Dennis <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: print warning when input address is invalid

[AMD Public Use]

Hi Tao,

Please see my response inline.

Regards,
Guchun

-----Original Message-----
From: Zhou1, Tao <[email protected]>
Sent: Friday, May 22, 2020 4:11 PM
To: Chen, Guchun <[email protected]>; amd- [email protected]; Zhang, Hawking <[email protected]>; Clements, John <[email protected]>; Li, Dennis <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: print warning when input address is invalid

[AMD Official Use Only - Internal Distribution Only]

Quoted 5 lines

-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: 2020年5月22日 15:53
To: [email protected]; Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>;

Clements,

Quoted 25 lines

John <[email protected]>; Li, Dennis <[email protected]>
Cc: Chen, Guchun <[email protected]>
Subject: [PATCH] drm/amdgpu: print warning when input address is invalid

This will assist debug.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0 -0
index 6e911ca97038..5c73f444eaef 100644
@@ -318,6 +318,8 @@ static ssize_t

amdgpu_ras_debugfs_ctrl_write(struct
file *f, const char __user *

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +1 -0
 	case 2:
 		if ((data.inject.address >= adev->gmc.mc_vram_size) ||
 		    (data.inject.address >= RAS_UMC_INJECT_ADDR_LIMIT)) {
+			dev_warn(adev->dev, "Input address 0x%llx is

invalid.",

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

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +1 -0
+					data.inject.address);
Quoted 14 lines

[Tao] How about this way:
dev_warn(adev->dev, "RAS injection address 0x%llx exceeds limit 0x%llx.",
data.inject.address,
RAS_UMC_INJECT_ADDR_LIMIT); [Guchun]There are two cases for invalid input address, one is limited by board vram size, and one is by RAS_UMC_INJECT_ADDR_LIMIT.
So it's not necessary to distinguish here, just print warning to let user knows the input address is not correct, and this error injection is blocked.

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0 -1
 			ret = -EINVAL;
 			break;
 		}
--

2.17.1

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

author Reviewed-by Tao Zhou
#4 lore raw

[AMD Public Use]

Thanks Tao. I will address that when pushing.

Regards,
Guchun

-----Original Message-----
From: Zhou1, Tao <[email protected]>
Sent: Friday, May 22, 2020 4:51 PM
To: Chen, Guchun <[email protected]>; [email protected]; Zhang, Hawking <[email protected]>; Clements, John <[email protected]>; Li, Dennis <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: print warning when input address is invalid

[AMD Public Use]

OK, but I still suggest adding "RAS" in the print to indicate its module, with this addressed the patch is:

Quoted 64 lines

-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: 2020年5月22日 16:31
To: Zhou1, Tao <[email protected]>; [email protected]; Zhang, Hawking <[email protected]>; Clements, John <[email protected]>; Li, Dennis <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: print warning when input address is invalid

[AMD Public Use]

Hi Tao,

Please see my response inline.

Regards,
Guchun

-----Original Message-----
From: Zhou1, Tao <[email protected]>
Sent: Friday, May 22, 2020 4:11 PM
To: Chen, Guchun <[email protected]>; amd- [email protected]; Zhang, Hawking <[email protected]>; Clements, John <[email protected]>; Li, Dennis <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: print warning when input address is invalid

[AMD Official Use Only - Internal Distribution Only]

Quoted 5 lines

-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: 2020年5月22日 15:53
To: [email protected]; Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>;

Clements,

Quoted 25 lines

John <[email protected]>; Li, Dennis <[email protected]>
Cc: Chen, Guchun <[email protected]>
Subject: [PATCH] drm/amdgpu: print warning when input address is invalid

This will assist debug.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0 -0
index 6e911ca97038..5c73f444eaef 100644
@@ -318,6 +318,8 @@ static ssize_t

amdgpu_ras_debugfs_ctrl_write(struct
file *f, const char __user *

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +1 -0
 	case 2:
 		if ((data.inject.address >= adev->gmc.mc_vram_size) ||
 		    (data.inject.address >= RAS_UMC_INJECT_ADDR_LIMIT)) {
+			dev_warn(adev->dev, "Input address 0x%llx is

invalid.",

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

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +1 -0
+					data.inject.address);
Quoted 14 lines

[Tao] How about this way:
dev_warn(adev->dev, "RAS injection address 0x%llx exceeds limit 0x%llx.",
data.inject.address,
RAS_UMC_INJECT_ADDR_LIMIT); [Guchun]There are two cases for invalid input address, one is limited by board vram size, and one is by RAS_UMC_INJECT_ADDR_LIMIT.
So it's not necessary to distinguish here, just print warning to let user knows the input address is not correct, and this error injection is blocked.

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0 -1
 			ret = -EINVAL;
 			break;
 		}
--

2.17.1

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