linux/drivers/gpu/drm/omapdrm
Tomi Valkeinen 7439507f01 drm/omap: fix race conditon in DMM
The omapdrm DMM code sometimes crashes with:

WARNING: CPU: 0 PID: 1235 at lib/list_debug.c:36 __list_add+0x8c/0xbc()
list_add double add: new=e9265368, prev=e90139c4, next=e9265368.

This is caused by the code calling release_engine() twice for the same
engine.

dmm_txn_commit(wait=true) call is supposed to wait until the DMM
transaction has been finished. And it does that, but it does not wait
for the irq handler to finish.

What happens is that the irq handler is triggered, and it either wakes
up the thread that called dmm_txn_commit(), or that thread never even
slept because the transaction was finished in the HW very quickly. That
thread then continues executing, even if the irq handler is not yet
finished, and a new transaction may be initiated. If that transaction is
async (i.e. wait=false), a 'async' flag is set to true. The original irq
handler, which has yet not finished, then sees the transaction as
'async', even if it was supposed to be 'sync'.

When that happens, the irq handler does an extra release_engine() call
because it thinks it need to release the engine, leading to the crash.

This patch fixes the issue by using completion to ensure that the irq
handler has finished before a dmm_txn_commit(wait=true) may continue.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-03-24 13:50:59 +02:00
..
Kconfig drm: Add separate Kconfig option for fbdev helpers 2013-10-11 23:36:58 +02:00
Makefile drm/omap: kill omap_gem_helpers.c 2013-08-19 10:36:16 +10:00
omap_connector.c drm: omapdrm: Remove manual update display support 2015-03-20 14:30:19 +02:00
omap_crtc.c drm/omap: only ignore DIGIT SYNC LOST for TV output 2015-03-24 13:50:58 +02:00
omap_debugfs.c drm: store the gem vma offset manager in a typed pointer 2014-01-14 12:38:32 +10:00
omap_dmm_priv.h drm/omap: fix race conditon in DMM 2015-03-24 13:50:59 +02:00
omap_dmm_tiler.c drm/omap: fix race conditon in DMM 2015-03-24 13:50:59 +02:00
omap_dmm_tiler.h drm/omap: fix TILER on OMAP5 2015-03-24 13:50:55 +02:00
omap_drv.c drm/omap: fix race condition with dev->obj_list 2015-03-24 13:50:58 +02:00
omap_drv.h drm/omap: fix race condition with dev->obj_list 2015-03-24 13:50:58 +02:00
omap_encoder.c drm/omap: Add infoframe & dvi/hdmi mode support 2014-07-04 11:17:59 +03:00
omap_fb.c drm/omap: handle incompatible buffer stride and pixel size 2015-03-24 13:50:55 +02:00
omap_fbdev.c drm: omapdrm: Remove manual update display support 2015-03-20 14:30:19 +02:00
omap_gem.c drm/omap: fix race condition with dev->obj_list 2015-03-24 13:50:58 +02:00
omap_gem_dmabuf.c drm: omapdrm: Fix indentation of structure and array initializers 2015-03-20 14:30:15 +02:00
omap_irq.c drm/omap: do not use BUG_ON(!spin_is_locked(x)) 2015-03-24 13:50:58 +02:00
omap_plane.c drm/omap: use DRM_ERROR_RATELIMITED() for error irqs 2015-03-24 13:50:57 +02:00
tcm-sita.c
tcm-sita.h
tcm.h
TODO