Skip to contentSkip to conversation

drm/i915: Add gen to the gpu hang ecode

PATCH In review Mika Kuoppala 3 participants 6 messages Nov 6, 2014 – Nov 7, 2014

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

PATCH 1/2 drm/i915: Add gen to the gpu hang ecode

for the Brothers in Triage

---
 drivers/gpu/drm/i915/i915_gpu_error.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gpu_error.c +2 -1
index d17360b..89a2f3d 100644
@@ -1242,7 +1242,8 @@ static void i915_error_capture_msg(struct drm_device *dev,
 	ecode = i915_error_generate_code(dev_priv, error, &ring_id);
 
 	len = scnprintf(error->error_msg, sizeof(error->error_msg),
-			"GPU HANG: ecode %d:0x%08x", ring_id, ecode);
+			"GPU HANG: ecode %d:%d:0x%08x",
+			INTEL_INFO(dev)->gen, ring_id, ecode);
 
 	if (ring_id != -1 && error->ring[ring_id].pid != -1)
 		len += scnprintf(error->error_msg + len,
Signature · 6 lines
1.9.1

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

PATCH 2/2 drm/i915: Capture module params on hang

as it helps with bug triaging.

---
 drivers/gpu/drm/i915/i915_drv.h       |  1 +
 drivers/gpu/drm/i915/i915_gpu_error.c | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index 0f00e58..c0ae57c 100644
@@ -339,6 +339,7 @@ struct drm_i915_error_state {
 	struct timeval time;
 
 	char error_msg[128];
+	char module_params_msg[1024];
 	u32 reset_count;
 	u32 suspend_count;
 
drivers/gpu/drm/i915/i915_gpu_error.c +32 -0
index 89a2f3d..c5e55b3 100644
@@ -342,6 +342,7 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 	err_printf(m, "Time: %ld s %ld us\n", error->time.tv_sec,
 		   error->time.tv_usec);
 	err_printf(m, "Kernel: " UTS_RELEASE "\n");
+	err_printf(m, "Module params: %s\n", error->module_params_msg);
 	max_hangcheck_score = 0;
 	for (i = 0; i < ARRAY_SIZE(error->ring); i++) {
 		if (error->ring[i].hangcheck_score > max_hangcheck_score)
@@ -1258,6 +1259,34 @@ static void i915_error_capture_msg(struct drm_device *dev,
 		  wedged ? "reset" : "continue");
 }
 
+static void i915_error_capture_module_params(struct drm_i915_error_state *error)
+{
+	const struct module *m = THIS_MODULE;
+	int i, len;
+	char *buf;
+
+	if (!m)
+		return;
+
+	buf = kmalloc(4096, GFP_ATOMIC);
+	if (buf == NULL)
+		return;
+
+	for (i = 0, len = 0; i < m->num_kp; i++) {
+		if (!m->kp[i].ops || !m->kp[i].ops->get ||
+		    m->kp[i].ops->get(buf, &m->kp[i]) <= 0)
+			continue;
+
+		len += scnprintf(error->module_params_msg + len,
+				 sizeof(error->module_params_msg) - len,
+				 "%s=%s ",
+				 m->kp[i].name,
+				 buf);
+	}
+
+	kfree(buf);
+}
+
 static void i915_capture_gen_state(struct drm_i915_private *dev_priv,
 				   struct drm_i915_error_state *error)
 {
@@ -1303,7 +1332,10 @@ void i915_capture_error_state(struct drm_device *dev, bool wedged,
 	error->display = intel_display_capture_error_state(dev);
 
 	i915_error_capture_msg(dev, error, wedged, error_msg);
+	i915_error_capture_module_params(error);
+
 	DRM_INFO("%s\n", error->error_msg);
+	DRM_INFO("%s\n", error->module_params_msg);
 
 	spin_lock_irqsave(&dev_priv->gpu_error.lock, flags);
 	if (dev_priv->gpu_error.first_error == NULL) {
Signature · 6 lines
1.9.1

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

Re: [PATCH 2/2] drm/i915: Capture module params on hang

Quoted 37 lines · Mika Kuoppala

as it helps with bug triaging.

---
 drivers/gpu/drm/i915/i915_drv.h       |  1 +
 drivers/gpu/drm/i915/i915_gpu_error.c | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index 0f00e58..c0ae57c 100644
@@ -339,6 +339,7 @@ struct drm_i915_error_state {
 	struct timeval time;
 
 	char error_msg[128];
+	char module_params_msg[1024];
 	u32 reset_count;
 	u32 suspend_count;
 
drivers/gpu/drm/i915/i915_gpu_error.c +1 -0
index 89a2f3d..c5e55b3 100644
@@ -342,6 +342,7 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 	err_printf(m, "Time: %ld s %ld us\n", error->time.tv_sec,
 		   error->time.tv_usec);
 	err_printf(m, "Kernel: " UTS_RELEASE "\n");
+	err_printf(m, "Module params: %s\n", error->module_params_msg);
 	max_hangcheck_score = 0;
 	for (i = 0; i < ARRAY_SIZE(error->ring); i++) {
 		if (error->ring[i].hangcheck_score > max_hangcheck_score)
@@ -1258,6 +1259,34 @@ static void i915_error_capture_msg(struct drm_device *dev,
 		  wedged ? "reset" : "continue");
 }
 

drivers/gpu/drm/i915/i915_gpu_error.c static void i915_error_capture_msg(struct drm_device *dev, · line 1271

Quoted 10 lines
drivers/gpu/drm/i915/i915_gpu_error.c +10 -0
+static void i915_error_capture_module_params(struct drm_i915_error_state *error)
+{
+	const struct module *m = THIS_MODULE;
+	int i, len;
+	char *buf;
+
+	if (!m)
+		return;
+
+	buf = kmalloc(4096, GFP_ATOMIC);

Better to express this as PAGE_SIZE like kernel/module.c does.

drivers/gpu/drm/i915/i915_gpu_error.c void i915_capture_error_state(struct drm_device *dev, bool wedged, · line 1338

Quoted 11 lines
drivers/gpu/drm/i915/i915_gpu_error.c +3 -0
 static void i915_capture_gen_state(struct drm_i915_private *dev_priv,
 				   struct drm_i915_error_state *error)
 {
@@ -1303,7 +1332,10 @@ void i915_capture_error_state(struct drm_device *dev, bool wedged,
 	error->display = intel_display_capture_error_state(dev);
 
 	i915_error_capture_msg(dev, error, wedged, error_msg);
+	i915_error_capture_module_params(error);
+
 	DRM_INFO("%s\n", error->error_msg);
+	DRM_INFO("%s\n", error->module_params_msg);

Just add it to the error state, not the dmesg every single time. -Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH 2/2 drm/i915: Capture module params on hang

as it helps with bug triaging.

v2: Use PAGE_SIZE on alloc, don't spam to dmesg (Chris Wilson)

---
 drivers/gpu/drm/i915/i915_drv.h       |  1 +
 drivers/gpu/drm/i915/i915_gpu_error.c | 31 +++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index 0f00e58..c0ae57c 100644
@@ -339,6 +339,7 @@ struct drm_i915_error_state {
 	struct timeval time;
 
 	char error_msg[128];
+	char module_params_msg[1024];
 	u32 reset_count;
 	u32 suspend_count;
 
drivers/gpu/drm/i915/i915_gpu_error.c +31 -0
index 89a2f3d..5f5735b 100644
@@ -342,6 +342,7 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 	err_printf(m, "Time: %ld s %ld us\n", error->time.tv_sec,
 		   error->time.tv_usec);
 	err_printf(m, "Kernel: " UTS_RELEASE "\n");
+	err_printf(m, "Module params: %s\n", error->module_params_msg);
 	max_hangcheck_score = 0;
 	for (i = 0; i < ARRAY_SIZE(error->ring); i++) {
 		if (error->ring[i].hangcheck_score > max_hangcheck_score)
@@ -1258,6 +1259,34 @@ static void i915_error_capture_msg(struct drm_device *dev,
 		  wedged ? "reset" : "continue");
 }
 
+static void i915_error_capture_module_params(struct drm_i915_error_state *error)
+{
+	const struct module *m = THIS_MODULE;
+	int i, len;
+	char *buf;
+
+	if (!m)
+		return;
+
+	buf = kmalloc(PAGE_SIZE, GFP_ATOMIC);
+	if (buf == NULL)
+		return;
+
+	for (i = 0, len = 0; i < m->num_kp; i++) {
+		if (!m->kp[i].ops || !m->kp[i].ops->get ||
+		    m->kp[i].ops->get(buf, &m->kp[i]) <= 0)
+			continue;
+
+		len += scnprintf(error->module_params_msg + len,
+				 sizeof(error->module_params_msg) - len,
+				 "%s=%s ",
+				 m->kp[i].name,
+				 buf);
+	}
+
+	kfree(buf);
+}
+
 static void i915_capture_gen_state(struct drm_i915_private *dev_priv,
 				   struct drm_i915_error_state *error)
 {
@@ -1303,6 +1332,8 @@ void i915_capture_error_state(struct drm_device *dev, bool wedged,
 	error->display = intel_display_capture_error_state(dev);
 
 	i915_error_capture_msg(dev, error, wedged, error_msg);
+	i915_error_capture_module_params(error);
+
 	DRM_INFO("%s\n", error->error_msg);
 
 	spin_lock_irqsave(&dev_priv->gpu_error.lock, flags);
Signature · 6 lines
1.9.1

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

Re: [PATCH 2/2] drm/i915: Capture module params on hang

In reply to Chris Wilson
Quoted 11 lines · Chris Wilson

drivers/gpu/drm/i915/i915_gpu_error.c void i915_capture_error_state(struct drm_device *dev, bool wedged, · line 1338

Quoted 8 lines · Mika Kuoppala
drivers/gpu/drm/i915/i915_gpu_error.c +3 -0
@@ -1303,7 +1332,10 @@ void i915_capture_error_state(struct drm_device *dev, bool wedged,
 	error->display = intel_display_capture_error_state(dev);
 
 	i915_error_capture_msg(dev, error, wedged, error_msg);
+	i915_error_capture_module_params(error);
+
 	DRM_INFO("%s\n", error->error_msg);
+	DRM_INFO("%s\n", error->module_params_msg);

Just add it to the error state, not the dmesg every single time.

Yeah I think this might be better in the error state. It's not that important to triage most bugs at least I think, and we already print a lot of stuff into dmesg that everyone seems to ignore ;-)
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw
In reply to Mika Kuoppala
Quoted 12 lines · Mika Kuoppala

for the Brothers in Triage

---
 drivers/gpu/drm/i915/i915_gpu_error.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gpu_error.c +0 -0
index d17360b..89a2f3d 100644

drivers/gpu/drm/i915/i915_gpu_error.c static void i915_error_capture_msg(struct drm_device *dev, · line 1246

Quoted 6 lines
drivers/gpu/drm/i915/i915_gpu_error.c +2 -1
@@ -1242,7 +1242,8 @@ static void i915_error_capture_msg(struct drm_device *dev,
 	ecode = i915_error_generate_code(dev_priv, error, &ring_id);
 
 	len = scnprintf(error->error_msg, sizeof(error->error_msg),
-			"GPU HANG: ecode %d:0x%08x", ring_id, ecode);
+			"GPU HANG: ecode %d:%d:0x%08x",
+			INTEL_INFO(dev)->gen, ring_id, ecode);

Well, can I have gen.subgen? Oh, if only we tracked it thus. -Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx