]> git.karo-electronics.de Git - karo-tx-linux.git/commit
drm/i915: fix up semaphore_waits_for
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 14 Mar 2014 23:08:55 +0000 (00:08 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 28 Mar 2014 17:25:18 +0000 (18:25 +0100)
commit88fe429db0d3866ecc355c2b72056690b0ce8f57
tree10dd0def65d63839a771c157cbbe6b2e583bf85c
parent4da98541d898d45255edf874b16687aad0ff90cd
drm/i915: fix up semaphore_waits_for

There's an entire pile of issues in here:

- Use the main RING_HEAD register, not ACTHD. ACTHD points at the gtt
  offset of the batch buffer when a batch is executed. Semaphores are
  always emitted to the main ring, so we always want to look at that.

- Mask the obtained HEAD pointer with the actual ring size, which is
  much smaller. Together with the above issue this resulted us in
  trying to dereference a pointer way outside of the ring mmio
  mapping. The resulting invalid access in interrupt context
  (hangcheck is executed from timers) lead to a full blown kernel
  panic. The fbcon panic handler then tried to frob our driver harder,
  resulting in a full machine hang at least on my snb here where I've
  stumbled over this.

- Handle ring wrapping correctly and be a bit more explicit about how
  many dwords we're scanning. We probably should also scan more than
  just 4 ...

- Space out some of teh computations for readability.

This reduces hard-hangs on my snb here. Mika and QA both say that it
doesn't completel remove them, but at least for me it's a clear
improvement in stability.

Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Ben Widawsky <ben@bwidawsk.net>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
References: https://bugs.freedesktop.org/show_bug.cgi?id=74100
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_irq.c