Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-01-18 07:53:27 +0100
committerJiri Slaby <jslaby@suse.cz>2019-01-18 07:53:40 +0100
commitd808fab934a29f72675a168aec55b641393c5be0 (patch)
tree89349637cd9c22cc9ac0b22bdb0d2b0c664b2f03
parentaeafd6baf644a4cb424a7c5c8776a541d9d45071 (diff)
drm/i915: Unwind failure on pinning the gen7 ppgtt
-rw-r--r--patches.kernel.org/4.20.3-043-drm-i915-Unwind-failure-on-pinning-the-gen7-pp.patch68
-rw-r--r--series.conf1
2 files changed, 69 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.3-043-drm-i915-Unwind-failure-on-pinning-the-gen7-pp.patch b/patches.kernel.org/4.20.3-043-drm-i915-Unwind-failure-on-pinning-the-gen7-pp.patch
new file mode 100644
index 0000000000..ed43d8ba22
--- /dev/null
+++ b/patches.kernel.org/4.20.3-043-drm-i915-Unwind-failure-on-pinning-the-gen7-pp.patch
@@ -0,0 +1,68 @@
+From: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sat, 22 Dec 2018 03:06:23 +0000
+Subject: [PATCH] drm/i915: Unwind failure on pinning the gen7 ppgtt
+References: bnc#1012628
+Patch-mainline: 4.20.3
+Git-commit: 280d479b310298dfeb1d6f9a1617eca37beb6ce4
+Git-commit: d4de753526f4d99f541f1b6ed1d963005c09700c
+
+commit 280d479b310298dfeb1d6f9a1617eca37beb6ce4 upstream.
+
+If we fail to pin the ggtt vma slot for the ppgtt page tables, we need
+to unwind the locals before reporting the error. Or else on subsequent
+attempts to bind the page tables into the ggtt, we will already believe
+that the vma has been pinned and continue on blithely. If something else
+should happen to be at that location, choas ensues.
+
+Fixes: a2bbf7148342 ("drm/i915/gtt: Only keep gen6 page directories pinned while active")
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
+Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
+Cc: Matthew Auld <matthew.william.auld@gmail.com>
+Cc: <stable@vger.kernel.org> # v4.19+
+Reviewed-by: Matthew Auld <matthew.william.auld@gmail.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20181222030623.21710-1-chris@chris-wilson.co.uk
+(cherry picked from commit d4de753526f4d99f541f1b6ed1d963005c09700c)
+Signed-off-by: Jani Nikula <jani.nikula@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/gpu/drm/i915/i915_gem_gtt.c | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
+index 07999fe09ad2..4fa1d2b146b1 100644
+--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
++++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
+@@ -2117,6 +2117,7 @@ static struct i915_vma *pd_vma_create(struct gen6_hw_ppgtt *ppgtt, int size)
+ int gen6_ppgtt_pin(struct i915_hw_ppgtt *base)
+ {
+ struct gen6_hw_ppgtt *ppgtt = to_gen6_ppgtt(base);
++ int err;
+
+ /*
+ * Workaround the limited maximum vma->pin_count and the aliasing_ppgtt
+@@ -2132,9 +2133,17 @@ int gen6_ppgtt_pin(struct i915_hw_ppgtt *base)
+ * allocator works in address space sizes, so it's multiplied by page
+ * size. We allocate at the top of the GTT to avoid fragmentation.
+ */
+- return i915_vma_pin(ppgtt->vma,
+- 0, GEN6_PD_ALIGN,
+- PIN_GLOBAL | PIN_HIGH);
++ err = i915_vma_pin(ppgtt->vma,
++ 0, GEN6_PD_ALIGN,
++ PIN_GLOBAL | PIN_HIGH);
++ if (err)
++ goto unpin;
++
++ return 0;
++
++unpin:
++ ppgtt->pin_count = 0;
++ return err;
+ }
+
+ void gen6_ppgtt_unpin(struct i915_hw_ppgtt *base)
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 8622231c79..eed253584d 100644
--- a/series.conf
+++ b/series.conf
@@ -280,6 +280,7 @@
patches.kernel.org/4.20.3-040-PCI-dwc-Move-interrupt-acking-into-the-proper-.patch
patches.kernel.org/4.20.3-041-drm-amd-display-Fix-MST-dp_blank-REG_WAIT-time.patch
patches.kernel.org/4.20.3-042-drm-fb-helper-Partially-bring-back-workaround-.patch
+ patches.kernel.org/4.20.3-043-drm-i915-Unwind-failure-on-pinning-the-gen7-pp.patch
########################################################
# Build fixes that apply to the vanilla kernel too.