Skip to contentSkip to conversation

Patch "drm/i915: Fix forcewake active domain tracking" has been added to the 4.10-stable tree

PATCH [email protected] 1 participant 1 message Apr 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: Fix forcewake active domain tracking

to the 4.10-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-fix-forcewake-active-domain-tracking.patch
and it can be found in the queue-4.10 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 6aef660370a9c246956ba6d01eebd8063c4214cb Mon Sep 17 00:00:00 2001

From: Tvrtko Ursulin <[email protected]>
Date: Fri, 10 Mar 2017 09:32:49 +0000
Subject: drm/i915: Fix forcewake active domain tracking

From: Tvrtko Ursulin <[email protected]>

commit 6aef660370a9c246956ba6d01eebd8063c4214cb upstream.

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.

v3: Move bitmask tracking to get/put vfunc for simplicity.
(Chris Wilson)

Fixes 003342a50021 ("drm/i915: Keep track of active forcewake domains in a bitmask")

Testcase: igt/drv_suspend/forcewake

Cc Tvrtko Ursulin <[email protected]>
Cc "Paneri, Praveen" <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
(cherry picked from commit b8473050805f35add97f3ff57570d55a01808df5)
---
 drivers/gpu/drm/i915/intel_uncore.c |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +6 -7
@@ -119,6 +119,8 @@ fw_domains_get(struct drm_i915_private *
 
 	for_each_fw_domain_masked(d, fw_domains, dev_priv)
 		fw_domain_wait_ack(d);
+
+	dev_priv->uncore.fw_domains_active |= fw_domains;
 }
 
 static void
@@ -130,6 +132,8 @@ fw_domains_put(struct drm_i915_private *
 		fw_domain_put(d);
 		fw_domain_posting_read(d);
 	}
+
+	dev_priv->uncore.fw_domains_active &= ~fw_domains;
 }
 
 static void
@@ -240,10 +244,8 @@ intel_uncore_fw_release_timer(struct hrt
 	if (WARN_ON(domain->wake_count == 0))
 		domain->wake_count++;
 
-	if (--domain->wake_count == 0) {
+	if (--domain->wake_count == 0)
 		dev_priv->uncore.funcs.force_wake_put(dev_priv, domain->mask);
-		dev_priv->uncore.fw_domains_active &= ~domain->mask;
-	}
 
 	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
 
@@ -455,10 +457,8 @@ static void __intel_uncore_forcewake_get
 			fw_domains &= ~domain->mask;
 	}
 
-	if (fw_domains) {
+	if (fw_domains)
 		dev_priv->uncore.funcs.force_wake_get(dev_priv, fw_domains);
-		dev_priv->uncore.fw_domains_active |= fw_domains;
-	}
 }
 
 /**
@@ -962,7 +962,6 @@ static noinline void ___force_wake_auto(
 		fw_domain_arm_timer(domain);
 
 	dev_priv->uncore.funcs.force_wake_get(dev_priv, fw_domains);
-	dev_priv->uncore.fw_domains_active |= fw_domains;
 }
 
 static inline void __force_wake_auto(struct drm_i915_private *dev_priv,

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

queue-4.10/drm-i915-gen9-increase-pcode-request-timeout-to-50ms.patch queue-4.10/drm-i915-fix-forcewake-active-domain-tracking.patch