All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Imre Deak <imre.deak@intel.com>,
	intel-gfx@lists.freedesktop.org,
	Jesse Barnes <jbarnes@virtuousgeek.org>
Subject: Re: [PATCH] drm/i915: vlv: reserve GT power context early
Date: Fri, 28 Feb 2014 16:12:01 +0200	[thread overview]
Message-ID: <8761nzqqby.fsf@intel.com> (raw)
In-Reply-To: <1392147546-31405-1-git-send-email-imre.deak@intel.com>

On Tue, 11 Feb 2014, Imre Deak <imre.deak@intel.com> wrote:
> We reserve the space for the power context in stolen memory at a fixed
> address from a delayed work. This races with the subsequent driver
> init/resume code which could allocate something at that address, so the
> reservation for the power context fails. Reserve the space up-front, so
> this can't happen. This also adds a missing struct_mutex lock around the
> stolen allocation, which wasn't taken in the delayed work path.
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>

Pushed to -fixes with Jesse's IRC R-b. Thanks for the patch and review.

BR,
Jani.


> ---
>  drivers/gpu/drm/i915/intel_pm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 87999d3..fd4c983 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -3554,6 +3554,8 @@ static void valleyview_setup_pctx(struct drm_device *dev)
>  	u32 pcbr;
>  	int pctx_size = 24*1024;
>  
> +	WARN_ON(!mutex_is_locked(&dev->struct_mutex));
> +
>  	pcbr = I915_READ(VLV_PCBR);
>  	if (pcbr) {
>  		/* BIOS set it up already, grab the pre-alloc'd space */
> @@ -3603,8 +3605,6 @@ static void valleyview_enable_rps(struct drm_device *dev)
>  		I915_WRITE(GTFIFODBG, gtfifodbg);
>  	}
>  
> -	valleyview_setup_pctx(dev);
> -
>  	/* If VLV, Forcewake all wells, else re-direct to regular path */
>  	gen6_gt_force_wake_get(dev_priv, FORCEWAKE_ALL);
>  
> @@ -4471,6 +4471,8 @@ void intel_enable_gt_powersave(struct drm_device *dev)
>  		ironlake_enable_rc6(dev);
>  		intel_init_emon(dev);
>  	} else if (IS_GEN6(dev) || IS_GEN7(dev)) {
> +		if (IS_VALLEYVIEW(dev))
> +			valleyview_setup_pctx(dev);
>  		/*
>  		 * PCU communication is slow and this doesn't need to be
>  		 * done at any specific time, so do this out of our fast path
> -- 
> 1.8.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center

      reply	other threads:[~2014-02-28 14:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11 19:39 [PATCH] drm/i915: vlv: reserve GT power context early Imre Deak
2014-02-28 14:12 ` Jani Nikula [this message]

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=8761nzqqby.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jbarnes@virtuousgeek.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 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.