Skip to content

Commit

Permalink
drm/etnaviv: add lockdep assert to fence allocation
Browse files Browse the repository at this point in the history
Make sure the GPU lock is taken, so that fence completion order matches
seqno order.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
  • Loading branch information
Lucas Stach committed Mar 29, 2017
1 parent 65d1086 commit b27734c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/etnaviv/etnaviv_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,12 @@ static struct dma_fence *etnaviv_gpu_fence_alloc(struct etnaviv_gpu *gpu)
{
struct etnaviv_fence *f;

/*
* GPU lock must already be held, otherwise fence completion order might
* not match the seqno order assigned here.
*/
lockdep_assert_held(&gpu->lock);

f = kzalloc(sizeof(*f), GFP_KERNEL);
if (!f)
return NULL;
Expand Down

0 comments on commit b27734c

Please sign in to comment.