aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-07-04 03:48:32 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2016-07-05 06:25:11 -0400
commit2b2842887de75c340ab427b898aa867964316d2f (patch)
tree77c82411ddd1cb24b90e5f25b69728b92cd5cbbf
parent8eb95204d926ed0c3d1d588c352adef40ed673f2 (diff)
drm/i915: Clean up GPU hang message
Remove some redundant kernel messages as we deduce a hung GPU and capture the error state. v2: Fix "hang" vs "no progress" message whilst I was there v3: s/snprintf/scnprintf/ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1467618513-4966-2-git-send-email-chris@chris-wilson.co.uk Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c41
1 files changed, 26 insertions, 15 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 2f01b0b959a1..3eadc8375449 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -3084,9 +3084,8 @@ static void i915_hangcheck_elapsed(struct work_struct *work)
3084 container_of(work, typeof(*dev_priv), 3084 container_of(work, typeof(*dev_priv),
3085 gpu_error.hangcheck_work.work); 3085 gpu_error.hangcheck_work.work);
3086 struct intel_engine_cs *engine; 3086 struct intel_engine_cs *engine;
3087 enum intel_engine_id id; 3087 unsigned int hung = 0, stuck = 0;
3088 int busy_count = 0, rings_hung = 0; 3088 int busy_count = 0;
3089 bool stuck[I915_NUM_ENGINES] = { 0 };
3090#define BUSY 1 3089#define BUSY 1
3091#define KICK 5 3090#define KICK 5
3092#define HUNG 20 3091#define HUNG 20
@@ -3104,7 +3103,7 @@ static void i915_hangcheck_elapsed(struct work_struct *work)
3104 */ 3103 */
3105 intel_uncore_arm_unclaimed_mmio_detection(dev_priv); 3104 intel_uncore_arm_unclaimed_mmio_detection(dev_priv);
3106 3105
3107 for_each_engine_id(engine, dev_priv, id) { 3106 for_each_engine(engine, dev_priv) {
3108 bool busy = intel_engine_has_waiter(engine); 3107 bool busy = intel_engine_has_waiter(engine);
3109 u64 acthd; 3108 u64 acthd;
3110 u32 seqno; 3109 u32 seqno;
@@ -3167,10 +3166,15 @@ static void i915_hangcheck_elapsed(struct work_struct *work)
3167 break; 3166 break;
3168 case HANGCHECK_HUNG: 3167 case HANGCHECK_HUNG:
3169 engine->hangcheck.score += HUNG; 3168 engine->hangcheck.score += HUNG;
3170 stuck[id] = true;
3171 break; 3169 break;
3172 } 3170 }
3173 } 3171 }
3172
3173 if (engine->hangcheck.score >= HANGCHECK_SCORE_RING_HUNG) {
3174 hung |= intel_engine_flag(engine);
3175 if (engine->hangcheck.action != HANGCHECK_HUNG)
3176 stuck |= intel_engine_flag(engine);
3177 }
3174 } else { 3178 } else {
3175 engine->hangcheck.action = HANGCHECK_ACTIVE; 3179 engine->hangcheck.action = HANGCHECK_ACTIVE;
3176 3180
@@ -3195,17 +3199,24 @@ static void i915_hangcheck_elapsed(struct work_struct *work)
3195 busy_count += busy; 3199 busy_count += busy;
3196 } 3200 }
3197 3201
3198 for_each_engine_id(engine, dev_priv, id) { 3202 if (hung) {
3199 if (engine->hangcheck.score >= HANGCHECK_SCORE_RING_HUNG) { 3203 char msg[80];
3200 DRM_INFO("%s on %s\n", 3204 int len;
3201 stuck[id] ? "stuck" : "no progress",
3202 engine->name);
3203 rings_hung |= intel_engine_flag(engine);
3204 }
3205 }
3206 3205
3207 if (rings_hung) 3206 /* If some rings hung but others were still busy, only
3208 i915_handle_error(dev_priv, rings_hung, "Engine(s) hung"); 3207 * blame the hanging rings in the synopsis.
3208 */
3209 if (stuck != hung)
3210 hung &= ~stuck;
3211 len = scnprintf(msg, sizeof(msg),
3212 "%s on ", stuck == hung ? "No progress" : "Hang");
3213 for_each_engine_masked(engine, dev_priv, hung)
3214 len += scnprintf(msg + len, sizeof(msg) - len,
3215 "%s, ", engine->name);
3216 msg[len-2] = '\0';
3217
3218 return i915_handle_error(dev_priv, hung, msg);
3219 }
3209 3220
3210 /* Reset timer in case GPU hangs without another request being added */ 3221 /* Reset timer in case GPU hangs without another request being added */
3211 if (busy_count) 3222 if (busy_count)