All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] drm/i915: Order assert forcewake test
@ 2019-07-05  7:45 Chris Wilson
  2019-07-05  7:45 ` [PATCH 2/8] drm/i915: Teach execbuffer to take the engine wakeref not GT Chris Wilson
                   ` (11 more replies)
  0 siblings, 12 replies; 16+ messages in thread
From: Chris Wilson @ 2019-07-05  7:45 UTC (permalink / raw)
  To: intel-gfx

Read the current value before computing the expected to ensure that if
the timer does complete early (against our will), it should not cause a
false positive.

v2: The local irq disable did not prevent the timer from running.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 2042c94c9cc9..bb9e0da30e94 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -758,19 +758,18 @@ void assert_forcewakes_active(struct intel_uncore *uncore,
 	 * Check that the caller has an explicit wakeref and we don't mistake
 	 * it for the auto wakeref.
 	 */
-	local_irq_disable();
 	for_each_fw_domain_masked(domain, fw_domains, uncore, tmp) {
+		unsigned int actual = READ_ONCE(domain->wake_count);
 		unsigned int expect = 1;
 
 		if (hrtimer_active(&domain->timer) && READ_ONCE(domain->active))
 			expect++; /* pending automatic release */
 
-		if (WARN(domain->wake_count < expect,
+		if (WARN(actual < expect,
 			 "Expected domain %d to be held awake by caller, count=%d\n",
-			 domain->id, domain->wake_count))
+			 domain->id, actual))
 			break;
 	}
-	local_irq_enable();
 }
 
 /* We give fast paths for the really cool registers */
-- 
2.20.1

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

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

end of thread, other threads:[~2019-07-09  8:15 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-05  7:45 [PATCH 1/8] drm/i915: Order assert forcewake test Chris Wilson
2019-07-05  7:45 ` [PATCH 2/8] drm/i915: Teach execbuffer to take the engine wakeref not GT Chris Wilson
2019-07-05  7:45 ` [PATCH 3/8] drm/i915/gt: Track timeline activeness in enter/exit Chris Wilson
2019-07-05  7:46 ` [PATCH 4/8] drm/i915/gt: Convert timeline tracking to spinlock Chris Wilson
2019-07-05  7:46 ` [PATCH 5/8] drm/i915/gt: Guard timeline pinning with its own mutex Chris Wilson
2019-07-05  7:46 ` [PATCH 6/8] drm/i915: Protect request retirement with timeline->mutex Chris Wilson
2019-07-05  7:46 ` [PATCH 7/8] drm/i915: Replace struct_mutex for batch pool serialisation Chris Wilson
2019-07-05  7:46 ` [PATCH 8/8] drm/i915/gt: Use intel_gt as the primary object for handling resets Chris Wilson
2019-07-08 22:48   ` Daniele Ceraolo Spurio
2019-07-09  8:11     ` Chris Wilson
2019-07-09  8:15     ` Chris Wilson
2019-07-05  9:53 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/8] drm/i915: Order assert forcewake test Patchwork
2019-07-05  9:57 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-07-05 10:16 ` ✓ Fi.CI.BAT: success " Patchwork
2019-07-05 10:36 ` [PATCH 1/8] " Chris Wilson
2019-07-06 12:54 ` ✓ Fi.CI.IGT: success for series starting with [1/8] " Patchwork

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.