Skip to content

Commit 0028b86

Browse files
Gangliang Xiealexdeucher
authored andcommitted
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 <ganglxie@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 9d03d40 commit 0028b86

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2784,6 +2784,10 @@ static int amdgpu_ras_badpages_read(struct amdgpu_device *adev,
27842784
if (!data->bps[i].ts)
27852785
continue;
27862786

2787+
/* U64_MAX is used to mark the record as invalid */
2788+
if (data->bps[i].retired_page == U64_MAX)
2789+
continue;
2790+
27872791
bps[r].bp = data->bps[i].retired_page;
27882792
r++;
27892793
if (r >= count)
@@ -3090,6 +3094,8 @@ static int __amdgpu_ras_restore_bad_pages(struct amdgpu_device *adev,
30903094

30913095
if (amdgpu_ras_check_bad_page_unlock(con,
30923096
bps[j].retired_page << AMDGPU_GPU_PAGE_SHIFT)) {
3097+
/* set to U64_MAX to mark it as invalid */
3098+
data->bps[data->count].retired_page = U64_MAX;
30933099
data->count++;
30943100
data->space_left--;
30953101
continue;

0 commit comments

Comments
 (0)