linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Dmitry Osipenko <digetx@gmail.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	linux-media@vger.kernel.org, linux-tegra@vger.kernel.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/4] media: staging: tegra-vde: Power-cycle hardware on probe
Date: Fri, 26 Jun 2020 09:48:18 +0200	[thread overview]
Message-ID: <20200626074818.GD3109062@ulmo> (raw)
In-Reply-To: <20200624150847.22672-5-digetx@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1468 bytes --]

On Wed, Jun 24, 2020 at 06:08:47PM +0300, Dmitry Osipenko wrote:
> VDE partition is left turned ON after bootloader on most devices, hence
> let's ensure that it's turned OFF in order to lower power leakage while
> hardware is idling by turning it ON and OFF during of the driver's probe.
> 
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---
>  drivers/staging/media/tegra-vde/vde.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/staging/media/tegra-vde/vde.c b/drivers/staging/media/tegra-vde/vde.c
> index b64e35b86fb4..3be96c36bf43 100644
> --- a/drivers/staging/media/tegra-vde/vde.c
> +++ b/drivers/staging/media/tegra-vde/vde.c
> @@ -1068,6 +1068,14 @@ static int tegra_vde_probe(struct platform_device *pdev)
>  	pm_runtime_use_autosuspend(dev);
>  	pm_runtime_set_autosuspend_delay(dev, 300);
>  
> +	/*
> +	 * VDE partition may be left ON after bootloader, hence let's
> +	 * power-cycle it in order to put hardware into a predictable lower
> +	 * power state.
> +	 */
> +	pm_runtime_get_sync(dev);
> +	pm_runtime_put(dev);
> +
>  	return 0;
>  
>  err_deinit_iommu:

Shouldn't this happen automatically? My understanding is that power
domains are turned on automatically before ->probe() and then unless a
runtime PM reference is taken during ->probe() it will get turned off
again after ->probe()?

Is that not happening? Is auto-suspend perhaps getting in the way
somehow?

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-06-26  7:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-24 15:08 [PATCH v2 0/4] Tegra Video Decoder driver power management corrections Dmitry Osipenko
2020-06-24 15:08 ` [PATCH v2 1/4] media: staging: tegra-vde: Balance runtime PM use-count on resume failure Dmitry Osipenko
2020-06-24 15:08 ` [PATCH v2 2/4] media: staging: tegra-vde: Runtime PM is always available on Tegra Dmitry Osipenko
2020-06-26  7:44   ` Thierry Reding
2020-06-24 15:08 ` [PATCH v2 3/4] media: staging: tegra-vde: Turn ON power domain on shutdown Dmitry Osipenko
2020-06-26  7:43   ` Thierry Reding
2020-06-24 15:08 ` [PATCH v2 4/4] media: staging: tegra-vde: Power-cycle hardware on probe Dmitry Osipenko
2020-06-26  7:48   ` Thierry Reding [this message]
2020-06-26 13:42     ` Dmitry Osipenko
2020-06-24 15:16 ` [PATCH v2 0/4] Tegra Video Decoder driver power management corrections Hans Verkuil
2020-06-24 15:23   ` Dmitry Osipenko
2020-06-26  0:17     ` Dmitry Osipenko
2020-06-26  6:58       ` Hans Verkuil
2020-06-26 13:23         ` Dmitry Osipenko

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=20200626074818.GD3109062@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=digetx@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /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).