From: Ping Gao Date: Tue, 4 Jul 2017 06:53:03 +0000 (+0800) Subject: drm/i915/gvt: To check whether workload scan and shadow has mutex hold X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=87e919d741f9bf07f8aad6f096c6ebc3345a9856;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/i915/gvt: To check whether workload scan and shadow has mutex hold The function workload scan and shadow have to hold the drm.struct_mutex before called. To avoid misusing of this function, add a lockdep assert in it. Signed-off-by: Ping Gao Signed-off-by: Zhenyu Wang --- diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c index bd59c6d09319..ca1926d564c9 100644 --- a/drivers/gpu/drm/i915/gvt/scheduler.c +++ b/drivers/gpu/drm/i915/gvt/scheduler.c @@ -201,6 +201,8 @@ int intel_gvt_scan_and_shadow_workload(struct intel_vgpu_workload *workload) struct intel_vgpu *vgpu = workload->vgpu; int ret; + lockdep_assert_held(&dev_priv->drm.struct_mutex); + if (workload->shadowed) return 0;