From: Chris Wilson Date: Tue, 12 Feb 2019 13:08:31 +0000 (+0000) Subject: drm/i915: Detect potential i915_reset_trylock() lockups X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b3b0391af2afa783841fb70eaa715b8a79a17d99;p=openwrt%2Fstaging%2Fblogic.git drm/i915: Detect potential i915_reset_trylock() lockups Use lockdep to warn before we wait indefinitely in case we may be waiting indefinitely. Suggested-by: Mika Kuoppala References: 2caffbf11762 ("drm/i915: Revoke mmaps and prevent access to fence registers across reset") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20190212130831.14425-2-chris@chris-wilson.co.uk --- diff --git a/drivers/gpu/drm/i915/i915_reset.c b/drivers/gpu/drm/i915/i915_reset.c index c1b53533ada6..12e74decd7a2 100644 --- a/drivers/gpu/drm/i915/i915_reset.c +++ b/drivers/gpu/drm/i915/i915_reset.c @@ -1305,6 +1305,9 @@ int i915_reset_trylock(struct drm_i915_private *i915) struct i915_gpu_error *error = &i915->gpu_error; int srcu; + might_lock(&error->reset_backoff_srcu); + might_sleep(); + rcu_read_lock(); while (test_bit(I915_RESET_BACKOFF, &error->flags)) { rcu_read_unlock();