]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu: only check critical address when it is not reserved
authorGangliang Xie <ganglxie@amd.com>
Mon, 22 Dec 2025 08:48:22 +0000 (16:48 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 5 Jan 2026 22:00:00 +0000 (17:00 -0500)
when an address is reserved already, no need to check if it is
in critical or not, to save time

Signed-off-by: Gangliang Xie <ganglxie@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

index 3d6295cd848ec40d5e09c9fc68350317ebe32a8d..c91529c778ba398541ede016574c2c418942ac9b 100644 (file)
@@ -1922,8 +1922,6 @@ static ssize_t amdgpu_ras_sysfs_badpages_read(struct file *f,
 
        for (i = 0; i < bps_count; i++) {
                address = ((uint64_t)bps[i].bp) << AMDGPU_GPU_PAGE_SHIFT;
-               if (amdgpu_ras_check_critical_address(adev, address))
-                       continue;
 
                bps[i].size = AMDGPU_GPU_PAGE_SIZE;
 
@@ -1936,6 +1934,10 @@ static ssize_t amdgpu_ras_sysfs_badpages_read(struct file *f,
                else
                        bps[i].flags = AMDGPU_RAS_RETIRE_PAGE_RESERVED;
 
+               if ((bps[i].flags != AMDGPU_RAS_RETIRE_PAGE_RESERVED) &&
+                   amdgpu_ras_check_critical_address(adev, address))
+                       bps[i].flags = AMDGPU_RAS_RETIRE_PAGE_RESERVED;
+
                s += scnprintf(&buf[s], element_size + 1,
                                "0x%08x : 0x%08x : %1s\n",
                                bps[i].bp,