drm/i915: Reorder struct_mutex-vs-reset_lock in i915_gem_fault()
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 21 Feb 2019 10:29:19 +0000 (10:29 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 21 Feb 2019 14:49:19 +0000 (14:49 +0000)
commit43a8f684b6d1e16c6ecf918332f9b35686bf7edd
tree58571970eb7fffb2598576bbce4adcb72036591a
parent2a3902bd5c14a4946739c9da14071f5aa6e85549
drm/i915: Reorder struct_mutex-vs-reset_lock in i915_gem_fault()

Annoyingly, struct_mutex was not entirely eliminated from the reset
pathway; for reasons of its own, intel_display_resume() requires
struct_mutex to prepare the planes it already captured. To avoid the
immediate problem of a deadlock between the struct_mutex and the reset
srcu, we have to acquire the reset_lock before struct_mutex in
i915_gem_fault(). Now any wait underneath struct_mutex will result us in
having to forcibly reset all inflight rendering, less than ideal, but
better than a deadlock (and will do for the short term).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190221102924.13442-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem.c