diff mbox

[12/27] drm/etnaviv: hold GPU lock while inserting END command

Message ID 20171201103624.6565-13-l.stach@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Lucas Stach Dec. 1, 2017, 10:36 a.m. UTC
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>
---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Philipp Zabel Dec. 1, 2017, 4:43 p.m. UTC | #1
On Fri, 2017-12-01 at 11:36 +0100, Lucas Stach wrote:
> 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>

regards
Philipp
Christian Gmeiner Dec. 11, 2017, 10:48 a.m. UTC | #2
2017-12-01 11:36 GMT+01:00 Lucas Stach <l.stach@pengutronix.de>:
> 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: Christian Gmeiner <christian.gmeiner@gmail.com>

> ---
>  drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> index 1e1e34adb07f..85f6ee1da016 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
> --
> 2.11.0
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 1e1e34adb07f..85f6ee1da016 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