drm/amdgpu: Extend KIQ reg polling wait for VF
Subsystems (2)
PATCH 1/2 drm/amdgpu: Extend KIQ reg polling wait for VF
Runtime KIQ interface to read/write registers in VF may take longer than expected for BM environment. Extend the timeout.
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +3 -3
@@ -348,9 +348,9 @@ enum amdgpu_kiq_irq {AMDGPU_CP_KIQ_IRQ_DRIVER0 =0 ,AMDGPU_CP_KIQ_IRQ_LAST }; -#define SRIOV_USEC_TIMEOUT 1200000/* wait 12 * 100ms for SRIOV */ -#define MAX_KIQ_REG_WAIT 5000/* in usecs, 5ms */ -#define MAX_KIQ_REG_BAILOUT_INTERVAL 5/* in msecs, 5ms */ +#define SRIOV_USEC_TIMEOUT 1200000/* wait 12 * 100ms for SRIOV */ +#define MAX_KIQ_REG_WAIT amdgpu_sriov_vf(adev) ? 50000 : 5000/* in usecs, extend for VF */ +#define MAX_KIQ_REG_BAILOUT_INTERVAL 5/* in msecs, 5ms */ #define MAX_KIQ_REG_TRY 1000 int amdgpu_device_ip_set_clockgating_state(void *dev,
Signature · 1 line
2.34.1
PATCH 2/2 drm/amdgpu: Queue KFD reset workitem in VF FED
The guest recovery sequence is buggy in Fatal Error when both FLR & KFD reset workitems are queued at the same time. In addition, FLR guest recovery sequence is out of order when PF/VF communication breaks due to a GPU fatal error
As a temporary work around, perform a KFD style reset (Initiate reset request from the guest) inside the pf2vf thread on FED.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +1 -1
@@ -602,7 +602,7 @@ static void amdgpu_virt_update_vf2pf_work_item(struct work_struct *work) amdgpu_sriov_runtime(adev)) {amdgpu_ras_set_fed (adev, true);if (amdgpu_reset_domain_schedule (adev->reset_domain, - &adev->virt.flr_work)) + &adev->kfd.reset_work))return ;else dev_err (adev->dev,"Failed to queue work! at %s" , __func__);
Signature · 1 line
2.34.1
RE: [PATCH 2/2] drm/amdgpu: Queue KFD reset workitem in VF FED
[AMD Official Use Only - AMD Internal Distribution Only]
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Victor Skvortsov
Sent: Sunday, May 19, 2024 10:52 AM
To: [email protected]
Cc: Skvortsov, Victor <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu: Queue KFD reset workitem in VF FED
The guest recovery sequence is buggy in Fatal Error when both FLR & KFD reset workitems are queued at the same time. In addition, FLR guest recovery sequence is out of order when PF/VF communication breaks due to a GPU fatal error
As a temporary work around, perform a KFD style reset (Initiate reset request from the guest) inside the pf2vf thread on FED.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +1 -1
@@ -602,7 +602,7 @@ static void amdgpu_virt_update_vf2pf_work_item(struct work_struct *work) amdgpu_sriov_runtime(adev)) {amdgpu_ras_set_fed (adev, true);if (amdgpu_reset_domain_schedule (adev->reset_domain, - &adev->virt.flr_work)) + &adev->kfd.reset_work))return ;else dev_err (adev->dev,"Failed to queue work! at %s" , __func__);
--
2.34.1
[AMD Official Use Only - AMD Internal Distribution Only]
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Victor Skvortsov
Sent: Sunday, May 19, 2024 10:52 AM
To: [email protected]
Cc: Skvortsov, Victor <[email protected]>
Subject: [PATCH 1/2] drm/amdgpu: Extend KIQ reg polling wait for VF
Runtime KIQ interface to read/write registers in VF may take longer than expected for BM environment. Extend the timeout.
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +4 -3
@@ -348,9 +348,9 @@ enum amdgpu_kiq_irq {AMDGPU_CP_KIQ_IRQ_DRIVER0 =0 ,AMDGPU_CP_KIQ_IRQ_LAST }; -#define SRIOV_USEC_TIMEOUT 1200000/* wait 12 * 100ms for SRIOV */ -#define MAX_KIQ_REG_WAIT 5000/* in usecs, 5ms */ -#define MAX_KIQ_REG_BAILOUT_INTERVAL 5/* in msecs, 5ms */ +#define SRIOV_USEC_TIMEOUT 1200000/* wait 12 * 100ms for SRIOV */ +#define MAX_KIQ_REG_WAIT amdgpu_sriov_vf(adev) ? 50000 : 5000/* in +usecs, extend for VF */ #define MAX_KIQ_REG_BAILOUT_INTERVAL 5/* in +msecs, 5ms */ #define MAX_KIQ_REG_TRY 1000
int amdgpu_device_ip_set_clockgating_state(void *dev,
--
2.34.1