nouveau/gsp/r535: remove a stray unlock in r535_gsp_rpc_send()

Message ID a0293812-c05d-45f0-a535-3f24fe582c02@moroto.mountain
State New
Headers
Series nouveau/gsp/r535: remove a stray unlock in r535_gsp_rpc_send() |

Commit Message

Dan Carpenter Nov. 27, 2023, 12:56 p.m. UTC
  This unlock doesn't belong here and it leads to a double unlock in
the caller, r535_gsp_rpc_push().

Fixes: 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Comments

Timur Tabi Nov. 27, 2023, 8:05 p.m. UTC | #1
On Mon, 2023-11-27 at 15:56 +0300, Dan Carpenter wrote:
> This unlock doesn't belong here and it leads to a double unlock in
> the caller, r535_gsp_rpc_push().
> 
> Fixes: 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-
> RM")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Nice catch!

Reviewed-by: Timur Tabi <ttabi@nvidia.com>
  
Danilo Krummrich Nov. 29, 2023, 2:09 a.m. UTC | #2
On 11/27/23 13:56, Dan Carpenter wrote:
> This unlock doesn't belong here and it leads to a double unlock in
> the caller, r535_gsp_rpc_push().
> 
> Fixes: 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Good catch - applied to drm-misc-fixes.

- Danilo

> ---
>   drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
> index dc44f5c7833f..818e5c73b7a6 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
> @@ -365,10 +365,8 @@ r535_gsp_rpc_send(struct nvkm_gsp *gsp, void *argv, bool wait, u32 repc)
>   	}
>   
>   	ret = r535_gsp_cmdq_push(gsp, rpc);
> -	if (ret) {
> -		mutex_unlock(&gsp->cmdq.mutex);
> +	if (ret)
>   		return ERR_PTR(ret);
> -	}
>   
>   	if (wait) {
>   		msg = r535_gsp_msg_recv(gsp, fn, repc);
  

Patch

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
index dc44f5c7833f..818e5c73b7a6 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
@@ -365,10 +365,8 @@  r535_gsp_rpc_send(struct nvkm_gsp *gsp, void *argv, bool wait, u32 repc)
 	}
 
 	ret = r535_gsp_cmdq_push(gsp, rpc);
-	if (ret) {
-		mutex_unlock(&gsp->cmdq.mutex);
+	if (ret)
 		return ERR_PTR(ret);
-	}
 
 	if (wait) {
 		msg = r535_gsp_msg_recv(gsp, fn, repc);