[PATCH] drm/amd/ras: wait for PMFW MCA polling in UniRAS recovery

Xiang Liu <[email protected]> Fri, 31 Jul 2026 13:44:28 +0800
Newsgroups org.freedesktop.lists.amd-gfx
Message-ID <[email protected]>
UniRAS fatal recovery reads MCA-derived ECC data through PMFW, but
direct query mode bypasses the existing firmware-query delay. The
recovery worker can therefore query before PMFW has finished polling
the MCA banks, causing the first fatal injection to miss its UE count
or time out.

Apply the same 500 ms settle delay whenever UniRAS is enabled before
harvesting ECC data.

Signed-off-by: Xiang Liu <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index d247d0ad063f..ad9a9545b1d6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -2755,7 +2755,10 @@ static void amdgpu_ras_do_recovery(struct work_struct *work)
 			device_list_handle = &device_list;
 		}
 
-		if (amdgpu_ras_get_error_query_mode(adev, &error_query_mode)) {
+		if (amdgpu_uniras_enabled(adev)) {
+			/* wait 500ms to ensure pmfw polling mca bank info done */
+			msleep(500);
+		} else if (amdgpu_ras_get_error_query_mode(adev, &error_query_mode)) {
 			if (error_query_mode == AMDGPU_RAS_FIRMWARE_ERROR_QUERY) {
 				/* wait 500ms to ensure pmfw polling mca bank info done */
 				msleep(500);
-- 
2.34.1