All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "[PATCH] Revert "drm/i915/execlists: Reset RING registers upon resume"" has been added to the 4.9-stable tree
@ 2017-04-12 13:54 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-04-12 13:54 UTC (permalink / raw)
  To: gregkh, chris, eblau1, jani.nikula, joonas.lahtinen
  Cc: stable, stable-commits


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

    [PATCH] Revert "drm/i915/execlists: Reset RING registers upon resume"

to the 4.9-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:
     revert-drm-i915-execlists-reset-ring-registers-upon-resume.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 15b0378860aab3433da7424bd733d92b189c31cf Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Wed, 12 Apr 2017 15:49:39 +0200
Subject: [PATCH] Revert "drm/i915/execlists: Reset RING registers upon resume"

This reverts commit f2a0409a08502d64fbe3990354dff5902b08d2fb which is
commit bafb2f7d4755bf1571bd5e9a03b97f3fc4fe69ae upstream.

It was reported to have problems.

Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Eric Blau <eblau1@gmail.com>
Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org
---
 drivers/gpu/drm/i915/intel_lrc.c |   58 +++++++++++++++------------------------
 1 file changed, 23 insertions(+), 35 deletions(-)

--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -2152,42 +2152,30 @@ error_deref_obj:
 
 void intel_lr_context_resume(struct drm_i915_private *dev_priv)
 {
+	struct i915_gem_context *ctx = dev_priv->kernel_context;
 	struct intel_engine_cs *engine;
-	struct i915_gem_context *ctx;
 
-	/* Because we emit WA_TAIL_DWORDS there may be a disparity
-	 * between our bookkeeping in ce->ring->head and ce->ring->tail and
-	 * that stored in context. As we only write new commands from
-	 * ce->ring->tail onwards, everything before that is junk. If the GPU
-	 * starts reading from its RING_HEAD from the context, it may try to
-	 * execute that junk and die.
-	 *
-	 * So to avoid that we reset the context images upon resume. For
-	 * simplicity, we just zero everything out.
-	 */
-	list_for_each_entry(ctx, &dev_priv->context_list, link) {
-		for_each_engine(engine, dev_priv) {
-			struct intel_context *ce = &ctx->engine[engine->id];
-			u32 *reg;
-
-			if (!ce->state)
-				continue;
-
-			reg = i915_gem_object_pin_map(ce->state->obj,
-						      I915_MAP_WB);
-			if (WARN_ON(IS_ERR(reg)))
-				continue;
-
-			reg += LRC_STATE_PN * PAGE_SIZE / sizeof(*reg);
-			reg[CTX_RING_HEAD+1] = 0;
-			reg[CTX_RING_TAIL+1] = 0;
-
-			ce->state->obj->dirty = true;
-			i915_gem_object_unpin_map(ce->state->obj);
-
-			ce->ring->head = ce->ring->tail = 0;
-			ce->ring->last_retired_head = -1;
-			intel_ring_update_space(ce->ring);
-		}
+	for_each_engine(engine, dev_priv) {
+		struct intel_context *ce = &ctx->engine[engine->id];
+		void *vaddr;
+		uint32_t *reg_state;
+
+		if (!ce->state)
+			continue;
+
+		vaddr = i915_gem_object_pin_map(ce->state->obj, I915_MAP_WB);
+		if (WARN_ON(IS_ERR(vaddr)))
+			continue;
+
+		reg_state = vaddr + LRC_STATE_PN * PAGE_SIZE;
+
+		reg_state[CTX_RING_HEAD+1] = 0;
+		reg_state[CTX_RING_TAIL+1] = 0;
+
+		ce->state->obj->dirty = true;
+		i915_gem_object_unpin_map(ce->state->obj);
+
+		ce->ring->head = 0;
+		ce->ring->tail = 0;
 	}
 }


Patches currently in stable-queue which might be from gregkh@linuxfoundation.org are

queue-4.9/orangefs-fix-buffer-size-mis-match-between-kernel-space-and-user-space.patch
queue-4.9/rt2x00-fix-incorrect-usage-of-config_rt2x00_lib_usb.patch
queue-4.9/drm-i915-stop-using-rp_down_ei-on-baytrail.patch
queue-4.9/i2c-bcm2835-fix-hang-for-writing-messages-larger-than-16-bytes.patch
queue-4.9/orangefs-fix-memory-leak-of-string-new-on-exit-path.patch
queue-4.9/orangefs-dan-carpenter-influenced-cleanups.patch
queue-4.9/crypto-caam-fix-invalid-dereference-in-caam_rsa_init_tfm.patch
queue-4.9/drm-i915-nuke-debug-messages-from-the-pipe-update-critical-section.patch
queue-4.9/drm-i915-only-enable-hotplug-interrupts-if-the-display-interrupts-are-enabled.patch
queue-4.9/mips-switch-to-the-irq_stack-in-interrupts.patch
queue-4.9/mips-select-have_irq_exit_on_irq_stack.patch
queue-4.9/crypto-caam-fix-rng-deinstantiation-error-checking.patch
queue-4.9/drm-i915-gen9-increase-pcode-request-timeout-to-50ms.patch
queue-4.9/drm-i915-avoid-tweaking-evaluation-thresholds-on-baytrail-v3.patch
queue-4.9/rt2x00usb-fix-anchor-initialization.patch
queue-4.9/mips-only-change-28-to-thread_info-if-coming-from-user-mode.patch
queue-4.9/drm-i915-avoid-rcu_barrier-from-reclaim-paths-shrinker.patch
queue-4.9/mtd-bcm47xxpart-fix-parsing-first-block-after-aligned-trx.patch
queue-4.9/rt2x00usb-do-not-anchor-rx-and-tx-urb-s.patch
queue-4.9/mips-stack-unwinding-while-on-irq-stack.patch
queue-4.9/revert-drm-i915-execlists-reset-ring-registers-upon-resume.patch
queue-4.9/drm-i915-drop-support-for-i915_exec_constants_-execbuf-parameters.patch
queue-4.9/mips-irq-stack-fix-erroneous-jal-to-plat_irq_dispatch.patch
queue-4.9/mips-introduce-irq_stack.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-12 13:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-12 13:54 Patch "[PATCH] Revert "drm/i915/execlists: Reset RING registers upon resume"" has been added to the 4.9-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.