drm/amdgpu: Fix address translation defect
authorYiPeng Chai <YiPeng.Chai@amd.com>
Wed, 3 Apr 2024 06:11:41 +0000 (14:11 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 26 Apr 2024 21:22:42 +0000 (17:22 -0400)
retired_page is page frame and should be expanded
to the full address when querying status.

Signed-off-by: YiPeng Chai <YiPeng.Chai@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 2b6018e7b696c0531c2d2405cf12d4494537dde0..0e6a18ec48bd0eb3d4832edf0c049891e1e63db7 100644 (file)
@@ -2399,7 +2399,7 @@ static int amdgpu_ras_badpages_read(struct amdgpu_device *adev,
                        .flags = AMDGPU_RAS_RETIRE_PAGE_RESERVED,
                };
                status = amdgpu_vram_mgr_query_page_status(&adev->mman.vram_mgr,
-                               data->bps[i].retired_page);
+                               data->bps[i].retired_page << AMDGPU_GPU_PAGE_SHIFT);
                if (status == -EBUSY)
                        (*bps)[i].flags = AMDGPU_RAS_RETIRE_PAGE_PENDING;
                else if (status == -ENOENT)