[PATCH] drm/i915/gvt: fix the usage of ww lock in gvt scheduler.

Zhenyu Wang zhenyuw at linux.intel.com
Mon Sep 13 13:31:25 UTC 2021


On 2021.08.26 14:38:34 +0000, Zhi A Wang wrote:
> As the APIs related to ww lock in i915 was changed recently, the usage of
> ww lock in GVT-g scheduler needs to be changed accrodingly. We noticed a
> deadlock when GVT-g scheduler submits the workload to i915. After some
> investigation, it seems the way of how to use ww lock APIs has been
> changed. Releasing a ww now requires a explict i915_gem_ww_ctx_fini().
> 
> Fixes: 67f1120381df ("drm/i915/gvt: Introduce per object locking in GVT scheduler.")
> Cc: Zhenyu Wang <zhenyuw at linux.intel.com>
> Signed-off-by: Zhi A Wang <zhi.a.wang at intel.com>
> ---

Oops, looks I missed this one.

Reviewed-by: Zhenyu Wang <zhenyuw at linux.intel.com>

Thanks for the fix!

>  drivers/gpu/drm/i915/gvt/scheduler.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c
> index 9578e57db4c2..43fedfe9639a 100644
> --- a/drivers/gpu/drm/i915/gvt/scheduler.c
> +++ b/drivers/gpu/drm/i915/gvt/scheduler.c
> @@ -576,7 +576,7 @@ static int prepare_shadow_batch_buffer(struct intel_vgpu_workload *workload)
>  
>  			/* No one is going to touch shadow bb from now on. */
>  			i915_gem_object_flush_map(bb->obj);
> -			i915_gem_object_unlock(bb->obj);
> +			i915_gem_ww_ctx_fini(&ww);
>  		}
>  	}
>  	return 0;
> @@ -630,7 +630,7 @@ static int prepare_shadow_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx)
>  		return ret;
>  	}
>  
> -	i915_gem_object_unlock(wa_ctx->indirect_ctx.obj);
> +	i915_gem_ww_ctx_fini(&ww);
>  
>  	/* FIXME: we are not tracking our pinned VMA leaving it
>  	 * up to the core to fix up the stray pin_count upon
> -- 
> 2.25.1
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20210913/b0dabe1e/attachment.sig>


More information about the intel-gvt-dev mailing list