drm/amd/ras: wait for PMFW MCA polling in UniRAS recovery
Subsystems (2)
PATCH 1/1 drm/amd/ras: wait for PMFW MCA polling in UniRAS recovery
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.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +4 -1
@@ -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 );
Signature · 1 line
2.34.1
AMD General
If this delay is only intended for fatal recovery, should it also be conditioned on gpu_reset_flags & AMDGPU_RAS_GPU_RESET_MODE1_RESET? An unconditional msleep here would unnecessarily impact other reset paths (e.g., mode2 reset).
Best Regards,
Thomas
-----Original Message-----
From: Liu, Xiang(Dean) <[email protected]>
Sent: Friday, July 31, 2026 1:44 PM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>; Chai, Thomas <[email protected]>; Liu, Xiang(Dean) <[email protected]>
Subject: [PATCH] drm/amd/ras: wait for PMFW MCA polling in UniRAS recovery
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.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +5 -1
@@ -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
AMD General
Sure, will improve it, thanks.
Best Regards,
Liu, Xiang
________________________________
From: Chai, Thomas <[email protected]>
Sent: Friday, July 31, 2026 3:12 PM
To: Liu, Xiang(Dean) <[email protected]>; [email protected] <[email protected]>
Cc: Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>
Subject: RE: [PATCH] drm/amd/ras: wait for PMFW MCA polling in UniRAS recovery
AMD General
If this delay is only intended for fatal recovery, should it also be conditioned on gpu_reset_flags & AMDGPU_RAS_GPU_RESET_MODE1_RESET? An unconditional msleep here would unnecessarily impact other reset paths (e.g., mode2 reset).
Best Regards,
Thomas
-----Original Message-----
From: Liu, Xiang(Dean) <[email protected]>
Sent: Friday, July 31, 2026 1:44 PM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>; Chai, Thomas <[email protected]>; Liu, Xiang(Dean) <[email protected]>
Subject: [PATCH] drm/amd/ras: wait for PMFW MCA polling in UniRAS recovery
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.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +5 -1
@@ -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