Adjust MES polling timeout for sriov worst case
Subsystems (2)
PATCH v2 1/1 Adjust MES polling timeout for sriov worst case
[why]
MES response time in sriov may be longer than default value due to reset or init in other VF. A timeout value specific to sriov is needed.
[how]
When in sriov, adjust the timeout value to calculated worst case scenario.
Signed-off-by Yiqing Yao <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +8 -1
@@ -98,7 +98,14 @@ static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes,struct amdgpu_device *adev = mes->adev;struct amdgpu_ring *ring = &mes->ring;unsigned long flags; +signed long timeout = adev->usec_timeout; +if (amdgpu_emu_mode) { + timeout *=100 ; + }else if (amdgpu_sriov_vf (adev)) { +/* Worst case in sriov where all other 15 VF timeout, each VF needs about 600ms */ + timeout =15 *600 *1000 ; + }BUG_ON (size %4 !=0 );spin_lock_irqsave (&mes->ring_lock, flags);
@@ -118,7 +125,7 @@ static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes,DRM_DEBUG ("MES msg=%d was emitted\n" , x_pkt->header.opcode); r =amdgpu_fence_wait_polling (ring, ring->fence_drv.sync_seq, - adev->usec_timeout * (amdgpu_emu_mode ?100 :1 )); + timeout);if (r <1 ) {DRM_ERROR ("MES failed to response msg=%d\n" , x_pkt->header.opcode);
Signature · 1 line
2.34.1
Quoted 11 lines · Yiqing Yao
[why]
MES response time in sriov may be longer than default value due to reset or init in other VF. A timeout value specific to sriov is needed.[how]
When in sriov, adjust the timeout value to calculated worst case scenario.Signed-off-by Yiqing Yao <[email protected]>
Please prefix your patch subject with drm/amdgpu:. E.g., drm/amdgpu: Adjust MES polling timeout for sriov worst case
With that fixed:
Reviewed-by Alex Deucher <[email protected]>
Quoted 35 lines
--- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +8
-2@@ -98,7 +98,14 @@ static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes,struct amdgpu_device *adev = mes->adev;struct amdgpu_ring *ring = &mes->ring;unsigned long flags; +signed long timeout = adev->usec_timeout; +if (amdgpu_emu_mode) { + timeout *=100 ; + }else if (amdgpu_sriov_vf (adev)) { +/* Worst case in sriov where all other 15 VF timeout, each VF needs about 600ms */ + timeout =15 *600 *1000 ; + }BUG_ON (size %4 !=0 );spin_lock_irqsave (&mes->ring_lock, flags);@@ -118,7 +125,7 @@ static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes,DRM_DEBUG ("MES msg=%d was emitted\n" , x_pkt->header.opcode); r =amdgpu_fence_wait_polling (ring, ring->fence_drv.sync_seq, - adev->usec_timeout * (amdgpu_emu_mode ?100 :1 )); + timeout);if (r <1 ) {DRM_ERROR ("MES failed to response msg=%d\n" , x_pkt->header.opcode); --2.34.1