drm/amdgpu/userq: dont overwrite the error of subsequent map call
Subsystems (2)
PATCH 1/1 drm/amdgpu/userq: dont overwrite the error of subsequent map call
If a queue fails to map that we need to return the error code back to the caller and not overwrite with a success specifically.
Accumulate the failure and return that.
Signed-off-by Sunil Khatri <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +3 -2
@@ -1562,7 +1562,7 @@ int amdgpu_userq_post_reset(struct amdgpu_device *adev, bool vram_lost)struct amdgpu_usermode_queue *queue;const struct amdgpu_userq_funcs *userq_funcs;unsigned long queue_id; -int r =0 ; +int ret =0 , r;xa_for_each (&adev->userq_doorbell_xa, queue_id, queue) {if (queue->state ==AMDGPU_USERQ_STATE_HUNG && !vram_lost) {
@@ -1573,6 +1573,7 @@ int amdgpu_userq_post_reset(struct amdgpu_device *adev, bool vram_lost) r = userq_funcs->map (queue);if (r) {dev_err (adev->dev,"Failed to remap queue %ld\n" , queue_id); + ret = r;continue ; }trace_amdgpu_userq_state_changed (queue,AMDGPU_USERQ_STATE_MAPPED );
@@ -1580,5 +1581,5 @@ int amdgpu_userq_post_reset(struct amdgpu_device *adev, bool vram_lost) } } -return r; +return ret; }
Signature · 1 line
2.34.1
Quoted 7 lines · Sunil Khatri
If a queue fails to map that we need to return the error code back to the caller and not overwrite with a success specifically.
Accumulate the failure and return that.
Signed-off-by Sunil Khatri <[email protected]>
Reviewed-by Alex Deucher <[email protected]>
Quoted 35 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +3
-3@@ -1562,7 +1562,7 @@ int amdgpu_userq_post_reset(struct amdgpu_device *adev, bool vram_lost)struct amdgpu_usermode_queue *queue;const struct amdgpu_userq_funcs *userq_funcs;unsigned long queue_id; -int r =0 ; +int ret =0 , r;xa_for_each (&adev->userq_doorbell_xa, queue_id, queue) {if (queue->state ==AMDGPU_USERQ_STATE_HUNG && !vram_lost) {@@ -1573,6 +1573,7 @@ int amdgpu_userq_post_reset(struct amdgpu_device *adev, bool vram_lost) r = userq_funcs->map (queue);if (r) {dev_err (adev->dev,"Failed to remap queue %ld\n" , queue_id); + ret = r;continue ; }trace_amdgpu_userq_state_changed (queue,AMDGPU_USERQ_STATE_MAPPED );@@ -1580,5 +1581,5 @@ int amdgpu_userq_post_reset(struct amdgpu_device *adev, bool vram_lost) } } -return r; +return ret; } --2.34.1