All of lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, rodrigo.vivi@intel.com
Subject: Re: [PATCH v2] drm/i915: Always program CSR if CSR is uninitialized
Date: Tue, 27 Oct 2015 20:41:31 +0200	[thread overview]
Message-ID: <1445971291.2408.68.camel@intel.com> (raw)
In-Reply-To: <1445593310-26596-1-git-send-email-patrik.jakobsson@linux.intel.com>

On pe, 2015-10-23 at 11:41 +0200, Patrik Jakobsson wrote:
> The current CSR loading code depends on the CSR program memory to be
> cleared after boot. This is unfortunately not true on all hardware.
> Instead make use of the FW_UNINITIALIZED state in init and check for
> FW_LOADED to prevent init path from skipping the actual programming.
> 
> v2: Move initialization of state to after HAS_CSR() check
> 
> Signed-off-by: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
> Tested-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_csr.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
> index 9e530a7..e74c09e 100644
> --- a/drivers/gpu/drm/i915/intel_csr.c
> +++ b/drivers/gpu/drm/i915/intel_csr.c
> @@ -271,7 +271,7 @@ void intel_csr_load_program(struct drm_device *dev)
>  	 * Unfortunately the ACPI subsystem doesn't yet give us a way to
>  	 * differentiate this, hence figure it out with this hack.
>  	 */
> -	if (I915_READ(CSR_PROGRAM(0)))
> +	if (I915_READ(CSR_PROGRAM(0)) && dev_priv->csr.state == FW_LOADED)
>  		return;

As Animesh said csr->state is being removed, so I'd prefer if we didn't
add new users for it.

I think the proper solution for this would be to reprogram the firmware
only when we know we have to and not have here either of the above
checks. The points we need to reprogram the firmware:

S3/S4 both on SKL.
S3/S4/DC9 (runtime suspend) on BXT.

To fix this particular bug you could also just add an
intel_csr_reprogram() that would check for CSR_PROGRAM(0) as now, while
during driver loading you would program the firmware unconditionally.

--Imre


>  
>  	mutex_lock(&dev_priv->csr_lock);
> @@ -428,6 +428,8 @@ void intel_csr_ucode_init(struct drm_device *dev)
>  	if (!HAS_CSR(dev))
>  		return;
>  
> +	intel_csr_load_status_set(dev_priv, FW_UNINITIALIZED);
> +
>  	if (IS_SKYLAKE(dev))
>  		csr->fw_path = I915_CSR_SKL;
>  	else if (IS_BROXTON(dev_priv))



_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2015-10-27 18:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-23  9:41 [PATCH v2] drm/i915: Always program CSR if CSR is uninitialized Patrik Jakobsson
2015-10-23 11:28 ` Patrik Jakobsson
2015-10-24  5:33 ` Animesh Manna
2015-10-26  9:57   ` Patrik Jakobsson
2015-10-27 18:41 ` Imre Deak [this message]
2015-10-28 15:52   ` Patrik Jakobsson
2015-10-28 17:12     ` Imre Deak

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=1445971291.2408.68.camel@intel.com \
    --to=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=patrik.jakobsson@linux.intel.com \
    --cc=rodrigo.vivi@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.