drm/amdgpu: Report MES ring wait timeouts.
Subsystems (2)
PATCH 1/1 drm/amdgpu: Report MES ring wait timeouts.
Return -ETIMEDOUT when the fence wait before submission expires instead of reporting success without submitting the packet.
--- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 5 ++++- drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +4 -1
@@ -218,8 +218,11 @@ static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes, r =amdgpu_fence_wait_polling (ring, seq - ring->fence_drv.num_fences_mask, timeout); -if (r <1 ) +if (r <1 ) { +if (!r) + r = -ETIMEDOUT ; goto error_undo; + } api_status = (struct MES_API_STATUS *)((char *)pkt + api_status_off); api_status->api_completion_fence_addr = status_gpu_addr;
drivers/gpu/drm/amd/amdgpu/mes_v12_0.c +4 -1
@@ -195,8 +195,11 @@ static int mes_v12_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes, r =amdgpu_fence_wait_polling (ring, seq - ring->fence_drv.num_fences_mask, timeout); -if (r <1 ) +if (r <1 ) { +if (!r) + r = -ETIMEDOUT ; goto error_undo; + } api_status = (struct MES_API_STATUS *)((char *)pkt + api_status_off); api_status->api_completion_fence_addr = status_gpu_addr;
Signature · 1 line
2.56.0
Quoted 17 lines · Erhan Bilgili
Return
-ETIMEDOUTwhen the fence wait before submission expires instead of reporting success without submitting the packet.Fixes 34e087e8920e ("drm/amdgpu/mes: fix mes ring buffer overflow")Signed-off-by Erhan Bilgili <[email protected]>--- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 5 ++++- drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +0
-0
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes, · line 222
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +2
-1@@ -218,8 +218,11 @@ static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes, r =amdgpu_fence_wait_polling (ring, seq - ring->fence_drv.num_fences_mask, timeout); -if (r <1 ) +if (r <1 ) { +if (!r)
I think you can just set r = -ETIMEDOUT;. No need to check !r.
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +2
-0+ r = -ETIMEDOUT ; goto error_undo; + } api_status = (struct MES_API_STATUS *)((char *)pkt + api_status_off); api_status->api_completion_fence_addr = status_gpu_addr;drivers/gpu/drm/amd/amdgpu/mes_v12_0.c +0
-0
drivers/gpu/drm/amd/amdgpu/mes_v12_0.c static int mes_v12_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes, · line 200
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/mes_v12_0.c +3
-1@@ -195,8 +195,11 @@ static int mes_v12_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes, r =amdgpu_fence_wait_polling (ring, seq - ring->fence_drv.num_fences_mask, timeout); -if (r <1 ) +if (r <1 ) { +if (!r) + r = -ETIMEDOUT ;
Same here.
Alex
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/mes_v12_0.c +1
-1goto error_undo; + } api_status = (struct MES_API_STATUS *)((char *)pkt + api_status_off); api_status->api_completion_fence_addr = status_gpu_addr; --2.56.0
PATCH v2 1/1 drm/amdgpu: Report MES ring wait timeouts.
In reply to Erhan BilgiliReturn -ETIMEDOUT when the fence wait before submission expires instead of reporting success without submitting the packet.
---
v2: Dropped the redundant check of the wait return value.
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 4 +++- drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +3 -1
@@ -218,8 +218,10 @@ static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes, r =amdgpu_fence_wait_polling (ring, seq - ring->fence_drv.num_fences_mask, timeout); -if (r <1 ) +if (r <1 ) { + r = -ETIMEDOUT ; goto error_undo; + } api_status = (struct MES_API_STATUS *)((char *)pkt + api_status_off); api_status->api_completion_fence_addr = status_gpu_addr;
drivers/gpu/drm/amd/amdgpu/mes_v12_0.c +3 -1
@@ -195,8 +195,10 @@ static int mes_v12_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes, r =amdgpu_fence_wait_polling (ring, seq - ring->fence_drv.num_fences_mask, timeout); -if (r <1 ) +if (r <1 ) { + r = -ETIMEDOUT ; goto error_undo; + } api_status = (struct MES_API_STATUS *)((char *)pkt + api_status_off); api_status->api_completion_fence_addr = status_gpu_addr;
Signature · 1 line
2.56.0
Quoted 6 lines · Erhan Bilgili
Return
-ETIMEDOUTwhen the fence wait before submission expires instead of reporting success without submitting the packet.Fixes 34e087e8920e ("drm/amdgpu/mes: fix mes ring buffer overflow")Signed-off-by Erhan Bilgili <[email protected]>
Reviewed and applied.
Thanks!
Quoted 42 lines
---
v2: Dropped the redundant check of the wait return value.drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 4 +++- drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +3
-1@@ -218,8 +218,10 @@ static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes, r =amdgpu_fence_wait_polling (ring, seq - ring->fence_drv.num_fences_mask, timeout); -if (r <1 ) +if (r <1 ) { + r = -ETIMEDOUT ; goto error_undo; + } api_status = (struct MES_API_STATUS *)((char *)pkt + api_status_off); api_status->api_completion_fence_addr = status_gpu_addr;drivers/gpu/drm/amd/amdgpu/mes_v12_0.c +3
-2@@ -195,8 +195,10 @@ static int mes_v12_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes, r =amdgpu_fence_wait_polling (ring, seq - ring->fence_drv.num_fences_mask, timeout); -if (r <1 ) +if (r <1 ) { + r = -ETIMEDOUT ; goto error_undo; + } api_status = (struct MES_API_STATUS *)((char *)pkt + api_status_off); api_status->api_completion_fence_addr = status_gpu_addr; --2.56.0