summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/gvt/scheduler.c
diff options
context:
space:
mode:
authorZhenyu Wang2019-03-01 08:55:04 +0100
committerZhenyu Wang2019-03-01 08:55:04 +0100
commitf552e7bd028f93157b206bd1c7e3e195e919e8c2 (patch)
treed8db93e5386d1464f94da389ef01deaea4a1c5ce /drivers/gpu/drm/i915/gvt/scheduler.c
parentdrm/i915/gvt: stop scheduling workload when vgpu is inactive (diff)
downloadkernel-qcow2-linux-f552e7bd028f93157b206bd1c7e3e195e919e8c2.tar.gz
kernel-qcow2-linux-f552e7bd028f93157b206bd1c7e3e195e919e8c2.tar.xz
kernel-qcow2-linux-f552e7bd028f93157b206bd1c7e3e195e919e8c2.zip
drm/i915/gvt: Don't submit request for error workload dispatch
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. Fixes: f0e994372518 ("drm/i915/gvt: Fix workload request allocation before request add") Reviewed-by: Xiong Zhang <xiong.y.zhang@intel.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/gvt/scheduler.c')
-rw-r--r--drivers/gpu/drm/i915/gvt/scheduler.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c
index af97df10495e..817d46f25f09 100644
--- a/drivers/gpu/drm/i915/gvt/scheduler.c
+++ b/drivers/gpu/drm/i915/gvt/scheduler.c
@@ -677,6 +677,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;
@@ -702,6 +703,14 @@ 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);