From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: <linuxarm@huawei.com>, <mauro.chehab@huawei.com>,
Ezequiel Garcia <ezequiel@collabora.com>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
"Krzysztof Kozlowski" <krzysztof.kozlowski@canonical.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Sylwester Nawrocki <s.nawrocki@samsung.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <linux-media@vger.kernel.org>,
<linux-samsung-soc@vger.kernel.org>
Subject: Re: [PATCH 07/25] media: exynos-gsc: don't resume at remove time
Date: Wed, 5 May 2021 13:27:13 +0100 [thread overview]
Message-ID: <20210505132713.000000ba@Huawei.com> (raw)
In-Reply-To: <f90e4f9b1dbc71f2a598f057a93dffc69fa3850d.1620207353.git.mchehab+huawei@kernel.org>
On Wed, 5 May 2021 11:41:57 +0200
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> 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.
>
> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Seems sensible and a lot more along the lines of what I'd expect
to see than was originally here.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> 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..f49f3322f835 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(&pdev->dev))
> + for (i = 0; i < gsc->num_clocks; i++)
> + clk_disable_unprepare(gsc->clock[i]);
> +
> + pm_runtime_set_suspended(&pdev->dev);
> +
> dev_dbg(&pdev->dev, "%s driver unloaded\n", pdev->name);
> return 0;
> }
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-05-05 12:31 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-05 9:41 [PATCH 00/25] Fix some PM runtime issues at the media subsystem Mauro Carvalho Chehab
2021-05-05 9:41 ` [PATCH 02/25] staging: media: imx7-mipi-csis: fix pm_runtime_get_sync() usage count Mauro Carvalho Chehab
2021-05-05 11:06 ` Jonathan Cameron
2021-05-05 11:17 ` Mauro Carvalho Chehab
2021-05-05 13:56 ` Rui Miguel Silva
2021-05-05 14:23 ` Mauro Carvalho Chehab
2021-05-05 9:41 ` [PATCH 07/25] media: exynos-gsc: don't resume at remove time Mauro Carvalho Chehab
2021-05-05 12:27 ` Jonathan Cameron [this message]
2021-05-05 9:41 ` [PATCH 08/25] media: atmel: properly get pm_runtime Mauro Carvalho Chehab
2021-05-05 12:08 ` Jonathan Cameron
2021-06-10 9:04 ` Eugen.Hristev
2021-06-10 9:38 ` Mauro Carvalho Chehab
2021-06-10 12:00 ` Eugen.Hristev
2021-06-16 8:03 ` Mauro Carvalho Chehab
2021-09-06 8:03 ` Mauro Carvalho Chehab
2021-09-06 8:13 ` Eugen.Hristev
2021-09-13 10:26 ` Eugen.Hristev
2021-05-05 9:42 ` [PATCH 11/25] media: mdk-mdp: fix pm_runtime_get_sync() usage count Mauro Carvalho Chehab
2021-05-05 9:42 ` [PATCH 18/25] media: mtk-vcodec: fix PM runtime get logic Mauro Carvalho Chehab
2021-05-05 12:32 ` Jonathan Cameron
2021-05-05 9:42 ` [PATCH 19/25] media: s5p-jpeg: fix pm_runtime_get_sync() usage count Mauro Carvalho Chehab
2021-05-05 12:33 ` Jonathan Cameron
2021-05-05 9:42 ` [PATCH 21/25] media: sunxi: " Mauro Carvalho Chehab
2021-05-05 9:42 ` [PATCH 23/25] media: exynos4-is: " Mauro Carvalho Chehab
2021-05-05 12:20 ` Jonathan Cameron
2021-05-05 9:42 ` [PATCH 24/25] media: exynos-gsc: " Mauro Carvalho Chehab
2021-05-05 12:34 ` Jonathan Cameron
2021-05-06 15:11 ` [PATCH 00/25] Fix some PM runtime issues at the media subsystem Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210505132713.000000ba@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=ezequiel@collabora.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=krzysztof.kozlowski@canonical.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mauro.chehab@huawei.com \
--cc=mchehab+huawei@kernel.org \
--cc=mchehab@kernel.org \
--cc=s.nawrocki@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).