[PATCH v7 02/13] drm/xe/guc_submit: Make suspend_wait interruptible

Matthew Brost matthew.brost at intel.com
Thu Aug 8 03:13:22 UTC 2024


On Wed, Aug 07, 2024 at 06:23:31PM +0200, Francois Dugast wrote:
> Rely on wait_event_interruptible_timeout() to put the process to sleep
> with TASK_INTERRUPTIBLE. It allows using this function in interruptible
> context.
> 
> Signed-off-by: Francois Dugast <francois.dugast at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_guc_submit.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
> index 460808507947..50013e1e7455 100644
> --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
> @@ -1603,11 +1603,11 @@ static int guc_exec_queue_suspend_wait(struct xe_exec_queue *q)
>  	 * suspend_pending upon kill but to be paranoid but races in which
>  	 * suspend_pending is set after kill also check kill here.
>  	 */
> -	ret = wait_event_timeout(q->guc->suspend_wait,
> -				 !READ_ONCE(q->guc->suspend_pending) ||
> -				 exec_queue_killed(q) ||
> -				 guc_read_stopped(guc),
> -				 HZ * 5);
> +	ret = wait_event_interruptible_timeout(q->guc->suspend_wait,
> +					       !READ_ONCE(q->guc->suspend_pending) ||
> +					       exec_queue_killed(q) ||
> +					       guc_read_stopped(guc),
> +					       HZ * 5);
>  

At the botton of this function we always return 0, that isn't correct now.

>  	if (!ret) {
>  		xe_gt_warn(guc_to_gt(guc),

In unseen code:

s/Return 0;/Return ret < 0 ? ret : 0;

Matt

> -- 
> 2.43.0
> 


More information about the Intel-xe mailing list