Skip to contentSkip to conversation

Patch "drm/i915: Serialize GTT/Aperture accesses on BXT" has been added to the 4.11-stable tree

PATCH [email protected] 1 participant 2 messages Jun 12, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

drm/i915: Serialize GTT/Aperture accesses on BXT

to the 4.11-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
drm-i915-serialize-gtt-aperture-accesses-on-bxt.patch
and it can be found in the queue-4.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From d86b18a06cf361e12ccdf61ae240d432182d8d6b Mon Sep 17 00:00:00 2001

From: Jon Bloomfield <[email protected]>
Date: Wed, 24 May 2017 08:54:11 -0700
Subject: drm/i915: Serialize GTT/Aperture accesses on BXT

From: Jon Bloomfield <[email protected]>

commit d86b18a06cf361e12ccdf61ae240d432182d8d6b upstream.

BXT has a H/W issue with IOMMU which can lead to system hangs when Aperture accesses are queued within the GAM behind GTT Accesses.

This patch avoids the condition by wrapping all GTT updates in stop_machine and using a flushing read prior to restarting the machine.

The stop_machine guarantees no new Aperture accesses can begin while the PTE writes are being emmitted. The flushing read ensures that any following Aperture accesses cannot begin until the PTE writes have been cleared out of the GAM's fifo.

Only FOLLOWING Aperture accesses need to be separated from in flight PTE updates. PTE Writes may follow tightly behind already in flight Aperture accesses, so no flushing read is required at the start of a PTE update sequence.

This issue was reproduced by running
igt/gem_readwrite and
igt/gem_render_copy
simultaneously from different processes, each in a tight loop, with INTEL_IOMMU enabled.

This patch was originally published as:
drm/i915: Serialize GTT Updates on BXT

[Note: This will cause a performance penalty for some use cases, but avoiding hangs trumps performance hits. This may need to be worked around in Mesa to recover the lost performance.]

v2: Move bxt/iommu detection into static function
Remove #ifdef CONFIG_INTEL_IOMMU protection Make function names more reflective of purpose Move flushing read into static function

v3: Tidy up for checkpatch.pl

Testcase: igt/gem_concurrent_blit

Cc John Harrison <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
(cherry picked from commit 0ef34ad6222abfa513117515fec720c33a58f105)
---
 drivers/gpu/drm/i915/i915_drv.h     |   10 +++
 drivers/gpu/drm/i915/i915_gem_gtt.c |  103 ++++++++++++++++++++++++++++++++++++
 2 files changed, 113 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +10 -0
@@ -2916,6 +2916,16 @@ static inline bool intel_scanout_needs_v
 	return false;
 }
 
+static inline bool
+intel_ggtt_update_needs_vtd_wa(struct drm_i915_private *dev_priv)
+{
+#ifdef CONFIG_INTEL_IOMMU
+	if (IS_BROXTON(dev_priv) && intel_iommu_gfx_mapped)
+		return true;
+#endif
+	return false;
+}
+
 int intel_sanitize_enable_ppgtt(struct drm_i915_private *dev_priv,
 				int enable_ppgtt);
 
drivers/gpu/drm/i915/i915_gem_gtt.c +103 -0

115 lines not on this page · raw message

Patches currently in stable-queue which might be from [email protected] are

queue-4.11/drm-i915-serialize-gtt-aperture-accesses-on-bxt.patch

author maintainer
#1 lore raw
Quoted 8 lines · On Mon, Jun 12, 2017 at 02:47:58PM +0200, [email protected] wrote:

This is a note to let you know that I've just added the patch titled

drm/i915: Serialize GTT/Aperture accesses on BXT

to the 4.11-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

Quoted 6 lines

The filename of the patch is:
drm-i915-serialize-gtt-aperture-accesses-on-bxt.patch
and it can be found in the queue-4.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Nope, it broke the build!

Ugh, I _REALLY_ am hating the i915 driver, here I was trying to be nice and start to apply some of the stable patches and boom, the build breaks...

ugh, nevermind, I'm just flushing my queue of this crap...

greg k-h