All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: <tilak.tangudu@intel.com>
Cc: jani.nikula@intel.com, chris.p.wilson@intel.com,
	saurabhg.gupta@intel.com, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 5/8] Drm/i915/rpm: Add intel_runtime_idle
Date: Wed, 3 Aug 2022 16:52:03 -0400	[thread overview]
Message-ID: <Yurf88BkR6dwO/ad@intel.com> (raw)
In-Reply-To: <20220721095955.3986943-6-tilak.tangudu@intel.com>

On Thu, Jul 21, 2022 at 03:29:52PM +0530, tilak.tangudu@intel.com wrote:
> From: Anshuman Gupta <anshuman.gupta@intel.com>
> 
> Adding intel_runtime_idle (runtime_idle callback) to prepare the
> tageted D3 state.
> 
> Since we have introduced i915 runtime_idle callback.
> It need to be warranted that Runtime PM Core invokes runtime_idle
> callback when runtime usages count becomes zero. That requires
> to use pm_runtime_put instead of pm_runtime_put_autosuspend.
> 
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Chris Wilson <chris.p.wilson@intel.com>
> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_driver.c      | 12 ++++++++++++
>  drivers/gpu/drm/i915/intel_runtime_pm.c |  3 +--
>  2 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index deb8a8b76965..4c36554567fd 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -1576,6 +1576,17 @@ static int i915_pm_restore(struct device *kdev)
>  	return i915_pm_resume(kdev);
>  }
>  
> +static int intel_runtime_idle(struct device *kdev)
> +{
> +	struct drm_i915_private *i915 = kdev_to_i915(kdev);
> +	int ret = 1;
> +
> +	pm_runtime_mark_last_busy(kdev);
> +	pm_runtime_autosuspend(kdev);

oh, I see the ret = 1 like the other drm drivers..
do we really know why this flow and not use the runtime_idle
like the rest of the kernel?

I believe we could use more the runtime_idle to block the
runtime_pm, but following the original documented design of it.

> +
> +	return ret;
> +}
> +
>  static int intel_runtime_suspend(struct device *kdev)
>  {
>  	struct drm_i915_private *dev_priv = kdev_to_i915(kdev);
> @@ -1752,6 +1763,7 @@ const struct dev_pm_ops i915_pm_ops = {
>  	.restore = i915_pm_restore,
>  
>  	/* S0ix (via runtime suspend) event handlers */
> +	.runtime_idle = intel_runtime_idle,
>  	.runtime_suspend = intel_runtime_suspend,
>  	.runtime_resume = intel_runtime_resume,
>  };
> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
> index 704beeeb560b..1c3ed0c29330 100644
> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> @@ -513,8 +513,7 @@ static void __intel_runtime_pm_put(struct intel_runtime_pm *rpm,
>  
>  	intel_runtime_pm_release(rpm, wakelock);
>  
> -	pm_runtime_mark_last_busy(kdev);
> -	pm_runtime_put_autosuspend(kdev);
> +	pm_runtime_put(kdev);
>  }
>  
>  /**
> -- 
> 2.25.1
> 

  reply	other threads:[~2022-08-03 20:52 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-21  9:59 [Intel-gfx] [PATCH 0/8] drm/i915: Add D3Cold-Off support for runtime-pm tilak.tangudu
2022-07-21  9:59 ` [Intel-gfx] [PATCH 1/8] drm/i915: Added is_intel_rpm_allowed helper tilak.tangudu
2022-07-24 23:08   ` kernel test robot
2022-08-03 20:31   ` Rodrigo Vivi
2022-08-04  5:32     ` Tangudu, Tilak
2022-08-04 12:30       ` Vivi, Rodrigo
2022-09-28 12:16       ` Tangudu, Tilak
2022-09-28 12:31         ` Tangudu, Tilak
2022-09-28 14:29           ` Vivi, Rodrigo
2022-09-29  5:56             ` Gupta, Anshuman
2022-10-27 16:50               ` Rodrigo Vivi
2022-08-04  6:09   ` Gupta, Anshuman
2022-10-27 16:48   ` Rodrigo Vivi
2022-07-21  9:59 ` [Intel-gfx] [PATCH 2/8] drm/i915: Guard rc6 helpers with is_intel_rpm_allowed tilak.tangudu
2022-07-21  9:59 ` [Intel-gfx] [PATCH 3/8] drm/i915: Extend rpm in intel_guc_global_policies_update tilak.tangudu
2022-07-21  9:59 ` [Intel-gfx] [PATCH 4/8] drm/i915: sanitize dc state in rpm resume tilak.tangudu
2022-08-03 20:32   ` Rodrigo Vivi
2022-08-04  7:52     ` Tangudu, Tilak
2022-07-21  9:59 ` [Intel-gfx] [PATCH 5/8] Drm/i915/rpm: Add intel_runtime_idle tilak.tangudu
2022-08-03 20:52   ` Rodrigo Vivi [this message]
2022-08-04  5:53     ` Gupta, Anshuman
2022-07-21  9:59 ` [Intel-gfx] [PATCH 6/8] drm/i915/rpm: d3cold Policy tilak.tangudu
2022-07-21 11:29   ` Gupta, Anshuman
2022-07-21 11:32     ` Tangudu, Tilak
2022-08-03 20:45   ` Rodrigo Vivi
2022-08-04  1:20     ` Tangudu, Tilak
2022-08-04  6:29     ` Gupta, Anshuman
2022-07-21  9:59 ` [Intel-gfx] [PATCH 7/8] drm/i915: Add i915_save/load_pci_state helpers tilak.tangudu
2022-07-21  9:59 ` [Intel-gfx] [PATCH 8/8] drm/i915 : Add D3COLD OFF support tilak.tangudu
2022-08-04 14:50   ` Imre Deak
2022-08-04 15:29   ` Gupta, Anshuman
2022-07-21 13:10 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Add D3Cold-Off support for runtime-pm (rev3) Patchwork
2022-07-21 13:29 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork

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=Yurf88BkR6dwO/ad@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=chris.p.wilson@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=saurabhg.gupta@intel.com \
    --cc=tilak.tangudu@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.