[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <138de070-a06c-654e-4912-d41f0cd658c2@samsung.com>
Date: Wed, 28 Apr 2021 17:25:51 +0200
From: Sylwester Nawrocki <s.nawrocki@...sung.com>
To: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
Cc: linuxarm@...wei.com, mauro.chehab@...wei.com,
Ezequiel Garcia <ezequiel@...labora.com>,
Hans Verkuil <hverkuil-cisco@...all.nl>,
Krzysztof Kozlowski <krzk@...nel.org>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-media@...r.kernel.org, linux-samsung-soc@...r.kernel.org
Subject: Re: [PATCH v4 07/79] media: exynos-gsc: don't resume at remove time
On 28.04.2021 16:51, Mauro Carvalho Chehab wrote:
> Calling pm_runtime_get_sync() at driver's removal time is not
> needed, as this will resume PM runtime. Also, the PM runtime
> code at pm_runtime_disable() already calls it, if it detects
> the need.
>
> So, change the logic in order to disable PM runtime earlier.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
Thank you for correcting that.
> ---
> drivers/media/platform/exynos-gsc/gsc-core.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c
> index 9f41c2e7097a..8b943075c503 100644
> --- a/drivers/media/platform/exynos-gsc/gsc-core.c
> +++ b/drivers/media/platform/exynos-gsc/gsc-core.c
> @@ -1210,18 +1210,19 @@ static int gsc_remove(struct platform_device *pdev)
> struct gsc_dev *gsc = platform_get_drvdata(pdev);
> int i;
>
> - pm_runtime_get_sync(&pdev->dev);
> -
> gsc_unregister_m2m_device(gsc);
> v4l2_device_unregister(&gsc->v4l2_dev);
>
> vb2_dma_contig_clear_max_seg_size(&pdev->dev);
> - for (i = 0; i < gsc->num_clocks; i++)
> - clk_disable_unprepare(gsc->clock[i]);
>
> - pm_runtime_put_noidle(&pdev->dev);
> pm_runtime_disable(&pdev->dev);
> + if (!pm_runtime_status_suspended(dev)) {
It should be &pdev->dev here rather than dev...
> + for (i = 0; i < gsc->num_clocks; i++)
> + clk_disable_unprepare(gsc->clock[i]);
> + }
> + pm_runtime_set_suspended(dev);
and here s/dev/&pdev->dev.
With above issues fixed,
Reviewed-by: Sylwester Nawrocki <s.nawrocki@...sung.com>
> dev_dbg(&pdev->dev, "%s driver unloaded\n", pdev->name);
> return 0;
> }
Thanks,
Sylwester
Powered by blists - more mailing lists