Skip to content

Commit

Permalink
drm/omap: tiler: fix race condition with engine->async
Browse files Browse the repository at this point in the history
The tiler irq handler uses engine->async value, but the code that sets
engine->async and enables the interrupt does not have a barrier. This
may cause the irq handler to see the old value of engine->async, causing
memory corruption.

Reported-by: Harinarayan Bhatta <harinarayan@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
  • Loading branch information
Tomi Valkeinen committed Mar 24, 2015
1 parent 2dd3887 commit e7e24df
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ static int dmm_txn_commit(struct dmm_txn *txn, bool wait)

/* mark whether it is async to denote list management in IRQ handler */
engine->async = wait ? false : true;
/* verify that the irq handler sees the 'async' value */
smp_mb();

/* kick reload */
writel(engine->refill_pa,
Expand Down

0 comments on commit e7e24df

Please sign in to comment.