* [PATCH] drm/i915: Run hangcheck if we timeout whilst waiting for a seqno
@ 2013-01-22 11:53 Chris Wilson
2013-01-22 12:18 ` Chris Wilson
0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2013-01-22 11:53 UTC (permalink / raw)
To: intel-gfx
As a precaution against the driver fouling up and missing a hang leaving
the caller in an indefinite wait, manually inspect for a GPU hang if we
timeout whilst waiting for a seqno.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 0d878c1..54bb921 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1129,6 +1129,9 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
else
end = wait_event_timeout(ring->irq_queue, EXIT_COND,
timeout_jiffies);
+ /* Be paranoid and check that we haven't missed a GPU hang */
+ if (end == 0)
+ i915_hangcheck_elapsed((unsigned long)dev_priv->dev);
/* We need to check whether any gpu reset happened in between
* the caller grabbing the seqno and now ... */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] drm/i915: Run hangcheck if we timeout whilst waiting for a seqno
2013-01-22 11:53 [PATCH] drm/i915: Run hangcheck if we timeout whilst waiting for a seqno Chris Wilson
@ 2013-01-22 12:18 ` Chris Wilson
0 siblings, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2013-01-22 12:18 UTC (permalink / raw)
To: intel-gfx
As a precaution against the driver fouling up and missing a hang leaving
the caller in an indefinite wait, manually inspect for a GPU hang if we
timeout whilst waiting for a seqno.
v2: To avoid issues with multiple clients running hangchecks
concurrently or in very rapid succession, make sure we only reactivate
the hangcheck timer if we find it idle whilst waiting.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 0d878c1..dc382eb 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1096,7 +1096,6 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
struct timespec before, now, wait_time={1,0};
unsigned long timeout_jiffies;
long end;
- bool wait_forever = true;
int ret;
if (i915_seqno_passed(ring->get_seqno(ring, true), seqno))
@@ -1104,10 +1103,8 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
trace_i915_gem_request_wait_begin(ring, seqno);
- if (timeout != NULL) {
+ if (timeout != NULL)
wait_time = *timeout;
- wait_forever = false;
- }
timeout_jiffies = timespec_to_jiffies(&wait_time);
@@ -1129,6 +1126,12 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
else
end = wait_event_timeout(ring->irq_queue, EXIT_COND,
timeout_jiffies);
+ /* Be paranoid and check that we haven't missed a GPU hang */
+ if (end == 0 &&
+ i915_enable_hangcheck &&
+ !timer_pending(&dev_priv->gpu_error.hangcheck_timer))
+ mod_timer(&dev_priv->gpu_error.hangcheck_timer,
+ round_jiffies_up(jiffies + DRM_I915_HANGCHECK_JIFFIES));
/* We need to check whether any gpu reset happened in between
* the caller grabbing the seqno and now ... */
@@ -1140,7 +1143,7 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
ret = i915_gem_check_wedge(&dev_priv->gpu_error, interruptible);
if (ret)
end = ret;
- } while (end == 0 && wait_forever);
+ } while (end == 0 && timeout == NULL);
getrawmonotonic(&now);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] drm/i915: Run hangcheck if we timeout whilst waiting for a seqno
@ 2012-10-09 12:29 Chris Wilson
0 siblings, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2012-10-09 12:29 UTC (permalink / raw)
To: intel-gfx
As a precaution against the driver fouling up and missing a hang leaving
the caller in an indefinite wait, manually inspect for a GPU hang if we
timeout whilst waiting for a seqno.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d11c489..74b59f9 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1154,6 +1154,9 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
end = wait_event_timeout(ring->irq_queue, EXIT_COND,
timeout_jiffies);
+ /* Be paranoid and check that we haven't missed a GPU hang */
+ if (end == 0)
+ i915_hangcheck_elapsed((unsigned long)dev_priv->dev);
ret = i915_gem_check_wedge(dev_priv, interruptible);
if (ret)
end = ret;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-01-22 12:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-22 11:53 [PATCH] drm/i915: Run hangcheck if we timeout whilst waiting for a seqno Chris Wilson
2013-01-22 12:18 ` Chris Wilson
-- strict thread matches above, loose matches on Subject: below --
2012-10-09 12:29 Chris Wilson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).