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-Tag: v4.14-rc1~8^2~20^2~24^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=87e919d741f9bf07f8aad6f096c6ebc3345a9856;p=platform%2Fkernel%2Flinux-exynos.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 bd59c6d..ca1926d 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;