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 e78d73b16bcde921c9cf458d2e4de8e4fc2518f3.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30073
Reported-and-tested-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

+15 -7
+15 -7
drivers/gpu/drm/i915/i915_irq.c
··· 1350 1350 i915_seqno_passed(i915_get_gem_seqno(dev, 1351 1351 &dev_priv->render_ring), 1352 1352 i915_get_tail_request(dev)->seqno)) { 1353 + bool missed_wakeup = false; 1354 + 1353 1355 dev_priv->hangcheck_count = 0; 1354 1356 1355 1357 /* Issue a wake-up to catch stuck h/w. */ 1356 - if (dev_priv->render_ring.waiting_gem_seqno | 1357 - dev_priv->bsd_ring.waiting_gem_seqno) { 1358 - DRM_ERROR("Hangcheck timer elapsed... GPU idle, missed IRQ.\n"); 1359 - if (dev_priv->render_ring.waiting_gem_seqno) 1360 - DRM_WAKEUP(&dev_priv->render_ring.irq_queue); 1361 - if (dev_priv->bsd_ring.waiting_gem_seqno) 1362 - DRM_WAKEUP(&dev_priv->bsd_ring.irq_queue); 1358 + if (dev_priv->render_ring.waiting_gem_seqno && 1359 + waitqueue_active(&dev_priv->render_ring.irq_queue)) { 1360 + DRM_WAKEUP(&dev_priv->render_ring.irq_queue); 1361 + missed_wakeup = true; 1363 1362 } 1363 + 1364 + if (dev_priv->bsd_ring.waiting_gem_seqno && 1365 + waitqueue_active(&dev_priv->bsd_ring.irq_queue)) { 1366 + DRM_WAKEUP(&dev_priv->bsd_ring.irq_queue); 1367 + missed_wakeup = true; 1368 + } 1369 + 1370 + if (missed_wakeup) 1371 + DRM_ERROR("Hangcheck timer elapsed... GPU idle, missed IRQ.\n"); 1364 1372 return; 1365 1373 } 1366 1374