[Intel-xe] [PATCH 5/5] drm/xe: Return the correct error when dma_resv_wait_timeout fails

Thomas Hellström thomas.hellstrom at linux.intel.com
Fri May 26 12:40:04 UTC 2023


On 5/26/23 14:11, Maarten Lankhorst wrote:
> We call dma_resv_wait_timeout with MAX_SCHEDULE_TIMEOUT, so it can
> never return -ETIME. It will however fail if interrupted, so in that
> case return the error.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/239

Reviewed-by: Thomas Hellström <thomas.hellstrom at linux.intel.com>


> ---
>   drivers/gpu/drm/xe/xe_bo.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
> index 8735facb1cf9..77ba8492bd90 100644
> --- a/drivers/gpu/drm/xe/xe_bo.c
> +++ b/drivers/gpu/drm/xe/xe_bo.c
> @@ -611,8 +611,8 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
>   						     DMA_RESV_USAGE_BOOKKEEP,
>   						     true,
>   						     MAX_SCHEDULE_TIMEOUT);
> -		if (timeout <= 0) {
> -			ret = -ETIME;
> +		if (timeout < 0) {
> +			ret = timeout;
>   			goto out;
>   		}
>   		ttm_bo_move_null(ttm_bo, new_mem);


More information about the Intel-xe mailing list