Skip to content

Commit 6ef98ea

Browse files
committed
drm/i915: Only start with the fake-irq timer if interrupts are dead
As a backup to waiting on a user-interrupt from the GPU, we use a heavy and frequent timer to wake up the waiting process should we detect an inconsistency whilst waiting. After seeing a "missed interrupt", the next time we wait, we restart the heavy timer. This patch is more reluctant to restart the timer and will only do so if we have not see any interrupts since when we started the fake irq timer. If we are seeing interrupts, then the waiters are being woken normally and we had an incoherency that caused to miss last time - that is unlikely to reoccur and so taking the risk of stalling again seems pragmatic. Signed-off-by: Chris Wilson <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Cc: Mika Kuoppala <[email protected]> Reviewed-by: Tvrtko Ursulin <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 8998567 commit 6ef98ea

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

drivers/gpu/drm/i915/intel_breadcrumbs.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,23 @@ static void irq_disable(struct intel_engine_cs *engine)
107107
spin_unlock(&engine->i915->irq_lock);
108108
}
109109

110+
static bool use_fake_irq(const struct intel_breadcrumbs *b)
111+
{
112+
const struct intel_engine_cs *engine =
113+
container_of(b, struct intel_engine_cs, breadcrumbs);
114+
115+
if (!test_bit(engine->id, &engine->i915->gpu_error.missed_irq_rings))
116+
return false;
117+
118+
/* Only start with the heavy weight fake irq timer if we have not
119+
* seen any interrupts since enabling it the first time. If the
120+
* interrupts are still arriving, it means we made a mistake in our
121+
* engine->seqno_barrier(), a timing error that should be transient
122+
* and unlikely to reoccur.
123+
*/
124+
return atomic_read(&engine->irq_count) == b->hangcheck_interrupts;
125+
}
126+
110127
static void __intel_breadcrumbs_enable_irq(struct intel_breadcrumbs *b)
111128
{
112129
struct intel_engine_cs *engine =
@@ -144,8 +161,7 @@ static void __intel_breadcrumbs_enable_irq(struct intel_breadcrumbs *b)
144161
b->irq_enabled = true;
145162
}
146163

147-
if (!b->irq_enabled ||
148-
test_bit(engine->id, &i915->gpu_error.missed_irq_rings)) {
164+
if (!b->irq_enabled || use_fake_irq(b)) {
149165
mod_timer(&b->fake_irq, jiffies + 1);
150166
i915_queue_hangcheck(i915);
151167
} else {

0 commit comments

Comments
 (0)