From: Dave Airlie Date: Tue, 31 Mar 2020 05:15:47 +0000 (+1000) Subject: Merge v5.6 into drm-next X-Git-Tag: baikal/mips/sdk5.9~13997^2~1 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=3438f478c840913cb2ba637b9b5492e2070c2d22;p=kernel.git Merge v5.6 into drm-next msm needed rc6, so I just went and merged release (msm has been in drm-next outside of this tree) Signed-off-by: Dave Airlie --- 3438f478c840913cb2ba637b9b5492e2070c2d22 diff --cc drivers/gpu/drm/i915/gvt/vgpu.c index 78f14f04d2eaa,345c2aa3b491e..1d5ff88078bd1 --- a/drivers/gpu/drm/i915/gvt/vgpu.c +++ b/drivers/gpu/drm/i915/gvt/vgpu.c @@@ -272,12 -271,18 +272,19 @@@ void intel_gvt_release_vgpu(struct inte void intel_gvt_destroy_vgpu(struct intel_vgpu *vgpu) { struct intel_gvt *gvt = vgpu->gvt; + struct drm_i915_private *i915 = gvt->gt->i915; - mutex_lock(&vgpu->vgpu_lock); - - WARN(vgpu->active, "vGPU is still active!\n"); + drm_WARN(&i915->drm, vgpu->active, "vGPU is still active!\n"); + /* + * remove idr first so later clean can judge if need to stop + * service if no active vgpu. + */ + mutex_lock(&gvt->lock); + idr_remove(&gvt->vgpu_idr, vgpu->id); + mutex_unlock(&gvt->lock); + + mutex_lock(&vgpu->vgpu_lock); intel_gvt_debugfs_remove_vgpu(vgpu); intel_vgpu_clean_sched_policy(vgpu); intel_vgpu_clean_submission(vgpu);