[PATCH Review 2/2] drm/amdgpu: Add checking mc_vram_size
Zhou1, Tao
Tao.Zhou1 at amd.com
Tue Jun 13 07:08:59 UTC 2023
[AMD Official Use Only - General]
With my concerns fixed, the series is:
Reviewed-by: Tao Zhou <tao.zhou1 at amd.com>
> -----Original Message-----
> From: Stanley.Yang <Stanley.Yang at amd.com>
> Sent: Tuesday, June 13, 2023 11:53 AM
> To: amd-gfx at lists.freedesktop.org; Zhang, Hawking <Hawking.Zhang at amd.com>;
> Zhou1, Tao <Tao.Zhou1 at amd.com>
> Cc: Yang, Stanley <Stanley.Yang at amd.com>
> Subject: [PATCH Review 2/2] drm/amdgpu: Add checking mc_vram_size
>
> Do not compare injection address with mc_vram_size if mc_vram_size is zero.
>
> Signed-off-by: Stanley.Yang <Stanley.Yang at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index 56bb0db207b9..3c041efcf0c4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -494,7 +494,8 @@ static ssize_t amdgpu_ras_debugfs_ctrl_write(struct file
> *f,
> ret = amdgpu_ras_feature_enable(adev, &data.head, 1);
> break;
> case 2:
> - if ((data.inject.address >= adev->gmc.mc_vram_size) ||
> + if ((data.inject.address >= adev->gmc.mc_vram_size &&
> + 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.",
> --
> 2.17.1
More information about the amd-gfx
mailing list