summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/gt/intel_gt_pm.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-10-14 15:13:36 +0300
committerChris Wilson <chris@chris-wilson.co.uk>2019-10-14 23:10:59 +0300
commit3c00660db18371c632adae4836ed2b2d3d78ecb6 (patch)
treea81f26db4aef103e46d9504b85e3352e72eb0725 /drivers/gpu/drm/i915/gt/intel_gt_pm.c
parent53448aed7b805cf36ecc59ed5fe8e53815ce4fe8 (diff)
downloadlinux-3c00660db18371c632adae4836ed2b2d3d78ecb6.tar.xz
drm/i915/execlists: Assert tasklet is locked for process_csb()
We rely on only the tasklet being allowed to call into process_csb(), so assert that is locked when we do. As the tasklet uses a simple bitlock, there is no strong lockdep checking so we must make do with a plain assertion that the tasklet is running and assume that we are the tasklet! v2: Fixup intel_gt_sanitize() to prepare each engine for the reset so that the locks are marked as held during the reset v3: Check for existent function pointers for very early sanitisation. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20191014121336.30137-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/gt/intel_gt_pm.c')
-rw-r--r--drivers/gpu/drm/i915/gt/intel_gt_pm.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
index 87e34e0b6427..bd1bd3e00a94 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
@@ -136,11 +136,18 @@ void intel_gt_sanitize(struct intel_gt *gt, bool force)
intel_uc_sanitize(&gt->uc);
- if (!reset_engines(gt) && !force)
- return;
+ for_each_engine(engine, gt->i915, id)
+ if (engine->reset.prepare)
+ engine->reset.prepare(engine);
+
+ if (reset_engines(gt) || force) {
+ for_each_engine(engine, gt->i915, id)
+ __intel_engine_reset(engine, false);
+ }
for_each_engine(engine, gt->i915, id)
- __intel_engine_reset(engine, false);
+ if (engine->reset.finish)
+ engine->reset.finish(engine);
}
void intel_gt_pm_disable(struct intel_gt *gt)