diff mbox

[01/12] drm/i915: Don't trust CSR program memory contents

Message ID 1447084107-8521-2-git-send-email-patrik.jakobsson@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Patrik Jakobsson Nov. 9, 2015, 3:48 p.m. UTC
Replaces "drm/i915: Force loading of csr program at boot" in the old
series.

Previously we called blindly into intel_csr_load_program() and depended
on a check of whether the CSR program memory was cleared or not.
This check is not reliable and no longer needed since we fixed the
call-sites of intel_csr_load_program().

Signed-off-by: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_csr.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

Comments

Imre Deak Nov. 11, 2015, 7:05 p.m. UTC | #1
On ma, 2015-11-09 at 16:48 +0100, Patrik Jakobsson wrote:
> Replaces "drm/i915: Force loading of csr program at boot" in the old
> series.
> 
> Previously we called blindly into intel_csr_load_program() and
> depended
> on a check of whether the CSR program memory was cleared or not.
> This check is not reliable and no longer needed since we fixed the
> call-sites of intel_csr_load_program().
> 
> Signed-off-by: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_csr.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_csr.c
> b/drivers/gpu/drm/i915/intel_csr.c
> index ecb7c70..ad8bc7a 100644
> --- a/drivers/gpu/drm/i915/intel_csr.c
> +++ b/drivers/gpu/drm/i915/intel_csr.c
> @@ -220,14 +220,10 @@ void intel_csr_load_program(struct
> drm_i915_private *dev_priv)
>  		return;
>  	}
>  
> -	/*
> -	 * FIXME: Firmware gets lost on S3/S4, but not when entering
> system
> -	 * standby or suspend-to-idle (which is just like forced
> runtime pm).
> -	 * Unfortunately the ACPI subsystem doesn't yet give us a
> way to
> -	 * differentiate this, hence figure it out with this hack.
> -	 */
> -	if ((!dev_priv->csr.dmc_payload) ||
> I915_READ(CSR_PROGRAM(0)))
> +	if (!dev_priv->csr.dmc_payload) {
> +		DRM_ERROR("Tried to program CSR with empty
> payload\n");
>  		return;
> +	}
>  
>  	fw_size = dev_priv->csr.dmc_fw_size;
>  	for (i = 0; i < fw_size; i++)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
index ecb7c70..ad8bc7a 100644
--- a/drivers/gpu/drm/i915/intel_csr.c
+++ b/drivers/gpu/drm/i915/intel_csr.c
@@ -220,14 +220,10 @@  void intel_csr_load_program(struct drm_i915_private *dev_priv)
 		return;
 	}
 
-	/*
-	 * FIXME: Firmware gets lost on S3/S4, but not when entering system
-	 * standby or suspend-to-idle (which is just like forced runtime pm).
-	 * Unfortunately the ACPI subsystem doesn't yet give us a way to
-	 * differentiate this, hence figure it out with this hack.
-	 */
-	if ((!dev_priv->csr.dmc_payload) || I915_READ(CSR_PROGRAM(0)))
+	if (!dev_priv->csr.dmc_payload) {
+		DRM_ERROR("Tried to program CSR with empty payload\n");
 		return;
+	}
 
 	fw_size = dev_priv->csr.dmc_fw_size;
 	for (i = 0; i < fw_size; i++)