public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2] remoteproc/mediatek: unprepare clk if scp_before_load fails
@ 2020-12-03  3:04 Tzung-Bi Shih
  2020-12-03 15:33 ` Mathieu Poirier
  0 siblings, 1 reply; 3+ messages in thread
From: Tzung-Bi Shih @ 2020-12-03  3:04 UTC (permalink / raw)
  To: ohad, bjorn.andersson
  Cc: mathieu.poirier, linux-remoteproc, tzungbi, linux-mediatek,
	pihsun, matthias.bgg, linux-arm-kernel

Fixes the error handling to unprepare clk if scp_before_load fails.

Fixes: fd0b6c1ff85a4 ("remoteproc/mediatek: Add support for mt8192 SCP")
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
---
Changes from v1[1]:
- add "Fixes" tag
- remove an unneeded change

[1]: https://patchwork.kernel.org/project/linux-remoteproc/patch/20201202044537.2500497-1-tzungbi@google.com/

 drivers/remoteproc/mtk_scp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
index 5f42b9ce7185..5e5705fe35a8 100644
--- a/drivers/remoteproc/mtk_scp.c
+++ b/drivers/remoteproc/mtk_scp.c
@@ -350,9 +350,10 @@ static int scp_load(struct rproc *rproc, const struct firmware *fw)
 
 	ret = scp->data->scp_before_load(scp);
 	if (ret < 0)
-		return ret;
+		goto leave;
 
 	ret = scp_elf_load_segments(rproc, fw);
+leave:
 	clk_disable_unprepare(scp->clk);
 
 	return ret;
-- 
2.29.2.454.gaff20da3a2-goog


_______________________________________________
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] 3+ messages in thread

* Re: [PATCH v2] remoteproc/mediatek: unprepare clk if scp_before_load fails
  2020-12-03  3:04 [PATCH v2] remoteproc/mediatek: unprepare clk if scp_before_load fails Tzung-Bi Shih
@ 2020-12-03 15:33 ` Mathieu Poirier
  2020-12-03 16:02   ` Tzung-Bi Shih
  0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Poirier @ 2020-12-03 15:33 UTC (permalink / raw)
  To: Tzung-Bi Shih
  Cc: ohad, linux-remoteproc, bjorn.andersson, linux-mediatek, pihsun,
	matthias.bgg, linux-arm-kernel

On Thu, Dec 03, 2020 at 11:04:36AM +0800, Tzung-Bi Shih wrote:
> Fixes the error handling to unprepare clk if scp_before_load fails.
> 
> Fixes: fd0b6c1ff85a4 ("remoteproc/mediatek: Add support for mt8192 SCP")

https://elixir.bootlin.com/linux/v5.10-rc6/source/Documentation/process/submitting-patches.rst#L122

> Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
> ---
> Changes from v1[1]:
> - add "Fixes" tag
> - remove an unneeded change
> 
> [1]: https://patchwork.kernel.org/project/linux-remoteproc/patch/20201202044537.2500497-1-tzungbi@google.com/
> 
>  drivers/remoteproc/mtk_scp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
> index 5f42b9ce7185..5e5705fe35a8 100644
> --- a/drivers/remoteproc/mtk_scp.c
> +++ b/drivers/remoteproc/mtk_scp.c
> @@ -350,9 +350,10 @@ static int scp_load(struct rproc *rproc, const struct firmware *fw)
>  
>  	ret = scp->data->scp_before_load(scp);
>  	if (ret < 0)
> -		return ret;
> +		goto leave;
>  
>  	ret = scp_elf_load_segments(rproc, fw);
> +leave:
>  	clk_disable_unprepare(scp->clk);
>  
>  	return ret;
> -- 
> 2.29.2.454.gaff20da3a2-goog
> 

_______________________________________________
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] 3+ messages in thread

* Re: [PATCH v2] remoteproc/mediatek: unprepare clk if scp_before_load fails
  2020-12-03 15:33 ` Mathieu Poirier
@ 2020-12-03 16:02   ` Tzung-Bi Shih
  0 siblings, 0 replies; 3+ messages in thread
From: Tzung-Bi Shih @ 2020-12-03 16:02 UTC (permalink / raw)
  To: Mathieu Poirier
  Cc: Ohad Ben-Cohen, open list:REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM,
	Bjorn Andersson, moderated list:ARM/Mediatek SoC support,
	Pi-Hsun Shih, Matthias Brugger,
	moderated list:ARM/Mediatek SoC support

On Thu, Dec 3, 2020 at 11:33 PM Mathieu Poirier
<mathieu.poirier@linaro.org> wrote:
>
> On Thu, Dec 03, 2020 at 11:04:36AM +0800, Tzung-Bi Shih wrote:
> > Fixes the error handling to unprepare clk if scp_before_load fails.
> >
> > Fixes: fd0b6c1ff85a4 ("remoteproc/mediatek: Add support for mt8192 SCP")
>
> https://elixir.bootlin.com/linux/v5.10-rc6/source/Documentation/process/submitting-patches.rst#L122

Fixed in v3[1], not sure what happened when copying the hash.

[1]: https://patchwork.kernel.org/project/linux-remoteproc/patch/20201203155914.3844426-1-tzungbi@google.com/

_______________________________________________
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] 3+ messages in thread

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-03  3:04 [PATCH v2] remoteproc/mediatek: unprepare clk if scp_before_load fails Tzung-Bi Shih
2020-12-03 15:33 ` Mathieu Poirier
2020-12-03 16:02   ` Tzung-Bi Shih

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox