drm/i915/gvt: correct the reset logic
authorPing Gao <ping.a.gao@intel.com>
Wed, 26 Oct 2016 05:36:41 +0000 (13:36 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Wed, 26 Oct 2016 05:36:41 +0000 (13:36 +0800)
The current_vgpu will set to NULL after stopping the scheduler when
the reset is triggered by current vgpu, so here need change the
judgement condition for current vgpu detection.

Signed-off-by: Ping Gao <ping.a.gao@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/handlers.c

index 52af51728cc1728c46e050cbb765de81b8b31ef5..7832e49ed5b3f47b3f367bb95387e36311bbff3e 100644 (file)
@@ -239,7 +239,11 @@ static int handle_device_reset(struct intel_vgpu *vgpu, unsigned int offset,
        vgpu->resetting = true;
 
        intel_vgpu_stop_schedule(vgpu);
-       if (scheduler->current_vgpu == vgpu) {
+       /*
+        * The current_vgpu will set to NULL after stopping the
+        * scheduler when the reset is triggered by current vgpu.
+        */
+       if (scheduler->current_vgpu == NULL) {
                mutex_unlock(&vgpu->gvt->lock);
                intel_gvt_wait_vgpu_idle(vgpu);
                mutex_lock(&vgpu->gvt->lock);