All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/i915: Stop second guessing the caller for intel_uncore_wait_for_register()
@ 2017-04-10 15:02 Chris Wilson
  2017-04-10 15:02 ` [PATCH 2/3] drm/i915: Stop sleeping from inside gen6_bsd_submit_request() Chris Wilson
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Chris Wilson @ 2017-04-10 15:02 UTC (permalink / raw)
  To: intel-gfx

Allow the caller to use the fast_timeout_us to specify how long to wait
within the atomic section, rather than transparently switching to a
sleeping loop for larger values. This is required as some callsites may
need a long wait and are in an atomic section.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index eb38392a2435..53c8457869f6 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -1601,7 +1601,7 @@ static int gen6_reset_engines(struct drm_i915_private *dev_priv,
  *
  * Otherwise, the wait will timeout after @slow_timeout_ms milliseconds.
  * For atomic context @slow_timeout_ms must be zero and @fast_timeout_us
- * must be not larger than 10 microseconds.
+ * must be not larger than 20,0000 microseconds.
  *
  * Note that this routine assumes the caller holds forcewake asserted, it is
  * not suitable for very long waits. See intel_wait_for_register() if you
@@ -1623,16 +1623,17 @@ int __intel_wait_for_register_fw(struct drm_i915_private *dev_priv,
 	int ret;
 
 	/* Catch any overuse of this function */
-	might_sleep_if(fast_timeout_us > 10 || slow_timeout_ms);
+	might_sleep_if(slow_timeout_ms);
 
-	if (fast_timeout_us > 10)
-		ret = _wait_for(done, fast_timeout_us, 10);
-	else
+	ret = -ETIMEDOUT;
+	if (fast_timeout_us && fast_timeout_us < 20000)
 		ret = _wait_for_atomic(done, fast_timeout_us, 0);
 	if (ret)
 		ret = wait_for(done, slow_timeout_ms);
+
 	if (out_value)
 		*out_value = reg_value;
+
 	return ret;
 #undef done
 }
-- 
2.11.0

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

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

end of thread, other threads:[~2017-04-11  8:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-10 15:02 [PATCH 1/3] drm/i915: Stop second guessing the caller for intel_uncore_wait_for_register() Chris Wilson
2017-04-10 15:02 ` [PATCH 2/3] drm/i915: Stop sleeping from inside gen6_bsd_submit_request() Chris Wilson
2017-04-10 15:23   ` Michal Wajdeczko
2017-04-10 15:31     ` Chris Wilson
2017-04-10 15:02 ` [PATCH 3/3] drm/i915: Acquire uncore.lock over intel_uncore_wait_for_register() Chris Wilson
2017-04-10 15:26   ` Michal Wajdeczko
2017-04-10 15:55     ` [PATCH v2] " Chris Wilson
2017-04-10 16:03       ` Michal Wajdeczko
2017-04-10 15:20 ` [PATCH 1/3] drm/i915: Stop second guessing the caller for intel_uncore_wait_for_register() Michal Wajdeczko
2017-04-10 15:25   ` Chris Wilson
2017-04-10 15:24 ` ✓ Fi.CI.BAT: success for series starting with [1/3] " Patchwork
2017-04-10 16:23 ` ✗ Fi.CI.BAT: warning for series starting with [1/3] drm/i915: Stop second guessing the caller for intel_uncore_wait_for_register() (rev2) Patchwork
2017-04-11  8:39   ` 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.