drm/amd/ras: reprogram MCA settings after reset
Subsystems (3)
PATCH 1/3 drm/amd/ras: reprogram MCA settings after reset
When the driver is loaded on a device that still needs a hive reset, the RAS IP hw_init is deferred to amdgpu_ras_mgr_resume_after_reset(). The MCA configuration is sent to PMFW from amdgpu_ras_late_init(), which runs during the reset while RAS is not ready yet, so the request is dropped and CE polling stays disabled. Correctable errors are then never harvested and only show up on the next driver load.
Re-apply the current debug mode once hw_init has completed.
--- drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c +7 -1
@@ -483,6 +483,7 @@ int amdgpu_ras_mgr_resume_after_reset(struct amdgpu_device *adev)struct amdgpu_ras *con =amdgpu_ras_get_context (adev);struct amdgpu_ras_mgr *ras_mgr =amdgpu_ras_mgr_get_context (adev);struct amdgpu_ip_block *ip_block; +int ret;if (!con || !con->uniras_enabled)return 0 ;
@@ -497,7 +498,12 @@ int amdgpu_ras_mgr_resume_after_reset(struct amdgpu_device *adev)if (!ip_block)return -EINVAL ; -return amdgpu_ras_mgr_hw_init (ip_block); + ret =amdgpu_ras_mgr_hw_init (ip_block); +if (ret) +return ret; + +/* amdgpu_ras_late_init() runs before RAS is ready on this path */ +return amdgpu_ras_mgr_set_debug_mode (adev, ras_mgr->is_debug_mode); }struct amdgpu_ras_mgr *amdgpu_ras_mgr_get_context (struct amdgpu_device *adev)
Signature · 1 line
2.34.1
PATCH 2/3 drm/amdkfd: balance KFD suspend reference on partition switch
A compute partition switch tears down the KFD device through amdgpu_amdkfd_device_fini_sw() without suspending KFD first, while kgd2kfd_device_exit() drops a suspend reference. Every switch leaves kfd_locked one below zero, so on a hive the counter ends up deeply negative.
kfd_locked gates the eviction sweep on "++kfd_locked == 1". While it is negative a GPU reset never evicts user processes, nothing restores them afterwards, and page tables torn down with VRAM are never rebuilt, so the first queue mapped after the reset takes a VM fault.
Take the reference in amdgpu_xcp_pre_partition_switch() so it pairs with the one kgd2kfd_device_exit() drops, and only drop it for a device that finished initialisation, matching the early return in kgd2kfd_suspend().
--- drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c | 5 ++++- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c +4 -1
@@ -698,8 +698,11 @@ int amdgpu_xcp_pre_partition_switch(struct amdgpu_xcp_mgr *xcp_mgr, u32 flags)* Stop user queues and threads, and make sure GPU is empty of work. */ -if (flags &AMDGPU_XCP_OPS_KFD ) +/* kgd2kfd_device_exit() drops the suspend reference taken here */ +if (flags &AMDGPU_XCP_OPS_KFD ) { +amdgpu_amdkfd_suspend (xcp_mgr->adev, true);amdgpu_amdkfd_device_fini_sw (xcp_mgr->adev); + }return 0 ; }
drivers/gpu/drm/amd/amdkfd/kfd_device.c +3 -3
@@ -1014,12 +1014,12 @@ void kgd2kfd_device_exit(struct kfd_dev *kfd)kfd_gtt_sa_fini (kfd);amdgpu_amdkfd_free_kernel_mem (kfd->adev, &kfd->gtt_mem);mutex_destroy (&kfd->profiler_lock); + +/* pairs with the reference taken in kgd2kfd_suspend() */ +kgd2kfd_unlock_kfd (NULL ); }kfree (kfd); - -/* after remove a kfd device unlock kfd driver */ -kgd2kfd_unlock_kfd (NULL ); } int kgd2kfd_pre_reset(struct kfd_dev *kfd,
Signature · 1 line
2.34.1
Re: [PATCH 2/3] drm/amdkfd: balance KFD suspend reference on partition switch
Quoted 26 lines · Xiang Liu
A compute partition switch tears down the KFD device through
amdgpu_amdkfd_device_fini_sw()without suspending KFD first, whilekgd2kfd_device_exit()drops a suspend reference. Every switch leaveskfd_lockedone below zero, so on a hive the counter ends up deeply negative.
kfd_lockedgates the eviction sweep on "++kfd_locked == 1". While it is negative a GPU reset never evicts user processes, nothing restores them afterwards, and page tables torn down with VRAM are never rebuilt, so the first queue mapped after the reset takes a VM fault.Take the reference in
amdgpu_xcp_pre_partition_switch()so it pairs with the onekgd2kfd_device_exit()drops, and only drop it for a device that finished initialisation, matching the early return inkgd2kfd_suspend().Signed-off-by Xiang Liu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c | 5 ++++- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c int amdgpu_xcp_pre_partition_switch(struct amdgpu_xcp_mgr *xcp_mgr, u32 flags) · line 703
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c +3
-1@@ -698,8 +698,11 @@ int amdgpu_xcp_pre_partition_switch(struct amdgpu_xcp_mgr *xcp_mgr, u32 flags)* Stop user queues and threads, and make sure GPU is empty of work. */ -if (flags &AMDGPU_XCP_OPS_KFD ) +/* kgd2kfd_device_exit() drops the suspend reference taken here */ +if (flags &AMDGPU_XCP_OPS_KFD ) { +amdgpu_amdkfd_suspend (xcp_mgr->adev, true);
Partition switch doesn't force a suspend. It's a prerequisite that user has to exit all KFD processes before doing the switch. So before partition switch amdgpu_amdkfd_check_and_lock_kfd is called to ensure that no processes are running on the device.
If there is an imbalance in lock count, it may need a different way to solve it.
Thanks,
Lijo
Quoted 25 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c +1
-0amdgpu_amdkfd_device_fini_sw (xcp_mgr->adev); + }return 0 ; }drivers/gpu/drm/amd/amdkfd/kfd_device.c +3
-3@@ -1014,12 +1014,12 @@ void kgd2kfd_device_exit(struct kfd_dev *kfd)kfd_gtt_sa_fini (kfd);amdgpu_amdkfd_free_kernel_mem (kfd->adev, &kfd->gtt_mem);mutex_destroy (&kfd->profiler_lock); + +/* pairs with the reference taken in kgd2kfd_suspend() */ +kgd2kfd_unlock_kfd (NULL ); }kfree (kfd); - -/* after remove a kfd device unlock kfd driver */ -kgd2kfd_unlock_kfd (NULL ); } int kgd2kfd_pre_reset(struct kfd_dev *kfd,
PATCH 3/3 drm/amdkfd: skip queue restore while the device is resetting
In reply to Xiang Liurestore_process_queues_cpsch() decrements qpd->evicted to zero and maps the queues back, but a reset in flight is about to drop the mappings those queues are built against. The restore then publishes queues that point at state the reset discards.
Bail out with -EAGAIN while the device is fenced or resetting, leaving the eviction reference held so the restore is retried once the device is back.
--- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +7 -0
@@ -1636,6 +1636,13 @@ static int restore_process_queues_cpsch(struct device_queue_manager *dqm, goto out; } +/* A restore now would map queues against mappings the reset will drop */ +if (amdgpu_amdkfd_is_fed (dqm->dev->adev) || +amdgpu_in_reset (dqm->dev->adev)) { + retval = -EAGAIN ; + goto out; + } +/* The debugger creates processes that temporarily have not acquired * all VMs for all devices and has no VMs itself. * Skip queue restore on process restore.
Signature · 1 line
2.34.1
AMD General
+ @Sun, Ce(Overlord)<mailto:[email protected]> for the discussion.
Hey Guys,
We may need a cleaner and more consistent initialization sequence that covers normal driver initialization/modprobe, regular GPU reset and recovery, and XGMI reset and recovery.
Could you please evaluate the following changes?
1. Move the call to amdgpu_ras_mgr_set_debug_mode into amdgpu_ras_mgr_hw_init, placing it as the final initialization step before the marks uniras as enabled.
2. Remove the corresponding amdgpu_ras_mgr_set_debug_mode call and the uniras enable check from amdgpu_ras_late_init.
Regards,
Hawking
-----Original Message-----
From: Liu, Xiang(Dean) <[email protected]>
Sent: Saturday, September 5, 2026 12:30 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 1/3] drm/amd/ras: reprogram MCA settings after reset
When the driver is loaded on a device that still needs a hive reset, the RAS IP hw_init is deferred to amdgpu_ras_mgr_resume_after_reset().
The MCA configuration is sent to PMFW from amdgpu_ras_late_init(), which runs during the reset while RAS is not ready yet, so the request is dropped and CE polling stays disabled. Correctable errors are then never harvested and only show up on the next driver load.
Re-apply the current debug mode once hw_init has completed.
--- drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c +7 -1
@@ -483,6 +483,7 @@ int amdgpu_ras_mgr_resume_after_reset(struct amdgpu_device *adev)struct amdgpu_ras *con =amdgpu_ras_get_context (adev);struct amdgpu_ras_mgr *ras_mgr =amdgpu_ras_mgr_get_context (adev);struct amdgpu_ip_block *ip_block; +int ret;if (!con || !con->uniras_enabled)return 0 ;
@@ -497,7 +498,12 @@ int amdgpu_ras_mgr_resume_after_reset(struct amdgpu_device *adev)if (!ip_block)return -EINVAL ; -return amdgpu_ras_mgr_hw_init (ip_block); + ret =amdgpu_ras_mgr_hw_init (ip_block); +if (ret) +return ret; + +/* amdgpu_ras_late_init() runs before RAS is ready on this path */ +return amdgpu_ras_mgr_set_debug_mode (adev, ras_mgr->is_debug_mode); }struct amdgpu_ras_mgr *amdgpu_ras_mgr_get_context (struct amdgpu_device *adev)
--
2.34.1
AMD General
Hi Hawking,
Thanks for proposing this cleaner initialization sequence.
One corner case concern: after we remove amdgpu_ras_mgr_set_debug_mode from amdgpu_ras_late_init, when we perform UE error injection, set_debug_mode will not get re‑applied. This may cause failures on subsequent CE error injection operations. Do you think we need to handle this scenario additionally?
Regards,
Sun Ce
________________________________
From: Zhang, Hawking <[email protected]>
Sent: Saturday, September 5, 2026 4:23 PM
To: Liu, Xiang(Dean) <[email protected]>; [email protected] <[email protected]>; Sun, Ce(Overlord) <[email protected]>
Cc: Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>; Chai, Thomas <[email protected]>
Subject: RE: [PATCH 1/3] drm/amd/ras: reprogram MCA settings after reset
AMD General
+ @Sun, Ce(Overlord)<mailto:[email protected]> for the discussion.
Hey Guys,
We may need a cleaner and more consistent initialization sequence that covers normal driver initialization/modprobe, regular GPU reset and recovery, and XGMI reset and recovery.
Could you please evaluate the following changes?
1. Move the call to amdgpu_ras_mgr_set_debug_mode into amdgpu_ras_mgr_hw_init, placing it as the final initialization step before the marks uniras as enabled.
2. Remove the corresponding amdgpu_ras_mgr_set_debug_mode call and the uniras enable check from amdgpu_ras_late_init.
Regards,
Hawking
-----Original Message-----
From: Liu, Xiang(Dean) <[email protected]>
Sent: Saturday, September 5, 2026 12:30 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 1/3] drm/amd/ras: reprogram MCA settings after reset
When the driver is loaded on a device that still needs a hive reset, the RAS IP hw_init is deferred to amdgpu_ras_mgr_resume_after_reset().
The MCA configuration is sent to PMFW from amdgpu_ras_late_init(), which runs during the reset while RAS is not ready yet, so the request is dropped and CE polling stays disabled. Correctable errors are then never harvested and only show up on the next driver load.
Re-apply the current debug mode once hw_init has completed.
---drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c +7 -1
@@ -483,6 +483,7 @@ int amdgpu_ras_mgr_resume_after_reset(struct amdgpu_device *adev)struct amdgpu_ras *con =amdgpu_ras_get_context (adev);struct amdgpu_ras_mgr *ras_mgr =amdgpu_ras_mgr_get_context (adev);struct amdgpu_ip_block *ip_block; +int ret;if (!con || !con->uniras_enabled)return 0 ;
@@ -497,7 +498,12 @@ int amdgpu_ras_mgr_resume_after_reset(struct amdgpu_device *adev)if (!ip_block)return -EINVAL ; -return amdgpu_ras_mgr_hw_init (ip_block); + ret =amdgpu_ras_mgr_hw_init (ip_block); +if (ret) +return ret; + +/* amdgpu_ras_late_init() runs before RAS is ready on this path */ +return amdgpu_ras_mgr_set_debug_mode (adev, ras_mgr->is_debug_mode);
}
struct amdgpu_ras_mgr *amdgpu_ras_mgr_get_context(struct amdgpu_device *adev) --
2.34.1
AMD General
Hi Hawking, Ce,
Both changes look good to me. I think we need one more call to cover the normal GPU reset though.
amdgpu_ip_block_resume() calls .resume and never falls back to .hw_init, and the RAS block registers both:
.hw_init = amdgpu_ras_mgr_hw_init,
.resume = amdgpu_ras_mgr_resume,
hw_init does not run on an ordinary reset. ras_is_ready also stays true across it - it is cleared only in hw_fini, which the reset path does not call, and .suspend is a no-op - so resume_after_reset() returns early as well. Once the call is gone from late_init, nothing reprograms MCA on that path.
So on top of 1 and 2, adding it to amdgpu_ras_mgr_resume() after the !ras_is_ready guard.
That also answers Ce: the UE injection reset comes back through .resume, so the mode is reprogrammed before the next CE injection.
Best Regards,
Liu, Xiang
________________________________
From: Sun, Ce(Overlord) <[email protected]>
Sent: Sunday, September 6, 2026 3:55 PM
To: Zhang, Hawking <[email protected]>; Liu, Xiang(Dean) <[email protected]>; [email protected] <[email protected]>
Cc: Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>; Chai, Thomas <[email protected]>
Subject: Re: [PATCH 1/3] drm/amd/ras: reprogram MCA settings after reset
AMD General
Hi Hawking,
Thanks for proposing this cleaner initialization sequence.
One corner case concern: after we remove amdgpu_ras_mgr_set_debug_mode from amdgpu_ras_late_init, when we perform UE error injection, set_debug_mode will not get re‑applied. This may cause failures on subsequent CE error injection operations. Do you think we need to handle this scenario additionally?
Regards,
Sun Ce
________________________________
From: Zhang, Hawking <[email protected]>
Sent: Saturday, September 5, 2026 4:23 PM
To: Liu, Xiang(Dean) <[email protected]>; [email protected] <[email protected]>; Sun, Ce(Overlord) <[email protected]>
Cc: Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>; Chai, Thomas <[email protected]>
Subject: RE: [PATCH 1/3] drm/amd/ras: reprogram MCA settings after reset
AMD General
+ @Sun, Ce(Overlord)<mailto:[email protected]> for the discussion.
Hey Guys,
We may need a cleaner and more consistent initialization sequence that covers normal driver initialization/modprobe, regular GPU reset and recovery, and XGMI reset and recovery.
Could you please evaluate the following changes?
1. Move the call to amdgpu_ras_mgr_set_debug_mode into amdgpu_ras_mgr_hw_init, placing it as the final initialization step before the marks uniras as enabled.
2. Remove the corresponding amdgpu_ras_mgr_set_debug_mode call and the uniras enable check from amdgpu_ras_late_init.
Regards,
Hawking
-----Original Message-----
From: Liu, Xiang(Dean) <[email protected]>
Sent: Saturday, September 5, 2026 12:30 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 1/3] drm/amd/ras: reprogram MCA settings after reset
When the driver is loaded on a device that still needs a hive reset, the RAS IP hw_init is deferred to amdgpu_ras_mgr_resume_after_reset().
The MCA configuration is sent to PMFW from amdgpu_ras_late_init(), which runs during the reset while RAS is not ready yet, so the request is dropped and CE polling stays disabled. Correctable errors are then never harvested and only show up on the next driver load.
Re-apply the current debug mode once hw_init has completed.
---drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c +7 -1
@@ -483,6 +483,7 @@ int amdgpu_ras_mgr_resume_after_reset(struct amdgpu_device *adev)struct amdgpu_ras *con =amdgpu_ras_get_context (adev);struct amdgpu_ras_mgr *ras_mgr =amdgpu_ras_mgr_get_context (adev);struct amdgpu_ip_block *ip_block; +int ret;if (!con || !con->uniras_enabled)return 0 ;
@@ -497,7 +498,12 @@ int amdgpu_ras_mgr_resume_after_reset(struct amdgpu_device *adev)if (!ip_block)return -EINVAL ; -return amdgpu_ras_mgr_hw_init (ip_block); + ret =amdgpu_ras_mgr_hw_init (ip_block); +if (ret) +return ret; + +/* amdgpu_ras_late_init() runs before RAS is ready on this path */ +return amdgpu_ras_mgr_set_debug_mode (adev, ras_mgr->is_debug_mode);
}
struct amdgpu_ras_mgr *amdgpu_ras_mgr_get_context(struct amdgpu_device *adev) --
2.34.1
AMD General
Hi Xiang, Ce:
After gpu reset, the amdgpu_ras_mgr_post_reset also will be called, if calling amdgpu_ras_mgr_set_debug_mode in this function, can it cover all requirements?
Best Regards,
Thomas
From: Liu, Xiang(Dean) <[email protected]>
Sent: Sunday, September 6, 2026 5:10 PM
To: Sun, Ce(Overlord) <[email protected]>; Zhang, Hawking <[email protected]>; [email protected]
Cc: Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>; Chai, Thomas <[email protected]>
Subject: Re: [PATCH 1/3] drm/amd/ras: reprogram MCA settings after reset
AMD General
Hi Hawking, Ce,
Both changes look good to me. I think we need one more call to cover the normal GPU reset though.
amdgpu_ip_block_resume() calls .resume and never falls back to .hw_init, and the RAS block registers both:
.hw_init = amdgpu_ras_mgr_hw_init,
.resume = amdgpu_ras_mgr_resume,
hw_init does not run on an ordinary reset. ras_is_ready also stays true across it - it is cleared only in hw_fini, which the reset path does not call, and .suspend is a no-op - so resume_after_reset() returns early as well. Once the call is gone from late_init, nothing reprograms MCA on that path.
So on top of 1 and 2, adding it to amdgpu_ras_mgr_resume() after the !ras_is_ready guard.
That also answers Ce: the UE injection reset comes back through .resume, so the mode is reprogrammed before the next CE injection.
Best Regards,
Liu, Xiang
________________________________
From: Sun, Ce(Overlord) <[email protected]<mailto:[email protected]>>
Sent: Sunday, September 6, 2026 3:55 PM
To: Zhang, Hawking <[email protected]<mailto:[email protected]>>; Liu, Xiang(Dean) <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>
Cc: Zhou1, Tao <[email protected]<mailto:[email protected]>>; Yang, Stanley <[email protected]<mailto:[email protected]>>; Chai, Thomas <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH 1/3] drm/amd/ras: reprogram MCA settings after reset
AMD General
Hi Hawking,
Thanks for proposing this cleaner initialization sequence.
One corner case concern: after we remove amdgpu_ras_mgr_set_debug_mode from amdgpu_ras_late_init, when we perform UE error injection, set_debug_mode will not get re‑applied. This may cause failures on subsequent CE error injection operations. Do you think we need to handle this scenario additionally?
Regards,
Sun Ce
________________________________
From: Zhang, Hawking <[email protected]<mailto:[email protected]>>
Sent: Saturday, September 5, 2026 4:23 PM
To: Liu, Xiang(Dean) <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>; Sun, Ce(Overlord) <[email protected]<mailto:[email protected]>>
Cc: Zhou1, Tao <[email protected]<mailto:[email protected]>>; Yang, Stanley <[email protected]<mailto:[email protected]>>; Chai, Thomas <[email protected]<mailto:[email protected]>>
Subject: RE: [PATCH 1/3] drm/amd/ras: reprogram MCA settings after reset
AMD General
+ @Sun, Ce(Overlord)<mailto:[email protected]> for the discussion.
Hey Guys,
We may need a cleaner and more consistent initialization sequence that covers normal driver initialization/modprobe, regular GPU reset and recovery, and XGMI reset and recovery.
Could you please evaluate the following changes?
1. Move the call to amdgpu_ras_mgr_set_debug_mode into amdgpu_ras_mgr_hw_init, placing it as the final initialization step before the marks uniras as enabled.
2. Remove the corresponding amdgpu_ras_mgr_set_debug_mode call and the uniras enable check from amdgpu_ras_late_init.
Regards,
Hawking
-----Original Message-----
From: Liu, Xiang(Dean) <[email protected]<mailto:[email protected]>>
Sent: Saturday, September 5, 2026 12:30 PM
To: [email protected]<mailto:[email protected]>
Cc: Zhang, Hawking <[email protected]<mailto:[email protected]>>; Zhou1, Tao <[email protected]<mailto:[email protected]>>; Yang, Stanley <[email protected]<mailto:[email protected]>>; Chai, Thomas <[email protected]<mailto:[email protected]>>; Liu, Xiang(Dean) <[email protected]<mailto:[email protected]>>
Subject: [PATCH 1/3] drm/amd/ras: reprogram MCA settings after reset
When the driver is loaded on a device that still needs a hive reset, the RAS IP hw_init is deferred to amdgpu_ras_mgr_resume_after_reset().
The MCA configuration is sent to PMFW from amdgpu_ras_late_init(), which runs during the reset while RAS is not ready yet, so the request is dropped and CE polling stays disabled. Correctable errors are then never harvested and only show up on the next driver load.
Re-apply the current debug mode once hw_init has completed.
---drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c +7 -1
@@ -483,6 +483,7 @@ int amdgpu_ras_mgr_resume_after_reset(struct amdgpu_device *adev)struct amdgpu_ras *con =amdgpu_ras_get_context (adev);struct amdgpu_ras_mgr *ras_mgr =amdgpu_ras_mgr_get_context (adev);struct amdgpu_ip_block *ip_block; +int ret;if (!con || !con->uniras_enabled)return 0 ;
@@ -497,7 +498,12 @@ int amdgpu_ras_mgr_resume_after_reset(struct amdgpu_device *adev)if (!ip_block)return -EINVAL ; -return amdgpu_ras_mgr_hw_init (ip_block); + ret =amdgpu_ras_mgr_hw_init (ip_block); +if (ret) +return ret; + +/* amdgpu_ras_late_init() runs before RAS is ready on this path */ +return amdgpu_ras_mgr_set_debug_mode (adev, ras_mgr->is_debug_mode);
}
struct amdgpu_ras_mgr *amdgpu_ras_mgr_get_context(struct amdgpu_device *adev) --
2.34.1