]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu: mark invalid records with U64_MAX
authorGangliang Xie <ganglxie@amd.com>
Fri, 16 Jan 2026 03:32:08 +0000 (11:32 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 21 Jan 2026 19:25:43 +0000 (14:25 -0500)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

index c91529c778ba398541ede016574c2c418942ac9b..f582113d78b74c9e8773c25798f79a1ae7d98e70 100644 (file)
@@ -2784,6 +2784,10 @@ static int amdgpu_ras_badpages_read(struct amdgpu_device *adev,
                        if (!data->bps[i].ts)
                                continue;
 
+                       /* U64_MAX is used to mark the record as invalid */
+                       if (data->bps[i].retired_page == U64_MAX)
+                               continue;
+
                        bps[r].bp = data->bps[i].retired_page;
                        r++;
                        if (r >= count)
@@ -3090,6 +3094,8 @@ 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)) {
+                       /* set to U64_MAX to mark it as invalid */
+                       data->bps[data->count].retired_page = U64_MAX;
                        data->count++;
                        data->space_left--;
                        continue;