From: Gangliang Xie Date: Mon, 22 Dec 2025 08:48:22 +0000 (+0800) Subject: drm/amdgpu: only check critical address when it is not reserved X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9f281e839b7518109a4b7efa8dbee425bd8bfad;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher --- 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,