summary refs log tree commit diff
path: root/drivers/gpu/drm/etnaviv
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2017-11-17 17:59:26 +0100
committerLucas Stach <l.stach@pengutronix.de>2018-01-02 17:25:11 +0100
commit40c27bdeb00ba234d5062b7c51467a9a51c4606c (patch)
treec8f769b6e7d7920976a86d1894f321bc36dafaeb /drivers/gpu/drm/etnaviv
parenta7790d78092e5904beb4de71e1ea43b260d2092a (diff)
downloadlinux-40c27bdeb00ba234d5062b7c51467a9a51c4606c.tar.gz
drm/etnaviv: hold GPU lock while inserting END command
Inserting the END command when suspending the GPU is changing the
command buffer state, which requires the GPU to be held.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/etnaviv')
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_gpu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 6176704bdae3..c4f518d56ead 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -1631,7 +1631,9 @@ static int etnaviv_gpu_hw_suspend(struct etnaviv_gpu *gpu)
 {
 	if (gpu->buffer) {
 		/* Replace the last WAIT with END */
+		mutex_lock(&gpu->lock);
 		etnaviv_buffer_end(gpu);
+		mutex_unlock(&gpu->lock);
 
 		/*
 		 * We know that only the FE is busy here, this should