summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/intel_wakeref.c
diff options
context:
space:
mode:
authorAndrzej Hajda <andrzej.hajda@intel.com>2023-10-30 18:40:13 +0100
committerAndrzej Hajda <andrzej.hajda@intel.com>2023-11-20 12:36:56 +0100
commit5e4e06e4087eb91b0e5405ed42e792415d055e45 (patch)
tree26b8153313c3005c4802972cad61f5817cf27a3a /drivers/gpu/drm/i915/intel_wakeref.c
parentb49e894c3fd83f67aae2a4778b98ea3838e41020 (diff)
downloadlwn-5e4e06e4087eb91b0e5405ed42e792415d055e45.tar.gz
lwn-5e4e06e4087eb91b0e5405ed42e792415d055e45.zip
drm/i915: Track gt pm wakerefs
Track every intel_gt_pm_get() until its corresponding release in intel_gt_pm_put() by returning a cookie to the caller for acquire that must be passed by on released. When there is an imbalance, we can see who either tried to free a stale wakeref, or who forgot to free theirs. v2: track recently added calls in gen8_ggtt_bind_get_ce and destroyed_worker_func Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231030-ref_tracker_i915-v1-2-006fe6b96421@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_wakeref.c')
-rw-r--r--drivers/gpu/drm/i915/intel_wakeref.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_wakeref.c b/drivers/gpu/drm/i915/intel_wakeref.c
index 2401b88b55a4..dea2f63184f8 100644
--- a/drivers/gpu/drm/i915/intel_wakeref.c
+++ b/drivers/gpu/drm/i915/intel_wakeref.c
@@ -99,7 +99,8 @@ static void __intel_wakeref_put_work(struct work_struct *wrk)
void __intel_wakeref_init(struct intel_wakeref *wf,
struct drm_i915_private *i915,
const struct intel_wakeref_ops *ops,
- struct intel_wakeref_lockclass *key)
+ struct intel_wakeref_lockclass *key,
+ const char *name)
{
wf->i915 = i915;
wf->ops = ops;
@@ -111,6 +112,10 @@ void __intel_wakeref_init(struct intel_wakeref *wf,
INIT_DELAYED_WORK(&wf->work, __intel_wakeref_put_work);
lockdep_init_map(&wf->work.work.lockdep_map,
"wakeref.work", &key->work, 0);
+
+#if IS_ENABLED(CONFIG_DRM_I915_DEBUG_WAKEREF)
+ ref_tracker_dir_init(&wf->debug, INTEL_REFTRACK_DEAD_COUNT, name);
+#endif
}
int intel_wakeref_wait_for_idle(struct intel_wakeref *wf)