[PATCH 1/3] drm/i915/gvt: Don't submit request for error workload dispatch

Zhang, Xiong Y xiong.y.zhang at intel.com
Fri Mar 1 02:10:40 UTC 2019


> As vGPU shadow ctx is loaded with guest context state, arbitrarily submitting
> request in error workload dispatch path would cause trouble.
> So don't try to submit in error path now like in previous code.
> This is to fix VM failure when GPU hang happens.
[Zhang, Xiong Y] As in the previous comments, arbitrarily submitting
request in error workload dispatch path would cause gpu hang. But what's the mean of "This is to fix VM failure when GPU hang happens" ?

Reviewed-by: Xiong Zhang (xiong.y.zhang at intel.com)

thanks
> 
> Fixes: f0e994372518 ("drm/i915/gvt: Fix workload request allocation before
> request add")
> Signed-off-by: Zhenyu Wang <zhenyuw at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/gvt/scheduler.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c
> b/drivers/gpu/drm/i915/gvt/scheduler.c
> index 1bb8f936fdaa..5b59cba9f93a 100644
> --- a/drivers/gpu/drm/i915/gvt/scheduler.c
> +++ b/drivers/gpu/drm/i915/gvt/scheduler.c
> @@ -678,6 +678,7 @@ static int dispatch_workload(struct
> intel_vgpu_workload *workload)  {
>  	struct intel_vgpu *vgpu = workload->vgpu;
>  	struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv;
> +	struct i915_request *rq;
>  	int ring_id = workload->ring_id;
>  	int ret;
> 
> @@ -703,6 +704,13 @@ static int dispatch_workload(struct
> intel_vgpu_workload *workload)
> 
>  	ret = prepare_workload(workload);
>  out:
> +	if (ret) {
> +		/* We might still need to add request with
> +		 * clean ctx to retire it properly.. */
> +		rq = fetch_and_zero(&workload->req);
> +		i915_request_put(rq);
> +	}
> +
>  	if (!IS_ERR_OR_NULL(workload->req)) {
>  		gvt_dbg_sched("ring id %d submit workload to i915 %p\n",
>  				ring_id, workload->req);
> --
> 2.20.1
> 
> _______________________________________________
> intel-gvt-dev mailing list
> intel-gvt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev


More information about the intel-gvt-dev mailing list