AMD General

BM reads the RAS error count for each block via sysfs/debugfs nodes, which 
ultimately calls amdgpu_uniras_query_block_ecc. Therefore, adding an SR-IOV 
check inside amdgpu_uniras_query_block_ecc() might not be appropriate.

Furthermore, amdgpu_persistent_edc_harvesting() is invoked between 
lock_reset_domain and unlock_reset_domain during GPU reset. While this might be 
safe for ASICs where the driver directly reads registers to query the RAS error 
count, it could introduce issues for ASICs that retrieve the count via SMU. If 
we keep this function call here, we may need to skip the RAS error info 
querying operation for those SMU-based ASIC types when harvesting supported.


_____________________________________________
From: Zhang, Hawking <[email protected]>
Sent: Friday, November 13, 2026 11:46 PM
To: Sun, Ce(Overlord) <[email protected]>; [email protected]; Sun, 
Ce(Overlord) <[email protected]>
Cc: Zhou1, Tao <[email protected]>; Chai, Thomas <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: skip uniras block ECC query in GPU reset path


AMD General



Hi @Sun, Ce(Overlord)<mailto:[email protected]>

I'm concerned about the current amdgpu_uniras_query_block_ecc implementation. 
RAS_CMD__GET_BLOCK_ECC_STATUS is an SR-IOV VF-specific RAS command and should 
not be invoked in the current UniRAS code path. Using it in a bare-metal 
environment would trigger an unsupported RAS command error and could cause GPU 
reset to fail.

Could we evaluate updating amdgpu_persistent_edc_harvesting_supported to 
prevent inappropriate calls to amdgpu_uniras_query_block_ecc? We should also 
consider adding an explicit check to ensure that amdgpu_uniras_query_block_ecc 
is called only for SR-IOV VFs, or retiring the function if it is no longer 
needed.

Regards,
Hawking

-----Original Message-----
From: amd-gfx 
<[email protected]<mailto:[email protected]>>
 On Behalf Of Ce Sun
Sent: Friday, November 13, 2026 11:28 AM
To: [email protected]<mailto:[email protected]>
Cc: Zhang, Hawking <[email protected]<mailto:[email protected]>>; 
Zhou1, Tao <[email protected]<mailto:[email protected]>>; Sun, Ce(Overlord) 
<[email protected]<mailto:[email protected]>>; Chai, Thomas 
<[email protected]<mailto:[email protected]>>
Subject: [PATCH] drm/amdgpu: skip uniras block ECC query in GPU reset path

amdgpu_uniras_query_block_ecc doesn't support being called during GPU reset.

Signed-off-by: Ce Sun <[email protected]<mailto:[email protected]>>
Signed-off-by: YiPeng Chai <[email protected]<mailto:[email protected]>>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 08c6e55a7927..7be33d5559ab 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -3770,6 +3770,10 @@ static int amdgpu_persistent_edc_harvesting(struct 
amdgpu_device *adev,
        if (!amdgpu_persistent_edc_harvesting_supported(adev))
                return 0;

+       if ((amdgpu_in_reset(adev) || amdgpu_ras_in_recovery(adev)) &&
+            amdgpu_uniras_enabled(adev))
+               return 0;
+
        if (amdgpu_ras_query_error_status(adev, &info) != 0)
                drm_warn(adev_to_drm(adev), "RAS init query failure");

--
2.34.1

Reply via email to