Skip to contentSkip to conversation

drm/i915: Capture dmc firmware information before reset

PATCH New Michel Thierry 2 participants 4 messages Feb 24, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 drm/i915: Capture dmc firmware information before reset

The firmware may change between the hang and cat /sys/class/drm/card0/error

v2: if version is 0, the fw was not loaded.

---
 drivers/gpu/drm/i915/i915_drv.h       |  3 +++
 drivers/gpu/drm/i915/i915_gpu_error.c | 21 +++++++++++++++------
 2 files changed, 18 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +3 -0
index a74b87b1b5a9..47f8d5e47c8f 100644
@@ -953,6 +953,9 @@ struct i915_gpu_state {
 	u32 gab_ctl;
 	u32 gfx_mode;
 
+	/* Firmware load state */
+	u32 dmc_version;
+
 	u32 nfence;
 	u64 fence[I915_MAX_NUM_FENCES];
 	struct intel_overlay_error_state *overlay;
drivers/gpu/drm/i915/i915_gpu_error.c +15 -6
index 2b1d15668192..4e6cf705c779 100644
@@ -623,13 +623,10 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 	err_printf(m, "IOMMU enabled?: %d\n", error->iommu);
 
 	if (HAS_CSR(dev_priv)) {
-		struct intel_csr *csr = &dev_priv->csr;
-
-		err_printf(m, "DMC loaded: %s\n",
-			   yesno(csr->dmc_payload != NULL));
+		err_printf(m, "DMC loaded: %s\n", yesno(error->dmc_version));
 		err_printf(m, "DMC fw version: %d.%d\n",
-			   CSR_VERSION_MAJOR(csr->version),
-			   CSR_VERSION_MINOR(csr->version));
+			   CSR_VERSION_MAJOR(error->dmc_version),
+			   CSR_VERSION_MINOR(error->dmc_version));
 	}
 
 	err_printf(m, "EIR: 0x%08x\n", error->eir);
@@ -1585,6 +1582,17 @@ static void i915_capture_reg_state(struct drm_i915_private *dev_priv,
 	error->pgtbl_er = I915_READ(PGTBL_ER);
 }
 
+/* Capture all firmware related information. */
+static void i915_capture_fw_state(struct drm_i915_private *dev_priv,
+				  struct i915_gpu_state *error)
+{
+	if (HAS_CSR(dev_priv)) {
+		struct intel_csr *csr = &dev_priv->csr;
+
+		error->dmc_version = csr->version;
+	}
+}
+
 static void i915_error_capture_msg(struct drm_i915_private *dev_priv,
 				   struct i915_gpu_state *error,
 				   u32 engine_mask,
@@ -1650,6 +1658,7 @@ static int capture(void *data)
 
 	i915_capture_gen_state(error->i915, error);
 	i915_capture_reg_state(error->i915, error);
+	i915_capture_fw_state(error->i915, error);
 	i915_gem_record_fences(error->i915, error);
 	i915_gem_record_rings(error->i915, error);
 	i915_capture_active_buffers(error->i915, error);
Signature · 6 lines
2.11.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH v2 2/3 drm/i915: Include GuC fw version in error state

There was no way to check if the platform is running the latest firmware.

v2: use HAS_GUC and intel_guc* (Michal)
capture before reset (Chris)
v3: if version is 0, the fw was not loaded.

Cc Chris Wilson <[email protected]>
Cc Michal Wajdeczko <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
Cc Arkadiusz Hiler <[email protected]>
---
 drivers/gpu/drm/i915/i915_drv.h       |  1 +
 drivers/gpu/drm/i915/i915_gpu_error.c | 15 +++++++++++++++
 2 files changed, 16 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index 47f8d5e47c8f..37cda64f07ad 100644
@@ -955,6 +955,7 @@ struct i915_gpu_state {
 
 	/* Firmware load state */
 	u32 dmc_version;
+	u32 guc_version;
 
 	u32 nfence;
 	u64 fence[I915_MAX_NUM_FENCES];
drivers/gpu/drm/i915/i915_gpu_error.c +15 -0
index 4e6cf705c779..bb1b9e916638 100644
@@ -629,6 +629,13 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 			   CSR_VERSION_MINOR(error->dmc_version));
 	}
 
+	if (HAS_GUC(dev_priv)) {
+		err_printf(m, "GuC loaded: %s\n", yesno(error->guc_version));
+		err_printf(m, "GuC fw version: %d.%d\n",
+			   error->guc_version >> 16,
+			   error->guc_version & 0xffff);
+	}
+
 	err_printf(m, "EIR: 0x%08x\n", error->eir);
 	err_printf(m, "IER: 0x%08x\n", error->ier);
 	for (i = 0; i < error->ngtier; i++)
@@ -1591,6 +1598,14 @@ static void i915_capture_fw_state(struct drm_i915_private *dev_priv,
 
 		error->dmc_version = csr->version;
 	}
+
+	if (HAS_GUC(dev_priv)) {
+		struct intel_guc *guc = &dev_priv->guc;
+
+		error->guc_version =
+			(guc->fw.major_ver_found << 16 |
+			 guc->fw.minor_ver_found);
+	}
 }
 
 static void i915_error_capture_msg(struct drm_i915_private *dev_priv,
Signature · 6 lines
2.11.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH v2 3/3 drm/i915: Include HuC fw version in error state

In reply to Michel Thierry

HuC depends on GuC, so be it.

v2: if version is 0, the fw was not loaded.

---
 drivers/gpu/drm/i915/i915_drv.h       | 1 +
 drivers/gpu/drm/i915/i915_gpu_error.c | 9 +++++++++
 2 files changed, 10 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index 37cda64f07ad..98b78c7a012f 100644
@@ -956,6 +956,7 @@ struct i915_gpu_state {
 	/* Firmware load state */
 	u32 dmc_version;
 	u32 guc_version;
+	u32 huc_version;
 
 	u32 nfence;
 	u64 fence[I915_MAX_NUM_FENCES];
drivers/gpu/drm/i915/i915_gpu_error.c +9 -0
index bb1b9e916638..32639b1fc668 100644
@@ -634,6 +634,10 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 		err_printf(m, "GuC fw version: %d.%d\n",
 			   error->guc_version >> 16,
 			   error->guc_version & 0xffff);
+		err_printf(m, "HuC loaded: %s\n", yesno(error->huc_version));
+		err_printf(m, "HuC fw version: %d.%d\n",
+			   error->huc_version >> 16,
+			   error->huc_version & 0xffff);
 	}
 
 	err_printf(m, "EIR: 0x%08x\n", error->eir);
@@ -1601,10 +1605,15 @@ static void i915_capture_fw_state(struct drm_i915_private *dev_priv,
 
 	if (HAS_GUC(dev_priv)) {
 		struct intel_guc *guc = &dev_priv->guc;
+		struct intel_huc *huc = &dev_priv->huc;
 
 		error->guc_version =
 			(guc->fw.major_ver_found << 16 |
 			 guc->fw.minor_ver_found);
+
+		error->huc_version =
+			(huc->fw.major_ver_found << 16 |
+			 huc->fw.minor_ver_found);
 	}
 }
 
Signature · 6 lines
2.11.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

✓ Fi.CI.BAT: success for series starting with [v2,1/3] drm/i915: Capture dmc firmware information before reset

In reply to Michel Thierry
== Series Details ==

== Series Details ==

Series: series starting with [v2,1/3] drm/i915: Capture dmc firmware information before reset
URL : https://patchwork.freedesktop.org/series/20227/
State : success

== Summary ==

Series 20227v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/20227/revisions/1/mbox/

fi-bdw-5557u     total:278  pass:267  dwarn:0   dfail:0   fail:0   skip:11 
fi-bsw-n3050     total:278  pass:239  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19 
fi-bxt-t5700     total:108  pass:95   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900     total:278  pass:251  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:278  pass:247  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16 
fi-hsw-4770r     total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16 
fi-ilk-650       total:278  pass:228  dwarn:0   dfail:0   fail:0   skip:50 
fi-ivb-3520m     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18 
fi-ivb-3770      total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18 
fi-kbl-7500u     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18 
fi-skl-6260u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10 
fi-skl-6700hq    total:278  pass:261  dwarn:0   dfail:0   fail:0   skip:17 
fi-skl-6700k     total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18 
fi-skl-6770hq    total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10 
fi-snb-2520m     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28 
fi-snb-2600      total:278  pass:249  dwarn:0   dfail:0   fail:0   skip:29 

9243ada504db810aa40b0e8f5e00d46871c78149 drm-tip: 2017y-02m-24d-17h-52m-18s UTC integration manifest 6abf5d8 drm/i915: Include HuC fw version in error state
b5c143b drm/i915: Include GuC fw version in error state
70bbdae drm/i915: Capture dmc firmware information before reset

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3967/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx