All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: sun8i: Fix an error handling path in 'deinterlace_runtime_resume()'
@ 2020-05-05  7:50 ` Christophe JAILLET
  0 siblings, 0 replies; 8+ messages in thread
From: Christophe JAILLET @ 2020-05-05  7:50 UTC (permalink / raw)
  To: jernej.skrabec, mchehab, mripard, wens, hverkuil-cisco
  Cc: linux-media, linux-arm-kernel, linux-kernel, kernel-janitors,
	Christophe JAILLET

It is spurious to call 'clk_disable_unprepare()' when
'clk_prepare_enable()' has not been called yet.
Re-order the error handling path to avoid it.

Fixes: a4260ea49547 ("media: sun4i: Add H3 deinterlace driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/media/platform/sunxi/sun8i-di/sun8i-di.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c
index d78f6593ddd1..a1f29462d260 100644
--- a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c
+++ b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c
@@ -969,14 +969,14 @@ static int deinterlace_runtime_resume(struct device *device)
 
 	return 0;
 
-err_exlusive_rate:
-	clk_rate_exclusive_put(dev->mod_clk);
 err_ram_clk:
 	clk_disable_unprepare(dev->ram_clk);
 err_mod_clk:
 	clk_disable_unprepare(dev->mod_clk);
 err_bus_clk:
 	clk_disable_unprepare(dev->bus_clk);
+err_exlusive_rate:
+	clk_rate_exclusive_put(dev->mod_clk);
 
 	return ret;
 }
-- 
2.25.1


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

* [PATCH] media: sun8i: Fix an error handling path in 'deinterlace_runtime_resume()'
@ 2020-05-05  7:50 ` Christophe JAILLET
  0 siblings, 0 replies; 8+ messages in thread
From: Christophe JAILLET @ 2020-05-05  7:50 UTC (permalink / raw)
  To: jernej.skrabec, mchehab, mripard, wens, hverkuil-cisco
  Cc: Christophe JAILLET, kernel-janitors, linux-kernel,
	linux-arm-kernel, linux-media

It is spurious to call 'clk_disable_unprepare()' when
'clk_prepare_enable()' has not been called yet.
Re-order the error handling path to avoid it.

Fixes: a4260ea49547 ("media: sun4i: Add H3 deinterlace driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/media/platform/sunxi/sun8i-di/sun8i-di.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c
index d78f6593ddd1..a1f29462d260 100644
--- a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c
+++ b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c
@@ -969,14 +969,14 @@ static int deinterlace_runtime_resume(struct device *device)
 
 	return 0;
 
-err_exlusive_rate:
-	clk_rate_exclusive_put(dev->mod_clk);
 err_ram_clk:
 	clk_disable_unprepare(dev->ram_clk);
 err_mod_clk:
 	clk_disable_unprepare(dev->mod_clk);
 err_bus_clk:
 	clk_disable_unprepare(dev->bus_clk);
+err_exlusive_rate:
+	clk_rate_exclusive_put(dev->mod_clk);
 
 	return ret;
 }
-- 
2.25.1

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

* [PATCH] media: sun8i: Fix an error handling path in 'deinterlace_runtime_resume()'
@ 2020-05-05  7:50 ` Christophe JAILLET
  0 siblings, 0 replies; 8+ messages in thread
From: Christophe JAILLET @ 2020-05-05  7:50 UTC (permalink / raw)
  To: jernej.skrabec, mchehab, mripard, wens, hverkuil-cisco
  Cc: Christophe JAILLET, kernel-janitors, linux-kernel,
	linux-arm-kernel, linux-media

It is spurious to call 'clk_disable_unprepare()' when
'clk_prepare_enable()' has not been called yet.
Re-order the error handling path to avoid it.

Fixes: a4260ea49547 ("media: sun4i: Add H3 deinterlace driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/media/platform/sunxi/sun8i-di/sun8i-di.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c
index d78f6593ddd1..a1f29462d260 100644
--- a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c
+++ b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c
@@ -969,14 +969,14 @@ static int deinterlace_runtime_resume(struct device *device)
 
 	return 0;
 
-err_exlusive_rate:
-	clk_rate_exclusive_put(dev->mod_clk);
 err_ram_clk:
 	clk_disable_unprepare(dev->ram_clk);
 err_mod_clk:
 	clk_disable_unprepare(dev->mod_clk);
 err_bus_clk:
 	clk_disable_unprepare(dev->bus_clk);
+err_exlusive_rate:
+	clk_rate_exclusive_put(dev->mod_clk);
 
 	return ret;
 }
-- 
2.25.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] 8+ messages in thread

* Re: [PATCH] media: sun8i: Fix an error handling path in 'deinterlace_runtime_resume()'
  2020-05-05  7:50 ` Christophe JAILLET
  (?)
@ 2020-05-05  7:52   ` Chen-Yu Tsai
  -1 siblings, 0 replies; 8+ messages in thread
From: Chen-Yu Tsai @ 2020-05-05  7:52 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Jernej Skrabec, Mauro Carvalho Chehab, Maxime Ripard,
	Hans Verkuil, Linux Media Mailing List, linux-arm-kernel,
	linux-kernel, kernel-janitors

On Tue, May 5, 2020 at 3:50 PM Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
>
> It is spurious to call 'clk_disable_unprepare()' when
> 'clk_prepare_enable()' has not been called yet.
> Re-order the error handling path to avoid it.
>
> Fixes: a4260ea49547 ("media: sun4i: Add H3 deinterlace driver")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Acked-by: Chen-Yu Tsai <wens@csie.org>

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

* Re: [PATCH] media: sun8i: Fix an error handling path in 'deinterlace_runtime_resume()'
@ 2020-05-05  7:52   ` Chen-Yu Tsai
  0 siblings, 0 replies; 8+ messages in thread
From: Chen-Yu Tsai @ 2020-05-05  7:52 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Jernej Skrabec, kernel-janitors, linux-kernel, Maxime Ripard,
	Hans Verkuil, Mauro Carvalho Chehab, linux-arm-kernel,
	Linux Media Mailing List

On Tue, May 5, 2020 at 3:50 PM Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
>
> It is spurious to call 'clk_disable_unprepare()' when
> 'clk_prepare_enable()' has not been called yet.
> Re-order the error handling path to avoid it.
>
> Fixes: a4260ea49547 ("media: sun4i: Add H3 deinterlace driver")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Acked-by: Chen-Yu Tsai <wens@csie.org>

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

* Re: [PATCH] media: sun8i: Fix an error handling path in 'deinterlace_runtime_resume()'
@ 2020-05-05  7:52   ` Chen-Yu Tsai
  0 siblings, 0 replies; 8+ messages in thread
From: Chen-Yu Tsai @ 2020-05-05  7:52 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Jernej Skrabec, kernel-janitors, linux-kernel, Maxime Ripard,
	Hans Verkuil, Mauro Carvalho Chehab, linux-arm-kernel,
	Linux Media Mailing List

On Tue, May 5, 2020 at 3:50 PM Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
>
> It is spurious to call 'clk_disable_unprepare()' when
> 'clk_prepare_enable()' has not been called yet.
> Re-order the error handling path to avoid it.
>
> Fixes: a4260ea49547 ("media: sun4i: Add H3 deinterlace driver")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Acked-by: Chen-Yu Tsai <wens@csie.org>

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

* Re: [PATCH] media: sun8i: Fix an error handling path in deinterlace_runtime_resume()
  2020-05-05  7:50 ` Christophe JAILLET
@ 2020-05-05  8:15 ` Markus Elfring
  -1 siblings, 0 replies; 8+ messages in thread
From: Markus Elfring @ 2020-05-05  8:15 UTC (permalink / raw)
  To: Christophe Jaillet, linux-arm-kernel, linux-media
  Cc: kernel-janitors, linux-kernel, Chen-Yu Tsai, Hans Verkuil,
	Jernej Skrabec, Mauro Carvalho Chehab, Maxime Ripard

> It is spurious to call 'clk_disable_unprepare()' when
> 'clk_prepare_enable()' has not been called yet.

Can it be that the usage of the word “suspicious” would be more appropriate
for such a change description?


> Re-order the error handling path to avoid it.

Would it be also helpful to explicitly mention in the commit message
that you would like to move a call of the function “clk_rate_exclusive_put”
to the end of this function implementation for the correction
of the desired exception handling?

Regards,
Markus

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

* Re: [PATCH] media: sun8i: Fix an error handling path in deinterlace_runtime_resume()
@ 2020-05-05  8:15 ` Markus Elfring
  0 siblings, 0 replies; 8+ messages in thread
From: Markus Elfring @ 2020-05-05  8:15 UTC (permalink / raw)
  To: Christophe Jaillet, linux-arm-kernel, linux-media
  Cc: kernel-janitors, linux-kernel, Chen-Yu Tsai, Hans Verkuil,
	Jernej Skrabec, Mauro Carvalho Chehab, Maxime Ripard

> It is spurious to call 'clk_disable_unprepare()' when
> 'clk_prepare_enable()' has not been called yet.

Can it be that the usage of the word “suspicious” would be more appropriate
for such a change description?


> Re-order the error handling path to avoid it.

Would it be also helpful to explicitly mention in the commit message
that you would like to move a call of the function “clk_rate_exclusive_put”
to the end of this function implementation for the correction
of the desired exception handling?

Regards,
Markus

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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-05  8:15 [PATCH] media: sun8i: Fix an error handling path in deinterlace_runtime_resume() Markus Elfring
2020-05-05  8:15 ` Markus Elfring
  -- strict thread matches above, loose matches on Subject: below --
2020-05-05  7:50 [PATCH] media: sun8i: Fix an error handling path in 'deinterlace_runtime_resume()' Christophe JAILLET
2020-05-05  7:50 ` Christophe JAILLET
2020-05-05  7:50 ` Christophe JAILLET
2020-05-05  7:52 ` Chen-Yu Tsai
2020-05-05  7:52   ` Chen-Yu Tsai
2020-05-05  7:52   ` Chen-Yu Tsai

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.