[PATCH 2/2] HAX wip debugging + messages for igt analysis
Alan Previn
alan.previn.teres.alexis at intel.com
Wed Sep 21 09:39:09 UTC 2022
HAX wip debugging + messages for igt analysis
---
drivers/gpu/drm/i915/gt/uc/intel_guc.h | 12 +++++++++++-
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 9 +++++++++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
index 357873ef692b..9aff45ddd5d7 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
@@ -294,6 +294,8 @@ intel_guc_send_and_receive(struct intel_guc *guc, const u32 *action, u32 len,
response_buf, response_buf_size, 0);
}
+bool guc_in_reset(struct intel_guc *guc);
+
static inline int intel_guc_send_busy_loop(struct intel_guc *guc,
const u32 *action,
u32 len,
@@ -303,6 +305,7 @@ static inline int intel_guc_send_busy_loop(struct intel_guc *guc,
int err;
unsigned int sleep_period_ms = 1;
bool not_atomic = !in_atomic() && !irqs_disabled();
+ static int caller_count = 0;
/*
* FIXME: Have caller pass in if we are in an atomic context to avoid
@@ -313,8 +316,15 @@ static inline int intel_guc_send_busy_loop(struct intel_guc *guc,
/* No sleeping with spin locks, just busy loop */
might_sleep_if(loop && not_atomic);
-
+ ++caller_count;
retry:
+ if (sleep_period_ms > 100) {
+ DRM_WARN("ALANPREVIN caller-%d, sleeping for %d milisecs in send-busy-loop\n",
+ caller_count, sleep_period_ms);
+ if (guc_in_reset(guc))
+ DRM_WARN("ALANPREVIN mid reset send-busy-loop action=%#x\n", *action);
+ }
+
err = intel_guc_send_nb(guc, action, len, g2h_len_dw);
if (unlikely(err == -EBUSY && loop)) {
if (likely(not_atomic)) {
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
index db5681274965..e25d51ba3c37 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
@@ -414,6 +414,15 @@ static inline struct i915_priolist *to_priolist(struct rb_node *rb)
return rb_entry(rb, struct i915_priolist, node);
}
+bool guc_in_reset(struct intel_guc *guc)
+{
+ struct intel_uc *uc = container_of(guc, struct intel_uc, guc);
+
+ if (uc->reset_in_progress)
+ return true;
+ return false;
+}
+
/*
* When using multi-lrc submission a scratch memory area is reserved in the
* parent's context state for the process descriptor, work queue, and handshake
--
2.25.1
More information about the Intel-gfx-trybot
mailing list