Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Rebalance runtime pm vs forcewake
Date: Fri, 14 Mar 2014 16:51:16 +0100	[thread overview]
Message-ID: <20140314155116.GA30571@phenom.ffwll.local> (raw)
In-Reply-To: <1394786235-9514-1-git-send-email-chris@chris-wilson.co.uk>

On Fri, Mar 14, 2014 at 08:37:15AM +0000, Chris Wilson wrote:
> ---
>  drivers/gpu/drm/i915/i915_drv.c     | 2 +-
>  drivers/gpu/drm/i915/intel_uncore.c | 9 ++-------
>  2 files changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 5a0d34c47885..3fbf8aa8d119 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -845,11 +845,11 @@ static int i915_runtime_suspend(struct device *device)
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  
>  	WARN_ON(!HAS_RUNTIME_PM(dev));
> -	assert_force_wake_inactive(dev_priv);

Why is this necessary? Also I've already pushed a pile of other patches on
top of all this, so I think a full commit is better. Also gives us an
excuse to document our flailing here a bit better in a neat commit message
... Imo we should also mention that the forcewake_put here isn't really
perf critical any more (if this is really the case).

Cheers, Daniel
>  
>  	DRM_DEBUG_KMS("Suspending device\n");
>  
>  	i915_gem_release_all_mmaps(dev_priv);
> +	intel_uncore_fini(dev);
>  
>  	del_timer_sync(&dev_priv->gpu_error.hangcheck_timer);
>  	dev_priv->pm.suspended = true;
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index e6bb421a3dbd..527527382361 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -304,8 +304,6 @@ static void gen6_force_wake_timer(unsigned long arg)
>  	if (--dev_priv->uncore.forcewake_count == 0)
>  		dev_priv->uncore.funcs.force_wake_put(dev_priv, FORCEWAKE_ALL);
>  	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
> -
> -	intel_runtime_pm_put(dev_priv);
>  }
>  
>  static void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore)
> @@ -439,7 +437,6 @@ void gen6_gt_force_wake_get(struct drm_i915_private *dev_priv, int fw_engine)
>  void gen6_gt_force_wake_put(struct drm_i915_private *dev_priv, int fw_engine)
>  {
>  	unsigned long irqflags;
> -	bool delayed = false;
>  
>  	if (!dev_priv->uncore.funcs.force_wake_put)
>  		return;
> @@ -450,19 +447,17 @@ void gen6_gt_force_wake_put(struct drm_i915_private *dev_priv, int fw_engine)
>  		goto out;
>  	}
>  
> -
>  	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
>  	if (--dev_priv->uncore.forcewake_count == 0) {
>  		dev_priv->uncore.forcewake_count++;
> -		delayed = true;
>  		mod_timer_pinned(&dev_priv->uncore.force_wake_timer,
>  				 jiffies + 1);
>  	}
> +
>  	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
>  
>  out:
> -	if (!delayed)
> -		intel_runtime_pm_put(dev_priv);
> +	intel_runtime_pm_put(dev_priv);
>  }
>  
>  void assert_force_wake_inactive(struct drm_i915_private *dev_priv)
> -- 
> 1.9.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2014-03-14 15:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14  7:48 [PATCH] drm/i915: Fix runtime pm inbalance due to reg I/O forcewake dance Daniel Vetter
2014-03-14  8:18 ` Ville Syrjälä
2014-03-14  8:24   ` Chris Wilson
2014-03-14  8:34     ` Ville Syrjälä
2014-03-14  8:52       ` Daniel Vetter
2014-03-14 18:25         ` Jesse Barnes
2014-03-14  8:37     ` [PATCH] drm/i915: Rebalance runtime pm vs forcewake Chris Wilson
2014-03-14 15:51       ` Daniel Vetter [this message]
2014-03-14 16:13         ` Chris Wilson
2014-03-14 18:43           ` Daniel Vetter
2014-03-31 18:22             ` Paulo Zanoni
2014-03-31 18:59               ` Daniel Vetter
2014-04-01  8:14                 ` Chris Wilson
2014-04-01 12:32                   ` Paulo Zanoni
2014-04-01 12:42                     ` Chris Wilson
2014-04-01 17:00                       ` Daniel Vetter

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=20140314155116.GA30571@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.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