All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: ti: k3-psil: fix deadlock on error path
@ 2020-04-08 18:55 ` Grygorii Strashko
  0 siblings, 0 replies; 6+ messages in thread
From: Grygorii Strashko @ 2020-04-08 18:55 UTC (permalink / raw)
  To: Vinod Koul, Dan Williams, Peter Ujfalusi, dmaengine
  Cc: Sekhar Nori, linux-kernel, Vignesh Raghavendra, linux-arm-kernel,
	Grygorii Strashko

The mutex_unlock() is missed on error path of psil_get_ep_config()
which causes deadlock, so add missed mutex_unlock().

Fixes: 8c6bb62f6b4a ("dmaengine: ti: k3 PSI-L remote endpoint configuration")
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 drivers/dma/ti/k3-psil.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/ti/k3-psil.c b/drivers/dma/ti/k3-psil.c
index d7b965049ccb..fb7c8150b0d1 100644
--- a/drivers/dma/ti/k3-psil.c
+++ b/drivers/dma/ti/k3-psil.c
@@ -27,6 +27,7 @@ struct psil_endpoint_config *psil_get_ep_config(u32 thread_id)
 			soc_ep_map = &j721e_ep_map;
 		} else {
 			pr_err("PSIL: No compatible machine found for map\n");
+			mutex_unlock(&ep_map_mutex);
 			return ERR_PTR(-ENOTSUPP);
 		}
 		pr_debug("%s: Using map for %s\n", __func__, soc_ep_map->name);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] dmaengine: ti: k3-psil: fix deadlock on error path
@ 2020-04-08 18:55 ` Grygorii Strashko
  0 siblings, 0 replies; 6+ messages in thread
From: Grygorii Strashko @ 2020-04-08 18:55 UTC (permalink / raw)
  To: Vinod Koul, Dan Williams, Peter Ujfalusi, dmaengine
  Cc: Grygorii Strashko, Sekhar Nori, linux-kernel, linux-arm-kernel,
	Vignesh Raghavendra

The mutex_unlock() is missed on error path of psil_get_ep_config()
which causes deadlock, so add missed mutex_unlock().

Fixes: 8c6bb62f6b4a ("dmaengine: ti: k3 PSI-L remote endpoint configuration")
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 drivers/dma/ti/k3-psil.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/ti/k3-psil.c b/drivers/dma/ti/k3-psil.c
index d7b965049ccb..fb7c8150b0d1 100644
--- a/drivers/dma/ti/k3-psil.c
+++ b/drivers/dma/ti/k3-psil.c
@@ -27,6 +27,7 @@ struct psil_endpoint_config *psil_get_ep_config(u32 thread_id)
 			soc_ep_map = &j721e_ep_map;
 		} else {
 			pr_err("PSIL: No compatible machine found for map\n");
+			mutex_unlock(&ep_map_mutex);
 			return ERR_PTR(-ENOTSUPP);
 		}
 		pr_debug("%s: Using map for %s\n", __func__, soc_ep_map->name);
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] dmaengine: ti: k3-psil: fix deadlock on error path
  2020-04-08 18:55 ` Grygorii Strashko
@ 2020-04-09  6:45   ` Peter Ujfalusi
  -1 siblings, 0 replies; 6+ messages in thread
From: Peter Ujfalusi @ 2020-04-09  6:45 UTC (permalink / raw)
  To: Grygorii Strashko, Vinod Koul, Dan Williams, dmaengine
  Cc: Sekhar Nori, linux-kernel, Vignesh Raghavendra, linux-arm-kernel



On 08/04/2020 21.55, Grygorii Strashko wrote:
> The mutex_unlock() is missed on error path of psil_get_ep_config()
> which causes deadlock, so add missed mutex_unlock().

Ah, you are right, thanks for catching it!

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> Fixes: 8c6bb62f6b4a ("dmaengine: ti: k3 PSI-L remote endpoint configuration")
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
> ---
>  drivers/dma/ti/k3-psil.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/dma/ti/k3-psil.c b/drivers/dma/ti/k3-psil.c
> index d7b965049ccb..fb7c8150b0d1 100644
> --- a/drivers/dma/ti/k3-psil.c
> +++ b/drivers/dma/ti/k3-psil.c
> @@ -27,6 +27,7 @@ struct psil_endpoint_config *psil_get_ep_config(u32 thread_id)
>  			soc_ep_map = &j721e_ep_map;
>  		} else {
>  			pr_err("PSIL: No compatible machine found for map\n");
> +			mutex_unlock(&ep_map_mutex);
>  			return ERR_PTR(-ENOTSUPP);
>  		}
>  		pr_debug("%s: Using map for %s\n", __func__, soc_ep_map->name);
> 

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dmaengine: ti: k3-psil: fix deadlock on error path
@ 2020-04-09  6:45   ` Peter Ujfalusi
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Ujfalusi @ 2020-04-09  6:45 UTC (permalink / raw)
  To: Grygorii Strashko, Vinod Koul, Dan Williams, dmaengine
  Cc: Sekhar Nori, linux-kernel, linux-arm-kernel, Vignesh Raghavendra



On 08/04/2020 21.55, Grygorii Strashko wrote:
> The mutex_unlock() is missed on error path of psil_get_ep_config()
> which causes deadlock, so add missed mutex_unlock().

Ah, you are right, thanks for catching it!

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> Fixes: 8c6bb62f6b4a ("dmaengine: ti: k3 PSI-L remote endpoint configuration")
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
> ---
>  drivers/dma/ti/k3-psil.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/dma/ti/k3-psil.c b/drivers/dma/ti/k3-psil.c
> index d7b965049ccb..fb7c8150b0d1 100644
> --- a/drivers/dma/ti/k3-psil.c
> +++ b/drivers/dma/ti/k3-psil.c
> @@ -27,6 +27,7 @@ struct psil_endpoint_config *psil_get_ep_config(u32 thread_id)
>  			soc_ep_map = &j721e_ep_map;
>  		} else {
>  			pr_err("PSIL: No compatible machine found for map\n");
> +			mutex_unlock(&ep_map_mutex);
>  			return ERR_PTR(-ENOTSUPP);
>  		}
>  		pr_debug("%s: Using map for %s\n", __func__, soc_ep_map->name);
> 

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dmaengine: ti: k3-psil: fix deadlock on error path
  2020-04-08 18:55 ` Grygorii Strashko
@ 2020-04-15 16:05   ` Vinod Koul
  -1 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2020-04-15 16:05 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: Dan Williams, Peter Ujfalusi, dmaengine, Sekhar Nori,
	linux-kernel, Vignesh Raghavendra, linux-arm-kernel

On 08-04-20, 21:55, Grygorii Strashko wrote:
> The mutex_unlock() is missed on error path of psil_get_ep_config()
> which causes deadlock, so add missed mutex_unlock().

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dmaengine: ti: k3-psil: fix deadlock on error path
@ 2020-04-15 16:05   ` Vinod Koul
  0 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2020-04-15 16:05 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: Vignesh Raghavendra, Sekhar Nori, linux-kernel, Peter Ujfalusi,
	dmaengine, Dan Williams, linux-arm-kernel

On 08-04-20, 21:55, Grygorii Strashko wrote:
> The mutex_unlock() is missed on error path of psil_get_ep_config()
> which causes deadlock, so add missed mutex_unlock().

Applied, thanks

-- 
~Vinod

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-04-15 16:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-08 18:55 [PATCH] dmaengine: ti: k3-psil: fix deadlock on error path Grygorii Strashko
2020-04-08 18:55 ` Grygorii Strashko
2020-04-09  6:45 ` Peter Ujfalusi
2020-04-09  6:45   ` Peter Ujfalusi
2020-04-15 16:05 ` Vinod Koul
2020-04-15 16:05   ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.