From: Archit Taneja <archit@ti.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>,
linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH 6/6] OMAPDSS: use runtime PM's autosuspend
Date: Mon, 25 Nov 2013 06:59:24 +0530 [thread overview]
Message-ID: <5292A7F4.8030106@ti.com> (raw)
In-Reply-To: <1384779009-10512-7-git-send-email-tomi.valkeinen@ti.com>
On Monday 18 November 2013 06:20 PM, Tomi Valkeinen wrote:
> Use runtime PM's autosuspend support with delay of 100ms.
>
> This will prevent the driver from turning the DSS modules off and on
> multiple times e.g. when loading the module.
Could you explain this a bit more?
Are you saying that when we insert the omapdss module, we have a lot of
runtime_get/put pairs in probe, which leads to us excessive writing of
DISPC the registers during resume, and the autosuspend feature would
delay the effect of runtime_put() for a while?
Also, do we need to do this for all the platform devices? Could we use
autosuspend only for the parent platform device, and the children
platform devices don't use it? Or am I understanding things wrongly here?
Archit
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
> drivers/video/omap2/dss/dispc.c | 5 ++++-
> drivers/video/omap2/dss/dsi.c | 5 ++++-
> drivers/video/omap2/dss/dss.c | 5 ++++-
> drivers/video/omap2/dss/dss.h | 2 ++
> drivers/video/omap2/dss/hdmi4.c | 5 ++++-
> drivers/video/omap2/dss/rfbi.c | 5 ++++-
> drivers/video/omap2/dss/venc.c | 5 ++++-
> 7 files changed, 26 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
> index 58f3626..0643eb0 100644
> --- a/drivers/video/omap2/dss/dispc.c
> +++ b/drivers/video/omap2/dss/dispc.c
> @@ -258,7 +258,8 @@ void dispc_runtime_put(void)
>
> DSSDBG("dispc_runtime_put\n");
>
> - r = pm_runtime_put_sync(&dispc.pdev->dev);
> + pm_runtime_mark_last_busy(&dispc.pdev->dev);
> + r = pm_runtime_put_autosuspend(&dispc.pdev->dev);
> WARN_ON(r < 0 && r != -ENOSYS);
> }
> EXPORT_SYMBOL(dispc_runtime_put);
> @@ -3440,6 +3441,8 @@ static int __init omap_dispchw_probe(struct platform_device *pdev)
> }
>
> pm_runtime_enable(&pdev->dev);
> + pm_runtime_set_autosuspend_delay(&pdev->dev, DSS_AUTOSUSPEND_DELAY);
> + pm_runtime_use_autosuspend(&pdev->dev);
>
> r = dispc_runtime_get();
> if (r)
> diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
> index 6b30a58..19e4cad 100644
> --- a/drivers/video/omap2/dss/dsi.c
> +++ b/drivers/video/omap2/dss/dsi.c
> @@ -1110,7 +1110,8 @@ void dsi_runtime_put(struct platform_device *dsidev)
>
> DSSDBG("dsi_runtime_put\n");
>
> - r = pm_runtime_put_sync(&dsi->pdev->dev);
> + pm_runtime_mark_last_busy(&dsi->pdev->dev);
> + r = pm_runtime_put_autosuspend(&dsi->pdev->dev);
> WARN_ON(r < 0 && r != -ENOSYS);
> }
>
> @@ -5416,6 +5417,8 @@ static int omap_dsihw_probe(struct platform_device *dsidev)
> return r;
>
> pm_runtime_enable(&dsidev->dev);
> + pm_runtime_set_autosuspend_delay(&dsidev->dev, DSS_AUTOSUSPEND_DELAY);
> + pm_runtime_use_autosuspend(&dsidev->dev);
>
> r = dsi_runtime_get(dsidev);
> if (r)
> diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
> index fa7bc00..d3b0122 100644
> --- a/drivers/video/omap2/dss/dss.c
> +++ b/drivers/video/omap2/dss/dss.c
> @@ -689,7 +689,8 @@ static void dss_runtime_put(void)
>
> DSSDBG("dss_runtime_put\n");
>
> - r = pm_runtime_put_sync(&dss.pdev->dev);
> + pm_runtime_mark_last_busy(&dss.pdev->dev);
> + r = pm_runtime_put_autosuspend(&dss.pdev->dev);
> WARN_ON(r < 0 && r != -ENOSYS && r != -EBUSY);
> }
>
> @@ -821,6 +822,8 @@ static int __init omap_dsshw_probe(struct platform_device *pdev)
> goto err_setup_clocks;
>
> pm_runtime_enable(&pdev->dev);
> + pm_runtime_set_autosuspend_delay(&pdev->dev, DSS_AUTOSUSPEND_DELAY);
> + pm_runtime_use_autosuspend(&pdev->dev);
>
> r = dss_runtime_get();
> if (r)
> diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
> index af83c4d..96505f0 100644
> --- a/drivers/video/omap2/dss/dss.h
> +++ b/drivers/video/omap2/dss/dss.h
> @@ -73,6 +73,8 @@
> #define FLD_MOD(orig, val, start, end) \
> (((orig) & ~FLD_MASK(start, end)) | FLD_VAL(val, start, end))
>
> +#define DSS_AUTOSUSPEND_DELAY 100 /* in ms */
> +
> enum dss_io_pad_mode {
> DSS_IO_PAD_MODE_RESET,
> DSS_IO_PAD_MODE_RFBI,
> diff --git a/drivers/video/omap2/dss/hdmi4.c b/drivers/video/omap2/dss/hdmi4.c
> index f1a45fe..f255641 100644
> --- a/drivers/video/omap2/dss/hdmi4.c
> +++ b/drivers/video/omap2/dss/hdmi4.c
> @@ -77,7 +77,8 @@ static void hdmi_runtime_put(void)
>
> DSSDBG("hdmi_runtime_put\n");
>
> - r = pm_runtime_put_sync(&hdmi.pdev->dev);
> + pm_runtime_mark_last_busy(&hdmi.pdev->dev);
> + r = pm_runtime_put_autosuspend(&hdmi.pdev->dev);
> WARN_ON(r < 0 && r != -ENOSYS);
> }
>
> @@ -631,6 +632,8 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
> }
>
> pm_runtime_enable(&pdev->dev);
> + pm_runtime_set_autosuspend_delay(&pdev->dev, DSS_AUTOSUSPEND_DELAY);
> + pm_runtime_use_autosuspend(&pdev->dev);
>
> hdmi_init_output(pdev);
>
> diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
> index 74d3ed1..20dcbfb 100644
> --- a/drivers/video/omap2/dss/rfbi.c
> +++ b/drivers/video/omap2/dss/rfbi.c
> @@ -147,7 +147,8 @@ static void rfbi_runtime_put(void)
>
> DSSDBG("rfbi_runtime_put\n");
>
> - r = pm_runtime_put_sync(&rfbi.pdev->dev);
> + pm_runtime_mark_last_busy(&rfbi.pdev->dev);
> + r = pm_runtime_put_autosuspend(&rfbi.pdev->dev);
> WARN_ON(r < 0 && r != -ENOSYS);
> }
>
> @@ -981,6 +982,8 @@ static int omap_rfbihw_probe(struct platform_device *pdev)
> clk_put(clk);
>
> pm_runtime_enable(&pdev->dev);
> + pm_runtime_set_autosuspend_delay(&pdev->dev, DSS_AUTOSUSPEND_DELAY);
> + pm_runtime_use_autosuspend(&pdev->dev);
>
> r = rfbi_runtime_get();
> if (r)
> diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
> index e173961..bbd35bb 100644
> --- a/drivers/video/omap2/dss/venc.c
> +++ b/drivers/video/omap2/dss/venc.c
> @@ -410,7 +410,8 @@ static void venc_runtime_put(void)
>
> DSSDBG("venc_runtime_put\n");
>
> - r = pm_runtime_put_sync(&venc.pdev->dev);
> + pm_runtime_mark_last_busy(&venc.pdev->dev);
> + r = pm_runtime_put_autosuspend(&venc.pdev->dev);
> WARN_ON(r < 0 && r != -ENOSYS);
> }
>
> @@ -835,6 +836,8 @@ static int omap_venchw_probe(struct platform_device *pdev)
> return r;
>
> pm_runtime_enable(&pdev->dev);
> + pm_runtime_set_autosuspend_delay(&pdev->dev, DSS_AUTOSUSPEND_DELAY);
> + pm_runtime_use_autosuspend(&pdev->dev);
>
> r = venc_runtime_get();
> if (r)
>
next prev parent reply other threads:[~2013-11-25 13:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-18 12:50 [PATCH 0/6] OMAPDSS: suspend/resume improvements Tomi Valkeinen
2013-11-18 12:50 ` [PATCH 1/6] OMAPDSS: APPLY: set infos to dirty on enable Tomi Valkeinen
2013-11-25 1:06 ` Archit Taneja
2013-11-26 10:21 ` Tomi Valkeinen
2013-11-18 12:50 ` [PATCH 2/6] OMAPDSS: DISPC: Remove context restore Tomi Valkeinen
2013-11-18 12:50 ` [PATCH 3/6] OMAPDSS: DSS remove ctx stuff Tomi Valkeinen
2013-11-18 12:50 ` [PATCH 4/6] OMAPDSS: remove dss_get_ctx_loss_count Tomi Valkeinen
2013-11-18 12:50 ` [PATCH 5/6] OMAPDSS: add debug print for runtime suspend/resume Tomi Valkeinen
2013-11-18 12:50 ` [PATCH 6/6] OMAPDSS: use runtime PM's autosuspend Tomi Valkeinen
2013-11-25 1:29 ` Archit Taneja [this message]
2013-11-26 10:27 ` Tomi Valkeinen
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=5292A7F4.8030106@ti.com \
--to=archit@ti.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=tomi.valkeinen@ti.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