Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tursulin@ursulin.net>
To: Intel-gfx@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, "Paneri,
	Praveen" <praveen.paneri@intel.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	"v4 . 10+" <stable@vger.kernel.org>
Subject: [PATCH v2] drm/i915: Fix forcewake active domain tracking
Date: Fri, 10 Mar 2017 07:32:51 +0000	[thread overview]
Message-ID: <20170310073251.31179-1-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <20170309211216.GF28427@nuc-i3427.alporthouse.com>

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

In commit 003342a50021 ("drm/i915: Keep track of active
forcewake domains in a bitmask") I forgot to adjust the
newly introduce fw_domains_active state across reset.

This caused the assert_forcewakes_inactive to trigger
during suspend and resume if there were user held
forcewakes.

v2: Bitmask checks are required since vfuncs are not
    always present.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Fixes: 003342a50021 ("drm/i915: Keep track of active forcewake domains in a bitmask")
Testcase: igt/drv_suspend/forcewake
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: "Paneri, Praveen" <praveen.paneri@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Cc: v4.10+ <stable@vger.kernel.org>
---
 drivers/gpu/drm/i915/intel_uncore.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 2a3f35c30501..7efae77faca0 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -304,12 +304,14 @@ static void intel_uncore_forcewake_reset(struct drm_i915_private *dev_priv,
 	fw = dev_priv->uncore.fw_domains_active;
 	if (fw)
 		dev_priv->uncore.funcs.force_wake_put(dev_priv, fw);
+	dev_priv->uncore.fw_domains_active = 0;
 
 	fw_domains_reset(dev_priv, FORCEWAKE_ALL);
 
 	if (restore) { /* If reset with a user forcewake, try to restore */
 		if (fw)
 			dev_priv->uncore.funcs.force_wake_get(dev_priv, fw);
+		dev_priv->uncore.fw_domains_active = fw;
 
 		if (IS_GEN6(dev_priv) || IS_GEN7(dev_priv))
 			dev_priv->uncore.fifo_count =
-- 
2.9.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-03-10  7:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-09 15:52 [PATCH] drm/i915: Fix forcewake active domain tracking Tvrtko Ursulin
2017-03-09 19:23 ` ✗ Fi.CI.BAT: failure for " Patchwork
2017-03-09 20:48   ` Chris Wilson
2017-03-09 21:12 ` [PATCH] " Chris Wilson
2017-03-10  7:32   ` Tvrtko Ursulin [this message]
2017-03-10  8:50     ` [PATCH v2] " Chris Wilson
2017-03-10  9:09       ` Tvrtko Ursulin
2017-03-10  9:32         ` [PATCH v3] " Tvrtko Ursulin
2017-03-10 10:54           ` Chris Wilson
2017-03-10 11:51             ` Tvrtko Ursulin
2017-03-10  9:22 ` ✓ Fi.CI.BAT: success for drm/i915: Fix forcewake active domain tracking (rev2) Patchwork
2017-03-10 10:47 ` ✓ Fi.CI.BAT: success for drm/i915: Fix forcewake active domain tracking (rev4) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170310073251.31179-1-tvrtko.ursulin@linux.intel.com \
    --to=tursulin@ursulin.net \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=daniel.vetter@intel.com \
    --cc=praveen.paneri@intel.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox