[PATCH] drm/i915/gvt: To check whether workload scan and shadow has mutex hold
Ping Gao
ping.a.gao at intel.com
Tue Jul 4 06:53:03 UTC 2017
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 <ping.a.gao at intel.com>
---
drivers/gpu/drm/i915/gvt/scheduler.c | 2 ++
1 file changed, 2 insertions(+)
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;
--
2.7.4
More information about the intel-gvt-dev
mailing list