Blob Blame History Raw
From: Lucas Stach <l.stach@pengutronix.de>
Date: Fri, 17 Nov 2017 17:59:26 +0100
Subject: drm/etnaviv: hold GPU lock while inserting END command
Git-commit: 40c27bdeb00ba234d5062b7c51467a9a51c4606c
Patch-mainline: v4.16-rc1
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166

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>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c |    2 ++
 1 file changed, 2 insertions(+)

--- 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
 {
 	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