1 From 1664ffee760a5d98952318fdd9b198fae396d660 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
3 Date: Thu, 15 Oct 2020 13:21:35 +0100
4 Subject: drm/i915: Mark ininitial fb obj as WT on eLLC machines to avoid rcu lockup during fbdev init
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 From: Ville Syrjälä <ville.syrjala@linux.intel.com>
11 commit 1664ffee760a5d98952318fdd9b198fae396d660 upstream.
13 Currently we leave the cache_level of the initial fb obj
14 set to NONE. This means on eLLC machines the first pin_to_display()
15 will try to switch it to WT which requires a vma unbind+bind.
16 If that happens during the fbdev initialization rcu does not
17 seem operational which causes the unbind to get stuck. To
18 most appearances this looks like a dead machine on boot.
20 Avoid the unbind by already marking the object cache_level
21 as WT when creating it. We still do an excplicit ggtt pin
22 which will rewrite the PTEs anyway, so they will match whatever
25 Cc: <stable@vger.kernel.org> # v5.7+
26 Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
27 Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2381
28 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
29 Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
30 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
31 Link: https://patchwork.freedesktop.org/patch/msgid/20201007120329.17076-1-ville.syrjala@linux.intel.com
32 Link: https://patchwork.freedesktop.org/patch/msgid/20201015122138.30161-1-chris@chris-wilson.co.uk
33 (cherry picked from commit d46b60a2e8d246f1f0faa38e52f4f5a73858c338)
34 Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
35 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
38 drivers/gpu/drm/i915/display/intel_display.c | 8 ++++++++
39 1 file changed, 8 insertions(+)
41 --- a/drivers/gpu/drm/i915/display/intel_display.c
42 +++ b/drivers/gpu/drm/i915/display/intel_display.c
43 @@ -3432,6 +3432,14 @@ initial_plane_vma(struct drm_i915_privat
48 + * Mark it WT ahead of time to avoid changing the
49 + * cache_level during fbdev initialization. The
50 + * unbind there would get stuck waiting for rcu.
52 + i915_gem_object_set_cache_coherency(obj, HAS_WT(i915) ?
53 + I915_CACHE_WT : I915_CACHE_NONE);
55 switch (plane_config->tiling) {
56 case I915_TILING_NONE: