Linux-Samsung-soc Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2 RFT] media: exynos4-is: add missed clk_disable_unprepare in remove
@ 2019-12-19  7:48 Chuhong Yuan
  2020-01-10 13:40 ` Hans Verkuil
  0 siblings, 1 reply; 3+ messages in thread
From: Chuhong Yuan @ 2019-12-19  7:48 UTC (permalink / raw)
  To: unlisted-recipients:; (no To-header on input)
  Cc: Kyungmin Park, Sylwester Nawrocki, Mauro Carvalho Chehab,
	Kukjin Kim, Krzysztof Kozlowski, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, Chuhong Yuan

This driver forgets to disable and unprepare clock when remove.
Add a call to clk_disable_unprepare() to fix it.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
Changes in v2:
  - Add a check of pm_runtime_enable() to match enable in probe.
  - Add RFT tag.

 drivers/media/platform/exynos4-is/fimc-lite.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c
index e87c6a09205b..17de14fbba31 100644
--- a/drivers/media/platform/exynos4-is/fimc-lite.c
+++ b/drivers/media/platform/exynos4-is/fimc-lite.c
@@ -1614,6 +1614,9 @@ static int fimc_lite_remove(struct platform_device *pdev)
 	struct fimc_lite *fimc = platform_get_drvdata(pdev);
 	struct device *dev = &pdev->dev;
 
+	if (!pm_runtime_enabled(dev))
+		clk_disable_unprepare(fimc->clock);
+
 	pm_runtime_disable(dev);
 	pm_runtime_set_suspended(dev);
 	fimc_lite_unregister_capture_subdev(fimc);
-- 
2.24.0


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

* Re: [PATCH v2 RFT] media: exynos4-is: add missed clk_disable_unprepare in remove
  2019-12-19  7:48 [PATCH v2 RFT] media: exynos4-is: add missed clk_disable_unprepare in remove Chuhong Yuan
@ 2020-01-10 13:40 ` Hans Verkuil
  2020-01-13  7:52   ` Krzysztof Kozlowski
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Verkuil @ 2020-01-10 13:40 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: Kyungmin Park, Sylwester Nawrocki, Mauro Carvalho Chehab,
	Kukjin Kim, Krzysztof Kozlowski, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

Anyone able/willing to test this patch?

Regards,

	Hans

On 12/19/19 8:48 AM, Chuhong Yuan wrote:
> This driver forgets to disable and unprepare clock when remove.
> Add a call to clk_disable_unprepare() to fix it.
> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
> Changes in v2:
>   - Add a check of pm_runtime_enable() to match enable in probe.
>   - Add RFT tag.
> 
>  drivers/media/platform/exynos4-is/fimc-lite.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c
> index e87c6a09205b..17de14fbba31 100644
> --- a/drivers/media/platform/exynos4-is/fimc-lite.c
> +++ b/drivers/media/platform/exynos4-is/fimc-lite.c
> @@ -1614,6 +1614,9 @@ static int fimc_lite_remove(struct platform_device *pdev)
>  	struct fimc_lite *fimc = platform_get_drvdata(pdev);
>  	struct device *dev = &pdev->dev;
>  
> +	if (!pm_runtime_enabled(dev))
> +		clk_disable_unprepare(fimc->clock);
> +
>  	pm_runtime_disable(dev);
>  	pm_runtime_set_suspended(dev);
>  	fimc_lite_unregister_capture_subdev(fimc);
> 


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

* Re: [PATCH v2 RFT] media: exynos4-is: add missed clk_disable_unprepare in remove
  2020-01-10 13:40 ` Hans Verkuil
@ 2020-01-13  7:52   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2020-01-13  7:52 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: Chuhong Yuan, Kyungmin Park, Sylwester Nawrocki,
	Mauro Carvalho Chehab, Kukjin Kim, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

On Fri, Jan 10, 2020 at 02:40:21PM +0100, Hans Verkuil wrote:
> Anyone able/willing to test this patch?

I do not have the hardware with FIMC/camera so I cannot provide testing.
However it looks good, so I propose to just take it:
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof


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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-19  7:48 [PATCH v2 RFT] media: exynos4-is: add missed clk_disable_unprepare in remove Chuhong Yuan
2020-01-10 13:40 ` Hans Verkuil
2020-01-13  7:52   ` Krzysztof Kozlowski

Linux-Samsung-soc Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-samsung-soc/0 linux-samsung-soc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-samsung-soc linux-samsung-soc/ https://lore.kernel.org/linux-samsung-soc \
		linux-samsung-soc@vger.kernel.org
	public-inbox-index linux-samsung-soc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-samsung-soc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git