AMD General
Hi, Tao:
'Count=0' and 'Count < 0' both mean there are something wrong with bad
page lookup, so they are both treated as error.
-----Original Message-----
From: Zhou1, Tao <[email protected]>
Sent: Monday, May 18, 2026 7:52 PM
To: Xie, Patrick <[email protected]>; [email protected]
Cc: Chai, Thomas <[email protected]>
Subject: RE: [PATCH 3/3] drm/amd/ras: return error when converting records to
nps pages fails
AMD General
> -----Original Message-----
> From: Xie, Patrick <[email protected]>
> Sent: Monday, May 18, 2026 2:41 PM
> To: [email protected]
> Cc: Zhou1, Tao <[email protected]>; Chai, Thomas
> <[email protected]>; Xie, Patrick <[email protected]>
> Subject: [PATCH 3/3] drm/amd/ras: return error when converting records
> to nps pages fails
>
> return error when converting records to nps pages fails
>
> Signed-off-by: Gangliang Xie <[email protected]>
> ---
> drivers/gpu/drm/amd/ras/rascore/ras_umc.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/ras/rascore/ras_umc.c
> b/drivers/gpu/drm/amd/ras/rascore/ras_umc.c
> index d4072350f48f..78db402182f7 100644
> --- a/drivers/gpu/drm/amd/ras/rascore/ras_umc.c
> +++ b/drivers/gpu/drm/amd/ras/rascore/ras_umc.c
> @@ -391,9 +391,8 @@ static int ras_umc_update_eeprom_ram_data(struct
> ras_core_context *ras_core,
> data->space_left--;
> }
> } else {
> - memcpy(&data->bps[data->count], bps, sizeof(*data->bps));
> - data->count++;
> - data->space_left--;
> + RAS_DEV_ERR(ras_core->dev, "Failed to convert record to
> + nps
> pages!");
> + return -EINVAL;
[Tao] are your sure the error is also fit for the condition of count == 0?
> }
>
> return 0;
> --
> 2.34.1