dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume
@ 2023-12-20  9:53 ` Fedor Pchelkin
  2023-12-20 10:39   ` Marek Szyprowski
  0 siblings, 1 reply; 3+ messages in thread
From: Fedor Pchelkin @ 2023-12-20  9:53 UTC (permalink / raw)
  To: Inki Dae
  Cc: lvc-project, linux-samsung-soc, Alim Akhtar, Seung-Woo Kim,
	Fedor Pchelkin, dri-devel, linux-kernel, Krzysztof Kozlowski,
	Kyungmin Park, Alexey Khoroshilov, David Airlie,
	linux-arm-kernel, Marek Szyprowski

Do not forget to call clk_disable_unprepare() on the first element of
ctx->clocks array.

Found by Linux Verification Center (linuxtesting.org).

Fixes: 8b7d3ec83aba ("drm/exynos: gsc: Convert driver to IPP v2 core API")
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
---
 drivers/gpu/drm/exynos/exynos_drm_gsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
index 34cdabc30b4f..5302bebbe38c 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
@@ -1342,7 +1342,7 @@ static int __maybe_unused gsc_runtime_resume(struct device *dev)
 	for (i = 0; i < ctx->num_clocks; i++) {
 		ret = clk_prepare_enable(ctx->clocks[i]);
 		if (ret) {
-			while (--i > 0)
+			while (--i >= 0)
 				clk_disable_unprepare(ctx->clocks[i]);
 			return ret;
 		}
-- 
2.43.0


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

* Re: [PATCH] drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume
  2023-12-20  9:53 ` [PATCH] drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume Fedor Pchelkin
@ 2023-12-20 10:39   ` Marek Szyprowski
  2023-12-21  4:27     ` Inki Dae
  0 siblings, 1 reply; 3+ messages in thread
From: Marek Szyprowski @ 2023-12-20 10:39 UTC (permalink / raw)
  To: Fedor Pchelkin, Inki Dae
  Cc: linux-samsung-soc, Seung-Woo Kim, Krzysztof Kozlowski, dri-devel,
	linux-kernel, Kyungmin Park, Alexey Khoroshilov, Alim Akhtar,
	David Airlie, linux-arm-kernel, lvc-project

On 20.12.2023 10:53, Fedor Pchelkin wrote:
> Do not forget to call clk_disable_unprepare() on the first element of
> ctx->clocks array.
>
> Found by Linux Verification Center (linuxtesting.org).
>
> Fixes: 8b7d3ec83aba ("drm/exynos: gsc: Convert driver to IPP v2 core API")
> Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>   drivers/gpu/drm/exynos/exynos_drm_gsc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
> index 34cdabc30b4f..5302bebbe38c 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
> @@ -1342,7 +1342,7 @@ static int __maybe_unused gsc_runtime_resume(struct device *dev)
>   	for (i = 0; i < ctx->num_clocks; i++) {
>   		ret = clk_prepare_enable(ctx->clocks[i]);
>   		if (ret) {
> -			while (--i > 0)
> +			while (--i >= 0)
>   				clk_disable_unprepare(ctx->clocks[i]);
>   			return ret;
>   		}

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


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

* Re: [PATCH] drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume
  2023-12-20 10:39   ` Marek Szyprowski
@ 2023-12-21  4:27     ` Inki Dae
  0 siblings, 0 replies; 3+ messages in thread
From: Inki Dae @ 2023-12-21  4:27 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: linux-samsung-soc, lvc-project, Seung-Woo Kim, Fedor Pchelkin,
	DRI mailing list, linux-kernel, Krzysztof Kozlowski,
	linux-arm-kernel, Alim Akhtar, Kyungmin Park, David Airlie,
	Alexey Khoroshilov

[-- Attachment #1: Type: text/plain, Size: 1467 bytes --]

2023년 12월 20일 (수) 오후 7:45, Marek Szyprowski <m.szyprowski@samsung.com>님이 작성:

> On 20.12.2023 10:53, Fedor Pchelkin wrote:
> > Do not forget to call clk_disable_unprepare() on the first element of
> > ctx->clocks array.
> >
> > Found by Linux Verification Center (linuxtesting.org).
> >
> > Fixes: 8b7d3ec83aba ("drm/exynos: gsc: Convert driver to IPP v2 core
> API")
> > Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
> Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
>

Applied.

Thanks,
Inki Dae

> ---
> >   drivers/gpu/drm/exynos/exynos_drm_gsc.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c
> b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
> > index 34cdabc30b4f..5302bebbe38c 100644
> > --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c
> > +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
> > @@ -1342,7 +1342,7 @@ static int __maybe_unused
> gsc_runtime_resume(struct device *dev)
> >       for (i = 0; i < ctx->num_clocks; i++) {
> >               ret = clk_prepare_enable(ctx->clocks[i]);
> >               if (ret) {
> > -                     while (--i > 0)
> > +                     while (--i >= 0)
> >                               clk_disable_unprepare(ctx->clocks[i]);
> >                       return ret;
> >               }
>
> Best regards
> --
> Marek Szyprowski, PhD
> Samsung R&D Institute Poland
>
>

[-- Attachment #2: Type: text/html, Size: 2537 bytes --]

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

end of thread, other threads:[~2023-12-21  4:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20231220095336eucas1p1f6cec297f84463fbf50a875cc0fb64f6@eucas1p1.samsung.com>
2023-12-20  9:53 ` [PATCH] drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume Fedor Pchelkin
2023-12-20 10:39   ` Marek Szyprowski
2023-12-21  4:27     ` Inki Dae

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).