diff mbox

[3/7] drm/i915/skl: Refuse to load outdated dmc firmware

Message ID 1445520661-17819-1-git-send-email-mika.kuoppala@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mika Kuoppala Oct. 22, 2015, 1:31 p.m. UTC
There is known issue on GT interrupt delivery with DC6 and
firmwares <1.21. There is a suspicion that this causes
spurious gpu hangs on driver init and with some workloads,
as upgrading the firmware to 1.21 makes these problems
disappear.

As of now the current version included in distribution
firmware packages is very like to be 1.19. Play it safe and
refuse to load a firmware version that may affect gpu
side stability.

With < 1.23 there is a palette and dmc ram corruption issue
so blacklist anything below that.

v2: Refuse to load fw instead of notifying the user
v3: Rebase on header version changes
v4: Refuse to load anything less than 1.23
v5: Give enough information for user for finding correct fw (Chris)

Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Dave Gordon <david.s.gordon@intel.com>
Cc: Arun Siluvery <arun.siluvery@linux.intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
References: https://01.org/linuxgraphics/downloads/skldmcver121
References: https://01.org/linuxgraphics/downloads/skylake-dmc-1.23
Testcase: igt/gem_exec_nop
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/intel_csr.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

Chris Wilson Oct. 22, 2015, 1:48 p.m. UTC | #1
On Thu, Oct 22, 2015 at 04:31:01PM +0300, Mika Kuoppala wrote:
> There is known issue on GT interrupt delivery with DC6 and
> firmwares <1.21. There is a suspicion that this causes
> spurious gpu hangs on driver init and with some workloads,
> as upgrading the firmware to 1.21 makes these problems
> disappear.
> 
> As of now the current version included in distribution
> firmware packages is very like to be 1.19. Play it safe and
> refuse to load a firmware version that may affect gpu
> side stability.
> 
> With < 1.23 there is a palette and dmc ram corruption issue
> so blacklist anything below that.
> 
> v2: Refuse to load fw instead of notifying the user
> v3: Rebase on header version changes
> v4: Refuse to load anything less than 1.23
> v5: Give enough information for user for finding correct fw (Chris)
> 
> Cc: Animesh Manna <animesh.manna@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Dave Gordon <david.s.gordon@intel.com>
> Cc: Arun Siluvery <arun.siluvery@linux.intel.com>
> Cc: Imre Deak <imre.deak@intel.com>
> Cc: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@gmail.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> References: https://01.org/linuxgraphics/downloads/skldmcver121
> References: https://01.org/linuxgraphics/downloads/skylake-dmc-1.23
> Testcase: igt/gem_exec_nop
> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_csr.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
> index cabcc51..8004b6d 100644
> --- a/drivers/gpu/drm/i915/intel_csr.c
> +++ b/drivers/gpu/drm/i915/intel_csr.c
> @@ -47,6 +47,9 @@
>  MODULE_FIRMWARE(I915_CSR_SKL);
>  MODULE_FIRMWARE(I915_CSR_BXT);
>  
> +#define SKL_REQUIRED_FW_MAJOR	1
> +#define SKL_REQUIRED_FW_MINOR	23
> +
>  /*
>  * SKL CSR registers for DC5 and DC6
>  */
> @@ -401,6 +404,18 @@ static void finish_csr_load(const struct firmware *fw, void *context)
>  	dmc_payload = csr->dmc_payload;
>  	memcpy(dmc_payload, &fw->data[readcount], nbytes);
>  
> +	if (IS_SKYLAKE(dev) &&
> +	    (CSR_VERSION_MAJOR(csr->version) < SKL_REQUIRED_FW_MAJOR ||
> +	     CSR_VERSION_MINOR(csr->version) < SKL_REQUIRED_FW_MINOR)) {
> +		DRM_INFO("Refusing to load outdated DMC firmware v%u.%u\n",
> +			 CSR_VERSION_MAJOR(csr->version),
> +			 CSR_VERSION_MINOR(csr->version));
> +		DRM_INFO("Please upgrade to Skylake DMC - %u.%u or newer\n",
> +			 SKL_REQUIRED_FW_MAJOR, SKL_REQUIRED_FW_MINOR);
> +		DRM_INFO("https://01.org/linuxgraphics/downloads\n");

Just what I mentioned on IRC, I think it is best if this is presented to
the user as a single info block *, and perhaps
https://01.org/linuxgraphics/intel-linux-graphics-firmwares
is a slightly more useful link?

* "Refusing to load old Skylake DMC firmware v%u.%u,"
" please upgrade to %u.%u or later"
" [https://01.org/linuxgraphics/intel-linux-graphics-firmwares]."
-Chris
Chris Wilson Oct. 22, 2015, 1:56 p.m. UTC | #2
On Thu, Oct 22, 2015 at 02:48:31PM +0100, Chris Wilson wrote:
> On Thu, Oct 22, 2015 at 04:31:01PM +0300, Mika Kuoppala wrote:
> > There is known issue on GT interrupt delivery with DC6 and
> > firmwares <1.21. There is a suspicion that this causes
> > spurious gpu hangs on driver init and with some workloads,
> > as upgrading the firmware to 1.21 makes these problems
> > disappear.
> > 
> > As of now the current version included in distribution
> > firmware packages is very like to be 1.19. Play it safe and
> > refuse to load a firmware version that may affect gpu
> > side stability.
> > 
> > With < 1.23 there is a palette and dmc ram corruption issue
> > so blacklist anything below that.
> > 
> > v2: Refuse to load fw instead of notifying the user
> > v3: Rebase on header version changes
> > v4: Refuse to load anything less than 1.23
> > v5: Give enough information for user for finding correct fw (Chris)
> > 
> > Cc: Animesh Manna <animesh.manna@intel.com>
> > Cc: Jani Nikula <jani.nikula@linux.intel.com>
> > Cc: Dave Gordon <david.s.gordon@intel.com>
> > Cc: Arun Siluvery <arun.siluvery@linux.intel.com>
> > Cc: Imre Deak <imre.deak@intel.com>
> > Cc: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
> > Cc: Rodrigo Vivi <rodrigo.vivi@gmail.com>
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > References: https://01.org/linuxgraphics/downloads/skldmcver121
> > References: https://01.org/linuxgraphics/downloads/skylake-dmc-1.23
> > Testcase: igt/gem_exec_nop
> > Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_csr.c | 15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
> > index cabcc51..8004b6d 100644
> > --- a/drivers/gpu/drm/i915/intel_csr.c
> > +++ b/drivers/gpu/drm/i915/intel_csr.c
> > @@ -47,6 +47,9 @@
> >  MODULE_FIRMWARE(I915_CSR_SKL);
> >  MODULE_FIRMWARE(I915_CSR_BXT);
> >  
> > +#define SKL_REQUIRED_FW_MAJOR	1
> > +#define SKL_REQUIRED_FW_MINOR	23
> > +
> >  /*
> >  * SKL CSR registers for DC5 and DC6
> >  */
> > @@ -401,6 +404,18 @@ static void finish_csr_load(const struct firmware *fw, void *context)
> >  	dmc_payload = csr->dmc_payload;
> >  	memcpy(dmc_payload, &fw->data[readcount], nbytes);
> >  
> > +	if (IS_SKYLAKE(dev) &&
> > +	    (CSR_VERSION_MAJOR(csr->version) < SKL_REQUIRED_FW_MAJOR ||
> > +	     CSR_VERSION_MINOR(csr->version) < SKL_REQUIRED_FW_MINOR)) {
> > +		DRM_INFO("Refusing to load outdated DMC firmware v%u.%u\n",
> > +			 CSR_VERSION_MAJOR(csr->version),
> > +			 CSR_VERSION_MINOR(csr->version));
> > +		DRM_INFO("Please upgrade to Skylake DMC - %u.%u or newer\n",
> > +			 SKL_REQUIRED_FW_MAJOR, SKL_REQUIRED_FW_MINOR);
> > +		DRM_INFO("https://01.org/linuxgraphics/downloads\n");
> 
> Just what I mentioned on IRC, I think it is best if this is presented to
> the user as a single info block *, and perhaps
> https://01.org/linuxgraphics/intel-linux-graphics-firmwares
> is a slightly more useful link?
> 
> * "Refusing to load old Skylake DMC firmware v%u.%u,"
> " please upgrade to %u.%u or later"

Note we should be consistent with v%u.%u usage as well.
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
index cabcc51..8004b6d 100644
--- a/drivers/gpu/drm/i915/intel_csr.c
+++ b/drivers/gpu/drm/i915/intel_csr.c
@@ -47,6 +47,9 @@ 
 MODULE_FIRMWARE(I915_CSR_SKL);
 MODULE_FIRMWARE(I915_CSR_BXT);
 
+#define SKL_REQUIRED_FW_MAJOR	1
+#define SKL_REQUIRED_FW_MINOR	23
+
 /*
 * SKL CSR registers for DC5 and DC6
 */
@@ -401,6 +404,18 @@  static void finish_csr_load(const struct firmware *fw, void *context)
 	dmc_payload = csr->dmc_payload;
 	memcpy(dmc_payload, &fw->data[readcount], nbytes);
 
+	if (IS_SKYLAKE(dev) &&
+	    (CSR_VERSION_MAJOR(csr->version) < SKL_REQUIRED_FW_MAJOR ||
+	     CSR_VERSION_MINOR(csr->version) < SKL_REQUIRED_FW_MINOR)) {
+		DRM_INFO("Refusing to load outdated DMC firmware v%u.%u\n",
+			 CSR_VERSION_MAJOR(csr->version),
+			 CSR_VERSION_MINOR(csr->version));
+		DRM_INFO("Please upgrade to Skylake DMC - %u.%u or newer\n",
+			 SKL_REQUIRED_FW_MAJOR, SKL_REQUIRED_FW_MINOR);
+		DRM_INFO("https://01.org/linuxgraphics/downloads\n");
+		goto out;
+	}
+
 	/* load csr program during system boot, as needed for DC states */
 	intel_csr_load_program(dev);
 	fw_loaded = true;