summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGangliang Xie <ganglxie@amd.com>2025-12-22 16:48:22 +0800
committerAlex Deucher <alexander.deucher@amd.com>2026-01-05 17:00:00 -0500
commitf9f281e839b7518109a4b7efa8dbee425bd8bfad (patch)
tree1c072b1be621ea8a429a18960031286d43a82f14 /drivers
parenta6ea0a430aca5932b9c75d8e38deeb45665dd2ae (diff)
drm/amdgpu: only check critical address when it is not reserved
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 3d6295cd848e..c91529c778ba 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -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,