drm/amdgpu: correct single device PCIe reset flow for DPC status
Subsystems (2)
PATCH 1/1 drm/amdgpu: correct single device PCIe reset flow for DPC status
For triggering the dpc event with a single device, we still need to set the in_link_reset flag and the dpc status.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +7 -1
@@ -6291,6 +6291,9 @@ pci_ers_result_t amdgpu_pci_error_detected(struct pci_dev *pdev, pci_channel_staamdgpu_reset_set_dpc_status (adev, true);mutex_lock (&hive->hive_lock); + }else { +if (amdgpu_device_bus_status_check (adev)) +amdgpu_reset_set_dpc_status (adev, true); }memset (&reset_context,0 ,sizeof (reset_context));INIT_LIST_HEAD (&device_list);
@@ -6411,6 +6414,7 @@ pci_ers_result_t amdgpu_pci_slot_reset(struct pci_dev *pdev)list_for_each_entry (tmp_adev, &hive->device_list, gmc.xgmi.head) tmp_adev->pcie_reset_ctx.in_link_reset = true; }else { + adev->pcie_reset_ctx.in_link_reset = true;set_bit (AMDGPU_SKIP_HW_RESET , &reset_context.flags); }
@@ -6467,8 +6471,10 @@ void amdgpu_pci_resume(struct pci_dev *pdev) tmp_adev->pcie_reset_ctx.in_link_reset = false;list_add_tail (&tmp_adev->reset_list, &device_list); } - }else + }else { + adev->pcie_reset_ctx.in_link_reset = false;list_add_tail (&adev->reset_list, &device_list); + }amdgpu_device_sched_resume (&device_list,NULL ,NULL );amdgpu_device_gpu_resume (adev, &device_list, false);
Signature · 1 line
2.34.1
[AMD Official Use Only - AMD Internal Distribution Only]
ping
________________________________
From: Sun, Ce(Overlord) <[email protected]>
Sent: Wednesday, April 8, 2026 1:41 PM
To: [email protected] <[email protected]>
Cc: Zhang, Hawking <[email protected]>; Sun, Ce(Overlord) <[email protected]>
Subject: [PATCH] drm/amdgpu: correct single device PCIe reset flow for DPC status
For triggering the dpc event with a single device, we still need to set the in_link_reset flag and the dpc status.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +7 -1
@@ -6291,6 +6291,9 @@ pci_ers_result_t amdgpu_pci_error_detected(struct pci_dev *pdev, pci_channel_staamdgpu_reset_set_dpc_status (adev, true);mutex_lock (&hive->hive_lock); + }else { +if (amdgpu_device_bus_status_check (adev)) +amdgpu_reset_set_dpc_status (adev, true); }memset (&reset_context,0 ,sizeof (reset_context));INIT_LIST_HEAD (&device_list);
@@ -6411,6 +6414,7 @@ pci_ers_result_t amdgpu_pci_slot_reset(struct pci_dev *pdev)list_for_each_entry (tmp_adev, &hive->device_list, gmc.xgmi.head) tmp_adev->pcie_reset_ctx.in_link_reset = true; }else { + adev->pcie_reset_ctx.in_link_reset = true;set_bit (AMDGPU_SKIP_HW_RESET , &reset_context.flags); }
@@ -6467,8 +6471,10 @@ void amdgpu_pci_resume(struct pci_dev *pdev) tmp_adev->pcie_reset_ctx.in_link_reset = false;list_add_tail (&tmp_adev->reset_list, &device_list); } - }else + }else { + adev->pcie_reset_ctx.in_link_reset = false;list_add_tail (&adev->reset_list, &device_list); + }amdgpu_device_sched_resume (&device_list,NULL ,NULL );amdgpu_device_gpu_resume (adev, &device_list, false);
--
2.34.1
Quoted 23 lines · Ce Sun
For triggering the dpc event with a single device, we still need to set the
in_link_resetflag and the dpc status.Signed-off-by Ce Sun <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3
-0@@ -6291,6 +6291,9 @@ pci_ers_result_t amdgpu_pci_error_detected(struct pci_dev *pdev, pci_channel_staamdgpu_reset_set_dpc_status (adev, true);mutex_lock (&hive->hive_lock); + }else { +if (amdgpu_device_bus_status_check (adev)) +amdgpu_reset_set_dpc_status (adev, true); }memset (&reset_context,0 ,sizeof (reset_context));INIT_LIST_HEAD (&device_list);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c pci_ers_result_t amdgpu_pci_slot_reset(struct pci_dev *pdev) · line 6417
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-0@@ -6411,6 +6414,7 @@ pci_ers_result_t amdgpu_pci_slot_reset(struct pci_dev *pdev)list_for_each_entry (tmp_adev, &hive->device_list, gmc.xgmi.head) tmp_adev->pcie_reset_ctx.in_link_reset = true; }else { + adev->pcie_reset_ctx.in_link_reset = true;
For the device which gets into DPC, this status is set in detect stage itself within amdgpu_device_recovery_prepare() -
https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c#L6245
You may keep the same for single device case also.
Thanks,
Lijo
Quoted 15 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3
-1set_bit (AMDGPU_SKIP_HW_RESET , &reset_context.flags); }@@ -6467,8 +6471,10 @@ void amdgpu_pci_resume(struct pci_dev *pdev) tmp_adev->pcie_reset_ctx.in_link_reset = false;list_add_tail (&tmp_adev->reset_list, &device_list); } - }else + }else { + adev->pcie_reset_ctx.in_link_reset = false;list_add_tail (&adev->reset_list, &device_list); + }amdgpu_device_sched_resume (&device_list,NULL ,NULL );amdgpu_device_gpu_resume (adev, &device_list, false);