All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Only arm the forcewake release timer on the final put
@ 2016-03-24 13:32 Chris Wilson
  2016-03-24 13:42 ` Chris Wilson
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Chris Wilson @ 2016-03-24 13:32 UTC (permalink / raw)
  To: intel-gfx

If we arm the release timer on acquiring the forcewake, we will release
the forcewake on the jiffie afterwards. If we only arm the release timer
on the final put, we will release the forcewake slightly later instead.

Much, much worse, we did not acquire a refcount for the armed timing
during the get(), and so unbalanced our forcewake counting.

Reported-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 96799392c2c7..d857168c6c9b 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -60,6 +60,7 @@ fw_domain_reset(const struct intel_uncore_forcewake_domain *d)
 static inline void
 fw_domain_arm_timer(struct intel_uncore_forcewake_domain *d)
 {
+	d->wake_count++;
 	mod_timer_pinned(&d->timer, jiffies + 1);
 }
 
@@ -491,7 +492,6 @@ static void __intel_uncore_forcewake_put(struct drm_i915_private *dev_priv,
 		if (--domain->wake_count)
 			continue;
 
-		domain->wake_count++;
 		fw_domain_arm_timer(domain);
 	}
 }
@@ -733,7 +733,6 @@ static inline void __force_wake_get(struct drm_i915_private *dev_priv,
 		}
 
 		domain->wake_count++;
-		fw_domain_arm_timer(domain);
 	}
 
 	if (fw_domains)
-- 
2.8.0.rc3

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-03-24 15:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-24 13:32 [PATCH] drm/i915: Only arm the forcewake release timer on the final put Chris Wilson
2016-03-24 13:42 ` Chris Wilson
2016-03-24 13:54   ` Tvrtko Ursulin
2016-03-24 14:19     ` Chris Wilson
2016-03-24 14:30       ` Chris Wilson
2016-03-24 14:33   ` Dave Gordon
2016-03-24 14:55     ` Chris Wilson
2016-03-24 13:56 ` [PATCH v2] " Chris Wilson
2016-03-24 14:38 ` [PATCH] " Dave Gordon
2016-03-24 15:03 ` ✗ Fi.CI.BAT: failure for drm/i915: Only arm the forcewake release timer on the final put (rev2) Patchwork
2016-03-24 15:51   ` Chris Wilson

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.