Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7839d956 authored by Chris Wilson's avatar Chris Wilson
Browse files

drm/i915: Double check that the wait_request is not pending before warning

If we are busy, then we may have woken up the wait_request handler but
not yet serviced it before the hang check fires. So in hang check,
double check that the i915_gem_do_wait_request() is still pending the
wake-up before declaring all hope lost.

Fixes regression with e78d73b1.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30073


Reported-and-tested-by: default avatarSitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent c3add4b6
Loading
Loading
Loading
Loading
+15 −7
Original line number Diff line number Diff line
@@ -1350,17 +1350,25 @@ void i915_hangcheck_elapsed(unsigned long data)
		i915_seqno_passed(i915_get_gem_seqno(dev,
				&dev_priv->render_ring),
			i915_get_tail_request(dev)->seqno)) {
		bool missed_wakeup = false;

		dev_priv->hangcheck_count = 0;

		/* Issue a wake-up to catch stuck h/w. */
		if (dev_priv->render_ring.waiting_gem_seqno |
		    dev_priv->bsd_ring.waiting_gem_seqno) {
			DRM_ERROR("Hangcheck timer elapsed... GPU idle, missed IRQ.\n");
			if (dev_priv->render_ring.waiting_gem_seqno)
		if (dev_priv->render_ring.waiting_gem_seqno &&
		    waitqueue_active(&dev_priv->render_ring.irq_queue)) {
			DRM_WAKEUP(&dev_priv->render_ring.irq_queue);
			if (dev_priv->bsd_ring.waiting_gem_seqno)
			missed_wakeup = true;
		}

		if (dev_priv->bsd_ring.waiting_gem_seqno &&
		    waitqueue_active(&dev_priv->bsd_ring.irq_queue)) {
			DRM_WAKEUP(&dev_priv->bsd_ring.irq_queue);
			missed_wakeup = true;
		}

		if (missed_wakeup)
			DRM_ERROR("Hangcheck timer elapsed... GPU idle, missed IRQ.\n");
		return;
	}