drm/amdgpu: only check critical address when it is not reserved
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +4 -2
@@ -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,
Signature · 1 line
2.34.1
[AMD Official Use Only - AMD Internal Distribution Only]
Reviewed-by Hawking Zhang <[email protected]>
Regards,
Hawking
-----Original Message-----
From: Xie, Patrick <[email protected]>
Sent: Monday, December 22, 2025 16:53
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Xie, Patrick <[email protected]>
Subject: [PATCH] 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 <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +4 -2
@@ -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,
--
2.34.1