linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] media: meson: vdec: add missing clk_disable_unprepare on error in vdec_hevc_start()
@ 2022-08-18  6:57 Xu Qiang
  2022-08-19  8:58 ` Neil Armstrong
  0 siblings, 1 reply; 2+ messages in thread
From: Xu Qiang @ 2022-08-18  6:57 UTC (permalink / raw)
  To: narmstrong, mchehab, gregkh, khilman, jbrunet,
	martin.blumenstingl, mjourdan, hverkuil-cisco
  Cc: linux-media, linux-amlogic, linux-staging, linux-arm-kernel,
	linux-kernel, guohanjun, weiyongjun1, xuqiang36

Add the missing clk_disable_unprepare() before return
from vdec_hevc_start() in the error handling case.

Fixes: 823a7300340e (“media: meson: vdec: add common HEVC decoder support”)
Signed-off-by: Xu Qiang <xuqiang36@huawei.com>
---
 drivers/staging/media/meson/vdec/vdec_hevc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/meson/vdec/vdec_hevc.c b/drivers/staging/media/meson/vdec/vdec_hevc.c
index 9530e580e57a..afced435c907 100644
--- a/drivers/staging/media/meson/vdec/vdec_hevc.c
+++ b/drivers/staging/media/meson/vdec/vdec_hevc.c
@@ -167,8 +167,12 @@ static int vdec_hevc_start(struct amvdec_session *sess)
 
 	clk_set_rate(core->vdec_hevc_clk, 666666666);
 	ret = clk_prepare_enable(core->vdec_hevc_clk);
-	if (ret)
+	if (ret) {
+		if (core->platform->revision == VDEC_REVISION_G12A ||
+		    core->platform->revision == VDEC_REVISION_SM1)
+			clk_disable_unprepare(core->vdec_hevcf_clk);
 		return ret;
+	}
 
 	if (core->platform->revision == VDEC_REVISION_SM1)
 		regmap_update_bits(core->regmap_ao, AO_RTI_GEN_PWR_SLEEP0,
-- 
2.17.1


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

* Re: [PATCH -next] media: meson: vdec: add missing clk_disable_unprepare on error in vdec_hevc_start()
  2022-08-18  6:57 [PATCH -next] media: meson: vdec: add missing clk_disable_unprepare on error in vdec_hevc_start() Xu Qiang
@ 2022-08-19  8:58 ` Neil Armstrong
  0 siblings, 0 replies; 2+ messages in thread
From: Neil Armstrong @ 2022-08-19  8:58 UTC (permalink / raw)
  To: Xu Qiang, mchehab, gregkh, khilman, jbrunet, martin.blumenstingl,
	mjourdan, hverkuil-cisco
  Cc: linux-media, linux-amlogic, linux-staging, linux-arm-kernel,
	linux-kernel, guohanjun, weiyongjun1

On 18/08/2022 08:57, Xu Qiang wrote:
> Add the missing clk_disable_unprepare() before return
> from vdec_hevc_start() in the error handling case.
> 
> Fixes: 823a7300340e (“media: meson: vdec: add common HEVC decoder support”)
> Signed-off-by: Xu Qiang <xuqiang36@huawei.com>
> ---
>   drivers/staging/media/meson/vdec/vdec_hevc.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/meson/vdec/vdec_hevc.c b/drivers/staging/media/meson/vdec/vdec_hevc.c
> index 9530e580e57a..afced435c907 100644
> --- a/drivers/staging/media/meson/vdec/vdec_hevc.c
> +++ b/drivers/staging/media/meson/vdec/vdec_hevc.c
> @@ -167,8 +167,12 @@ static int vdec_hevc_start(struct amvdec_session *sess)
>   
>   	clk_set_rate(core->vdec_hevc_clk, 666666666);
>   	ret = clk_prepare_enable(core->vdec_hevc_clk);
> -	if (ret)
> +	if (ret) {
> +		if (core->platform->revision == VDEC_REVISION_G12A ||
> +		    core->platform->revision == VDEC_REVISION_SM1)
> +			clk_disable_unprepare(core->vdec_hevcf_clk);
>   		return ret;
> +	}
>   
>   	if (core->platform->revision == VDEC_REVISION_SM1)
>   		regmap_update_bits(core->regmap_ao, AO_RTI_GEN_PWR_SLEEP0,

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

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

end of thread, other threads:[~2022-08-19  8:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-18  6:57 [PATCH -next] media: meson: vdec: add missing clk_disable_unprepare on error in vdec_hevc_start() Xu Qiang
2022-08-19  8:58 ` Neil Armstrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).