[AMD Official Use Only - AMD Internal Distribution Only] > -----Original Message----- > From: Xie, Patrick <[email protected]> > Sent: Tuesday, January 20, 2026 12:04 PM > To: [email protected] > Cc: Zhou1, Tao <[email protected]>; Xie, Patrick > <[email protected]> > Subject: [PATCH] drm/amdgpu: mark invalid records with U64_MAX > > set retired_page of invalid ras records to U64_MAX, and skip them when > reading ras records > > Signed-off-by: Gangliang Xie <[email protected]> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c > index 0c84c7ab36d1..13d901c0ed6e 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c > @@ -2784,6 +2784,9 @@ static int amdgpu_ras_badpages_read(struct > amdgpu_device *adev, > if (!data->bps[i].ts) > continue; > > + if (data->bps[i].retired_page == U64_MAX) > + continue;
[Tao] the change is fine with me, it's better to add comment to explain U64_MAX is used as invalid flag. With that fixed, the patch is: Reviewed-by: Tao Zhou <[email protected]> > + > bps[r].bp = data->bps[i].retired_page; > r++; > if (r >= count) > @@ -3090,6 +3093,7 @@ static int __amdgpu_ras_restore_bad_pages(struct > amdgpu_device *adev, > > if (amdgpu_ras_check_bad_page_unlock(con, > bps[j].retired_page << AMDGPU_GPU_PAGE_SHIFT)) { > + data->bps[data->count].retired_page = U64_MAX; > data->count++; > data->space_left--; > continue; > -- > 2.34.1
