All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/exynos: mixer: Fix enabling of the runtime power management
       [not found] <CGME20200514100812eucas1p1d42ad25e93858a4bc801049f93f58250@eucas1p1.samsung.com>
@ 2020-05-14 10:08   ` Marek Szyprowski
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Szyprowski @ 2020-05-14 10:08 UTC (permalink / raw)
  To: dri-devel, linux-samsung-soc
  Cc: Marek Szyprowski, Bartlomiej Zolnierkiewicz, Seung-Woo Kim,
	Inki Dae, Andrzej Hajda

Runtime power management is essential for the Exynos Mixer driver
operation. It should be enabled before adding its DRM component, because
in some cases (when deferred probe takes place due to the IOMMU
availability) the DRM driver might be initialized directly from the
Mixer's component_add() call, what results in starting the driver
operation without enabling the runtime power management.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_mixer.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index ffbf4a950f69..829d2ce7560d 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -1200,9 +1200,11 @@ static int mixer_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, ctx);
 
+	pm_runtime_enable(dev);
+
 	ret = component_add(&pdev->dev, &mixer_component_ops);
-	if (!ret)
-		pm_runtime_enable(dev);
+	if (ret)
+		pm_runtime_disable(dev);
 
 	return ret;
 }
-- 
2.17.1


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

* [PATCH] drm/exynos: mixer: Fix enabling of the runtime power management
@ 2020-05-14 10:08   ` Marek Szyprowski
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Szyprowski @ 2020-05-14 10:08 UTC (permalink / raw)
  To: dri-devel, linux-samsung-soc
  Cc: Andrzej Hajda, Bartlomiej Zolnierkiewicz, Seung-Woo Kim,
	Marek Szyprowski

Runtime power management is essential for the Exynos Mixer driver
operation. It should be enabled before adding its DRM component, because
in some cases (when deferred probe takes place due to the IOMMU
availability) the DRM driver might be initialized directly from the
Mixer's component_add() call, what results in starting the driver
operation without enabling the runtime power management.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_mixer.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index ffbf4a950f69..829d2ce7560d 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -1200,9 +1200,11 @@ static int mixer_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, ctx);
 
+	pm_runtime_enable(dev);
+
 	ret = component_add(&pdev->dev, &mixer_component_ops);
-	if (!ret)
-		pm_runtime_enable(dev);
+	if (ret)
+		pm_runtime_disable(dev);
 
 	return ret;
 }
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/exynos: mixer: Fix enabling of the runtime power management
  2020-05-14 10:08   ` Marek Szyprowski
@ 2020-05-18  5:12     ` Inki Dae
  -1 siblings, 0 replies; 4+ messages in thread
From: Inki Dae @ 2020-05-18  5:12 UTC (permalink / raw)
  To: Marek Szyprowski, dri-devel, linux-samsung-soc
  Cc: Bartlomiej Zolnierkiewicz, Seung-Woo Kim, Andrzej Hajda

Hi Marek,

20. 5. 14. 오후 7:08에 Marek Szyprowski 이(가) 쓴 글:
> Runtime power management is essential for the Exynos Mixer driver
> operation. It should be enabled before adding its DRM component, because
> in some cases (when deferred probe takes place due to the IOMMU
> availability) the DRM driver might be initialized directly from the
> Mixer's component_add() call, what results in starting the driver
> operation without enabling the runtime power management.

Seems better to change call order of mixer_remove function like below because you changed the one of probe function.
static int mixer_remove(struct platform_device *pdev)
{
	component_del(&pdev->dev, &mixer_component_ops);

	pm_runtime_disable(&pdev->dev);
}

It's a trivial thing and it would be no problem as-is - we don't touch HW in unbind - so picked it up.

Thanks,
Inki Dae

> 
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/gpu/drm/exynos/exynos_mixer.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index ffbf4a950f69..829d2ce7560d 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -1200,9 +1200,11 @@ static int mixer_probe(struct platform_device *pdev)
>  
>  	platform_set_drvdata(pdev, ctx);
>  
> +	pm_runtime_enable(dev);
> +
>  	ret = component_add(&pdev->dev, &mixer_component_ops);
> -	if (!ret)
> -		pm_runtime_enable(dev);
> +	if (ret)
> +		pm_runtime_disable(dev);
>  
>  	return ret;
>  }
> 

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

* Re: [PATCH] drm/exynos: mixer: Fix enabling of the runtime power management
@ 2020-05-18  5:12     ` Inki Dae
  0 siblings, 0 replies; 4+ messages in thread
From: Inki Dae @ 2020-05-18  5:12 UTC (permalink / raw)
  To: Marek Szyprowski, dri-devel, linux-samsung-soc
  Cc: Andrzej Hajda, Seung-Woo Kim, Bartlomiej Zolnierkiewicz

Hi Marek,

20. 5. 14. 오후 7:08에 Marek Szyprowski 이(가) 쓴 글:
> Runtime power management is essential for the Exynos Mixer driver
> operation. It should be enabled before adding its DRM component, because
> in some cases (when deferred probe takes place due to the IOMMU
> availability) the DRM driver might be initialized directly from the
> Mixer's component_add() call, what results in starting the driver
> operation without enabling the runtime power management.

Seems better to change call order of mixer_remove function like below because you changed the one of probe function.
static int mixer_remove(struct platform_device *pdev)
{
	component_del(&pdev->dev, &mixer_component_ops);

	pm_runtime_disable(&pdev->dev);
}

It's a trivial thing and it would be no problem as-is - we don't touch HW in unbind - so picked it up.

Thanks,
Inki Dae

> 
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/gpu/drm/exynos/exynos_mixer.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index ffbf4a950f69..829d2ce7560d 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -1200,9 +1200,11 @@ static int mixer_probe(struct platform_device *pdev)
>  
>  	platform_set_drvdata(pdev, ctx);
>  
> +	pm_runtime_enable(dev);
> +
>  	ret = component_add(&pdev->dev, &mixer_component_ops);
> -	if (!ret)
> -		pm_runtime_enable(dev);
> +	if (ret)
> +		pm_runtime_disable(dev);
>  
>  	return ret;
>  }
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2020-05-18  5:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200514100812eucas1p1d42ad25e93858a4bc801049f93f58250@eucas1p1.samsung.com>
2020-05-14 10:08 ` [PATCH] drm/exynos: mixer: Fix enabling of the runtime power management Marek Szyprowski
2020-05-14 10:08   ` Marek Szyprowski
2020-05-18  5:12   ` Inki Dae
2020-05-18  5:12     ` Inki Dae

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.