Skip to contentSkip to conversation

GuC submission support

PATCH In review Matthew Brost 10 participants 170 messages Jun 24, 2021 – Oct 27, 2021 Page 3 of 3

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

Re: [Intel-gfx] [PATCH 31/47] drm/i915/guc: Reset implementation for new GuC interface

In reply to Tvrtko Ursulin
Quoted 42 lines · Tvrtko Ursulin
Quoted 32 lines · Matthew Brost
Quoted 12 lines · Tvrtko Ursulin
Quoted 9 lines · Matthew Brost

Reset implementation for new GuC interface. This is the legacy reset implementation which is called when the i915 owns the engine hang check. Future patches will offload the engine hang check to GuC but we will continue to maintain this legacy path as a fallback and this code path is also required if the GuC dies.

With the new GuC interface it is not possible to reset individual engines - it is only possible to reset the GPU entirely. This patch forces an entire chip reset if any engine hangs.

Quoted 6 lines

No updates after my review comments on 6th of May.

At least:

1. wmb documentation

Yea, missed this. Checkpatch yelled at me too. Will be fixed in next rev.

Quoted 5 lines

2. Spin lock cycling I either didn't understand or didn't buy the explanation. I don't remember seeing that pattern elsewhere in the driver - cycle a spinlock to make sure what was updated inside it is visible you said?

I did respond - not really my fault if you don't understand a fairly simple concept but I'll explain again.

Quoted 7 lines

Change a variable
Cycle a lock
At this point we know anyone that acquires above lock the variable change is visible.

I can't be the first person in the Linux kernel to do this nor in the i915.

Quoted 9 lines

Don't know, did not do an exhaustive search. I can understand it being used to make sure any lock taking sections would exit, if they happened to be running simultaneously to the lock cycling code, but you seem to be describing it being used as a memory barrier.

So either a code comment or just use a memory barrier is my ask. There is a requirement to comment memory barriers anyway so if this is effectively one of them it's pretty clear cut.

This more than a memory barrier, not just ensuring that variable change is visible but any actions before the change was visible are complete.

Quoted 12 lines
Quoted 12 lines

This basically allows to seal all the reset races without a BKL.

Also I told you I explain in this a doc patch that will get reposted after GuC submission lands:
https://patchwork.freedesktop.org/patch/432408/?series=89844&rev=1

Quoted 5 lines

3. Dropping the lock protecting the list in the middle of list_for_each_entry_safe and just continuing to iterate like nothing happened. (__unwind_incomplete_requests) Again, perhaps I did not understand your explanation properly but you did appear to write:

Quoted 6 lines
Quoted 3 lines

To be honest looking at the code now we likely don't need to drop the look but regardless I don't think we should change this for the following reasons.

Then don't?

Ok, let me write this down and do this in an immediate follow up after some thorough testing.

Matt

Quoted 1,396 lines
Quoted 2 lines

1. I assure you this is safe and works. I can add a better comment explaining this though.

Yes please for a comment. Assurances are all good until a new bug is found.

Quoted 2 lines

2. This is thoroughly tested and resets are the hardest thing to get stable and working.

Well new bugs are found even after statements of things being well tested so I'd err on the side of caution. And I don't mean your code here but as a general principle.

Quoted 3 lines

3. This code is literally going to get deleted when we move to the DRM scheduler as all the tracking / unwinding / resubmission will be in the DRM scheduler core.

Yeah, but if that cannot be guaranteed to happen in the same kernel release then lets not put dodgy code in.

Quoted 2 lines

4. A 2 second search of the driver found that we do the same thing in intel_gt_retire_requests_timeout so this isn't unprecedented.

The code there is bit different. It uses list_safe_reset_next after re-acquiring the lock and only then unlinks the current element from the list.

It all boils down to whether something can modify the list in parallel in your case. If it can't, just don't take the lock but instead put a comment saying why the lock does not need to be taken would be my suggestion. That way you avoid having to explain why the iteration is not broken.

Regards,

Tvrtko

Quoted 1,361 lines

Matt

Quoted 1,358 lines

"""
We only need the active lock for ce->guc_active.requests list. It is indeed safe to drop the lock.
"""

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +11 -0
+	spin_lock(&ce->guc_active.lock);
+	list_for_each_entry_safe(rq, rn,
+				 &ce->guc_active.requests,
+				 sched.link) {
+		if (i915_request_completed(rq))
+			continue;
+
+		list_del_init(&rq->sched.link);
+		spin_unlock(&ce->guc_active.lock);
...
+		spin_lock(&ce->guc_active.lock);
+	}

Safe iterator guards against list_del but dropping the lock means the state of the overall list can change so next pointer may or may not be valid, requests may be missed, I don't know. Needs a comment explaining why it is safe.

Regards,

Tvrtko

Quoted 1,331 lines
---
   drivers/gpu/drm/i915/gt/intel_context.c       |   3 +
   drivers/gpu/drm/i915/gt/intel_context_types.h |   7 +
   drivers/gpu/drm/i915/gt/intel_engine_types.h  |   6 +
   .../drm/i915/gt/intel_execlists_submission.c  |  40 ++
   drivers/gpu/drm/i915/gt/intel_gt_pm.c         |   6 +-
   drivers/gpu/drm/i915/gt/intel_reset.c         |  18 +-
   .../gpu/drm/i915/gt/intel_ring_submission.c   |  22 +
   drivers/gpu/drm/i915/gt/mock_engine.c         |  31 +
   drivers/gpu/drm/i915/gt/uc/intel_guc.c        |  13 -
   drivers/gpu/drm/i915/gt/uc/intel_guc.h        |   8 +-
   .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 581 ++++++++++++++----
   drivers/gpu/drm/i915/gt/uc/intel_uc.c         |  39 +-
   drivers/gpu/drm/i915/gt/uc/intel_uc.h         |   3 +
   drivers/gpu/drm/i915/i915_request.c           |  41 +-
   drivers/gpu/drm/i915/i915_request.h           |   2 +
   15 files changed, 649 insertions(+), 171 deletions(-)
drivers/gpu/drm/i915/gt/intel_context.c +3 -0
index b24a1b7a3f88..2f01437056a8 100644
@@ -392,6 +392,9 @@ intel_context_init(struct intel_context *ce, struct intel_engine_cs *engine)
   	spin_lock_init(&ce->guc_state.lock);
   	INIT_LIST_HEAD(&ce->guc_state.fences);
+	spin_lock_init(&ce->guc_active.lock);
+	INIT_LIST_HEAD(&ce->guc_active.requests);
+
   	ce->guc_id = GUC_INVALID_LRC_ID;
   	INIT_LIST_HEAD(&ce->guc_id_link);
drivers/gpu/drm/i915/gt/intel_context_types.h +7 -0
index 6945963a31ba..b63c8cf7823b 100644
@@ -165,6 +165,13 @@ struct intel_context {
   		struct list_head fences;
   	} guc_state;
+	struct {
+		/** lock: protects everything in guc_active */
+		spinlock_t lock;
+		/** requests: active requests on this context */
+		struct list_head requests;
+	} guc_active;
+
   	/* GuC scheduling state that does not require a lock. */
   	atomic_t guc_sched_state_no_lock;
drivers/gpu/drm/i915/gt/intel_engine_types.h +6 -0
index e7cb6a06db9d..f9d264c008e8 100644
@@ -426,6 +426,12 @@ struct intel_engine_cs {
   	void		(*release)(struct intel_engine_cs *engine);
+	/*
+	 * Add / remove request from engine active tracking
+	 */
+	void		(*add_active_request)(struct i915_request *rq);
+	void		(*remove_active_request)(struct i915_request *rq);
+
   	struct intel_engine_execlists execlists;
   	/*
drivers/gpu/drm/i915/gt/intel_execlists_submission.c +40 -0
index c10ea6080752..c301a2d088b1 100644
@@ -3118,6 +3118,42 @@ static void execlists_park(struct intel_engine_cs *engine)
   	cancel_timer(&engine->execlists.preempt);
   }
+static void add_to_engine(struct i915_request *rq)
+{
+	lockdep_assert_held(&rq->engine->sched_engine->lock);
+	list_move_tail(&rq->sched.link, &rq->engine->sched_engine->requests);
+}
+
+static void remove_from_engine(struct i915_request *rq)
+{
+	struct intel_engine_cs *engine, *locked;
+
+	/*
+	 * Virtual engines complicate acquiring the engine timeline lock,
+	 * as their rq->engine pointer is not stable until under that
+	 * engine lock. The simple ploy we use is to take the lock then
+	 * check that the rq still belongs to the newly locked engine.
+	 */
+	locked = READ_ONCE(rq->engine);
+	spin_lock_irq(&locked->sched_engine->lock);
+	while (unlikely(locked != (engine = READ_ONCE(rq->engine)))) {
+		spin_unlock(&locked->sched_engine->lock);
+		spin_lock(&engine->sched_engine->lock);
+		locked = engine;
+	}
+	list_del_init(&rq->sched.link);
+
+	clear_bit(I915_FENCE_FLAG_PQUEUE, &rq->fence.flags);
+	clear_bit(I915_FENCE_FLAG_HOLD, &rq->fence.flags);
+
+	/* Prevent further __await_execution() registering a cb, then flush */
+	set_bit(I915_FENCE_FLAG_ACTIVE, &rq->fence.flags);
+
+	spin_unlock_irq(&locked->sched_engine->lock);
+
+	i915_request_notify_execute_cb_imm(rq);
+}
+
   static bool can_preempt(struct intel_engine_cs *engine)
   {
   	if (GRAPHICS_VER(engine->i915) > 8)
@@ -3218,6 +3254,8 @@ logical_ring_default_vfuncs(struct intel_engine_cs *engine)
   	engine->cops = &execlists_context_ops;
   	engine->request_alloc = execlists_request_alloc;
   	engine->bump_serial = execlist_bump_serial;
+	engine->add_active_request = add_to_engine;
+	engine->remove_active_request = remove_from_engine;
   	engine->reset.prepare = execlists_reset_prepare;
   	engine->reset.rewind = execlists_reset_rewind;
@@ -3912,6 +3950,8 @@ execlists_create_virtual(struct intel_engine_cs **siblings, unsigned int count)
   			 "v%dx%d", ve->base.class, count);
   		ve->base.context_size = sibling->context_size;
+		ve->base.add_active_request = sibling->add_active_request;
+		ve->base.remove_active_request = sibling->remove_active_request;
   		ve->base.emit_bb_start = sibling->emit_bb_start;
   		ve->base.emit_flush = sibling->emit_flush;
   		ve->base.emit_init_breadcrumb = sibling->emit_init_breadcrumb;
drivers/gpu/drm/i915/gt/intel_gt_pm.c +4 -2
index aef3084e8b16..463a6ae605a0 100644
@@ -174,8 +174,6 @@ static void gt_sanitize(struct intel_gt *gt, bool force)
   	if (intel_gt_is_wedged(gt))
   		intel_gt_unset_wedged(gt);
-	intel_uc_sanitize(&gt->uc);
-
   	for_each_engine(engine, gt, id)
   		if (engine->reset.prepare)
   			engine->reset.prepare(engine);
@@ -191,6 +189,8 @@ static void gt_sanitize(struct intel_gt *gt, bool force)
   			__intel_engine_reset(engine, false);
   	}
+	intel_uc_reset(&gt->uc, false);
+
   	for_each_engine(engine, gt, id)
   		if (engine->reset.finish)
   			engine->reset.finish(engine);
@@ -243,6 +243,8 @@ int intel_gt_resume(struct intel_gt *gt)
   		goto err_wedged;
   	}
+	intel_uc_reset_finish(&gt->uc);
+
   	intel_rps_enable(&gt->rps);
   	intel_llc_enable(&gt->llc);
drivers/gpu/drm/i915/gt/intel_reset.c +12 -6
index 72251638d4ea..2987282dff6d 100644
@@ -826,6 +826,8 @@ static int gt_reset(struct intel_gt *gt, intel_engine_mask_t stalled_mask)
   		__intel_engine_reset(engine, stalled_mask & engine->mask);
   	local_bh_enable();
+	intel_uc_reset(&gt->uc, true);
+
   	intel_ggtt_restore_fences(gt->ggtt);
   	return err;
@@ -850,6 +852,8 @@ static void reset_finish(struct intel_gt *gt, intel_engine_mask_t awake)
   		if (awake & engine->mask)
   			intel_engine_pm_put(engine);
   	}
+
+	intel_uc_reset_finish(&gt->uc);
   }
   static void nop_submit_request(struct i915_request *request)
@@ -903,6 +907,7 @@ static void __intel_gt_set_wedged(struct intel_gt *gt)
   	for_each_engine(engine, gt, id)
   		if (engine->reset.cancel)
   			engine->reset.cancel(engine);
+	intel_uc_cancel_requests(&gt->uc);
   	local_bh_enable();
   	reset_finish(gt, awake);
@@ -1191,6 +1196,9 @@ int __intel_engine_reset_bh(struct intel_engine_cs *engine, const char *msg)
   	ENGINE_TRACE(engine, "flags=%lx\n", gt->reset.flags);
   	GEM_BUG_ON(!test_bit(I915_RESET_ENGINE + engine->id, &gt->reset.flags));
+	if (intel_engine_uses_guc(engine))
+		return -ENODEV;
+
   	if (!intel_engine_pm_get_if_awake(engine))
   		return 0;
@@ -1201,13 +1209,10 @@ int __intel_engine_reset_bh(struct intel_engine_cs *engine, const char *msg)
   			   "Resetting %s for %s\n", engine->name, msg);
   	atomic_inc(&engine->i915->gpu_error.reset_engine_count[engine->uabi_class]);
-	if (intel_engine_uses_guc(engine))
-		ret = intel_guc_reset_engine(&engine->gt->uc.guc, engine);
-	else
-		ret = intel_gt_reset_engine(engine);
+	ret = intel_gt_reset_engine(engine);
   	if (ret) {
   		/* If we fail here, we expect to fallback to a global reset */
-		ENGINE_TRACE(engine, "Failed to reset, err: %d\n", ret);
+		ENGINE_TRACE(engine, "Failed to reset %s, err: %d\n", engine->name, ret);
   		goto out;
   	}
@@ -1341,7 +1346,8 @@ void intel_gt_handle_error(struct intel_gt *gt,
   	 * Try engine reset when available. We fall back to full reset if
   	 * single reset fails.
   	 */
-	if (intel_has_reset_engine(gt) && !intel_gt_is_wedged(gt)) {
+	if (!intel_uc_uses_guc_submission(&gt->uc) &&
+	    intel_has_reset_engine(gt) && !intel_gt_is_wedged(gt)) {
   		local_bh_disable();
   		for_each_engine_masked(engine, gt, engine_mask, tmp) {
   			BUILD_BUG_ON(I915_RESET_MODESET >= I915_RESET_ENGINE);
drivers/gpu/drm/i915/gt/intel_ring_submission.c +22 -0
index e1506b280df1..99dcdc8fba12 100644
@@ -1049,6 +1049,25 @@ static void ring_bump_serial(struct intel_engine_cs *engine)
   	engine->serial++;
   }
+static void add_to_engine(struct i915_request *rq)
+{
+	lockdep_assert_held(&rq->engine->sched_engine->lock);
+	list_move_tail(&rq->sched.link, &rq->engine->sched_engine->requests);
+}
+
+static void remove_from_engine(struct i915_request *rq)
+{
+	spin_lock_irq(&rq->engine->sched_engine->lock);
+	list_del_init(&rq->sched.link);
+
+	/* Prevent further __await_execution() registering a cb, then flush */
+	set_bit(I915_FENCE_FLAG_ACTIVE, &rq->fence.flags);
+
+	spin_unlock_irq(&rq->engine->sched_engine->lock);
+
+	i915_request_notify_execute_cb_imm(rq);
+}
+
   static void setup_common(struct intel_engine_cs *engine)
   {
   	struct drm_i915_private *i915 = engine->i915;
@@ -1066,6 +1085,9 @@ static void setup_common(struct intel_engine_cs *engine)
   	engine->reset.cancel = reset_cancel;
   	engine->reset.finish = reset_finish;
+	engine->add_active_request = add_to_engine;
+	engine->remove_active_request = remove_from_engine;
+
   	engine->cops = &ring_context_ops;
   	engine->request_alloc = ring_request_alloc;
   	engine->bump_serial = ring_bump_serial;
drivers/gpu/drm/i915/gt/mock_engine.c +31 -0
index fc5a65ab1937..c12ff3a75ce6 100644
@@ -235,6 +235,35 @@ static void mock_submit_request(struct i915_request *request)
   	spin_unlock_irqrestore(&engine->hw_lock, flags);
   }
+static void mock_add_to_engine(struct i915_request *rq)
+{
+	lockdep_assert_held(&rq->engine->sched_engine->lock);
+	list_move_tail(&rq->sched.link, &rq->engine->sched_engine->requests);
+}
+
+static void mock_remove_from_engine(struct i915_request *rq)
+{
+	struct intel_engine_cs *engine, *locked;
+
+	/*
+	 * Virtual engines complicate acquiring the engine timeline lock,
+	 * as their rq->engine pointer is not stable until under that
+	 * engine lock. The simple ploy we use is to take the lock then
+	 * check that the rq still belongs to the newly locked engine.
+	 */
+
+	locked = READ_ONCE(rq->engine);
+	spin_lock_irq(&locked->sched_engine->lock);
+	while (unlikely(locked != (engine = READ_ONCE(rq->engine)))) {
+		spin_unlock(&locked->sched_engine->lock);
+		spin_lock(&engine->sched_engine->lock);
+		locked = engine;
+	}
+	list_del_init(&rq->sched.link);
+	spin_unlock_irq(&locked->sched_engine->lock);
+}
+
+
   static void mock_reset_prepare(struct intel_engine_cs *engine)
   {
   }
@@ -327,6 +356,8 @@ struct intel_engine_cs *mock_engine(struct drm_i915_private *i915,
   	engine->base.emit_flush = mock_emit_flush;
   	engine->base.emit_fini_breadcrumb = mock_emit_breadcrumb;
   	engine->base.submit_request = mock_submit_request;
+	engine->base.add_active_request = mock_add_to_engine;
+	engine->base.remove_active_request = mock_remove_from_engine;
   	engine->base.reset.prepare = mock_reset_prepare;
   	engine->base.reset.rewind = mock_reset_rewind;
drivers/gpu/drm/i915/gt/uc/intel_guc.c +0 -13
index 6661dcb02239..9b09395b998f 100644
@@ -572,19 +572,6 @@ int intel_guc_suspend(struct intel_guc *guc)
   	return 0;
   }
-/**
- * intel_guc_reset_engine() - ask GuC to reset an engine
- * @guc:	intel_guc structure
- * @engine:	engine to be reset
- */
-int intel_guc_reset_engine(struct intel_guc *guc,
-			   struct intel_engine_cs *engine)
-{
-	/* XXX: to be implemented with submission interface rework */
-
-	return -ENODEV;
-}
-
   /**
    * intel_guc_resume() - notify GuC resuming from suspend state
    * @guc:	the guc
drivers/gpu/drm/i915/gt/uc/intel_guc.h +5 -3
index 22eb1e9cca41..40c9868762d7 100644
@@ -242,14 +242,16 @@ static inline void intel_guc_disable_msg(struct intel_guc *guc, u32 mask)
   int intel_guc_wait_for_idle(struct intel_guc *guc, long timeout);
-int intel_guc_reset_engine(struct intel_guc *guc,
-			   struct intel_engine_cs *engine);
-
   int intel_guc_deregister_done_process_msg(struct intel_guc *guc,
   					  const u32 *msg, u32 len);
   int intel_guc_sched_done_process_msg(struct intel_guc *guc,
   				     const u32 *msg, u32 len);
+void intel_guc_submission_reset_prepare(struct intel_guc *guc);
+void intel_guc_submission_reset(struct intel_guc *guc, bool stalled);
+void intel_guc_submission_reset_finish(struct intel_guc *guc);
+void intel_guc_submission_cancel_requests(struct intel_guc *guc);
+
   void intel_guc_load_status(struct intel_guc *guc, struct drm_printer *p);
   #endif
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +472 -109
index 83058df5ba01..b8c894ad8caf 100644
@@ -141,7 +141,7 @@ context_wait_for_deregister_to_register(struct intel_context *ce)
   static inline void
   set_context_wait_for_deregister_to_register(struct intel_context *ce)
   {
-	/* Only should be called from guc_lrc_desc_pin() */
+	/* Only should be called from guc_lrc_desc_pin() without lock */
   	ce->guc_state.sched_state |=
   		SCHED_STATE_WAIT_FOR_DEREGISTER_TO_REGISTER;
   }
@@ -241,15 +241,31 @@ static int guc_lrc_desc_pool_create(struct intel_guc *guc)
   static void guc_lrc_desc_pool_destroy(struct intel_guc *guc)
   {
+	guc->lrc_desc_pool_vaddr = NULL;
   	i915_vma_unpin_and_release(&guc->lrc_desc_pool, I915_VMA_RELEASE_MAP);
   }
+static inline bool guc_submission_initialized(struct intel_guc *guc)
+{
+	return guc->lrc_desc_pool_vaddr != NULL;
+}
+
   static inline void reset_lrc_desc(struct intel_guc *guc, u32 id)
   {
-	struct guc_lrc_desc *desc = __get_lrc_desc(guc, id);
+	if (likely(guc_submission_initialized(guc))) {
+		struct guc_lrc_desc *desc = __get_lrc_desc(guc, id);
+		unsigned long flags;
-	memset(desc, 0, sizeof(*desc));
-	xa_erase_irq(&guc->context_lookup, id);
+		memset(desc, 0, sizeof(*desc));
+
+		/*
+		 * xarray API doesn't have xa_erase_irqsave wrapper, so calling
+		 * the lower level functions directly.
+		 */
+		xa_lock_irqsave(&guc->context_lookup, flags);
+		__xa_erase(&guc->context_lookup, id);
+		xa_unlock_irqrestore(&guc->context_lookup, flags);
+	}
   }
   static inline bool lrc_desc_registered(struct intel_guc *guc, u32 id)
@@ -260,7 +276,15 @@ static inline bool lrc_desc_registered(struct intel_guc *guc, u32 id)
   static inline void set_lrc_desc_registered(struct intel_guc *guc, u32 id,
   					   struct intel_context *ce)
   {
-	xa_store_irq(&guc->context_lookup, id, ce, GFP_ATOMIC);
+	unsigned long flags;
+
+	/*
+	 * xarray API doesn't have xa_save_irqsave wrapper, so calling the
+	 * lower level functions directly.
+	 */
+	xa_lock_irqsave(&guc->context_lookup, flags);
+	__xa_store(&guc->context_lookup, id, ce, GFP_ATOMIC);
+	xa_unlock_irqrestore(&guc->context_lookup, flags);
   }
   static int guc_submission_busy_loop(struct intel_guc* guc,
@@ -331,6 +355,8 @@ int intel_guc_wait_for_idle(struct intel_guc *guc, long timeout)
   					interruptible, timeout);
   }
+static int guc_lrc_desc_pin(struct intel_context *ce, bool loop);
+
   static int guc_add_request(struct intel_guc *guc, struct i915_request *rq)
   {
   	int err;
@@ -338,11 +364,22 @@ static int guc_add_request(struct intel_guc *guc, struct i915_request *rq)
   	u32 action[3];
   	int len = 0;
   	u32 g2h_len_dw = 0;
-	bool enabled = context_enabled(ce);
+	bool enabled;
   	GEM_BUG_ON(!atomic_read(&ce->guc_id_ref));
   	GEM_BUG_ON(context_guc_id_invalid(ce));
+	/*
+	 * Corner case where the GuC firmware was blown away and reloaded while
+	 * this context was pinned.
+	 */
+	if (unlikely(!lrc_desc_registered(guc, ce->guc_id))) {
+		err = guc_lrc_desc_pin(ce, false);
+		if (unlikely(err))
+			goto out;
+	}
+	enabled = context_enabled(ce);
+
   	if (!enabled) {
   		action[len++] = INTEL_GUC_ACTION_SCHED_CONTEXT_MODE_SET;
   		action[len++] = ce->guc_id;
@@ -365,6 +402,7 @@ static int guc_add_request(struct intel_guc *guc, struct i915_request *rq)
   		intel_context_put(ce);
   	}
+out:
   	return err;
   }
@@ -419,15 +457,10 @@ static int guc_dequeue_one_context(struct intel_guc *guc)
   	if (submit) {
   		guc_set_lrc_tail(last);
   resubmit:
-		/*
-		 * We only check for -EBUSY here even though it is possible for
-		 * -EDEADLK to be returned. If -EDEADLK is returned, the GuC has
-		 * died and a full GPU needs to be done. The hangcheck will
-		 * eventually detect that the GuC has died and trigger this
-		 * reset so no need to handle -EDEADLK here.
-		 */
   		ret = guc_add_request(guc, last);
-		if (ret == -EBUSY) {
+		if (unlikely(ret == -EIO))
+			goto deadlk;
+		else if (ret == -EBUSY) {
   			tasklet_schedule(&sched_engine->tasklet);
   			guc->stalled_request = last;
   			return false;
@@ -437,6 +470,11 @@ static int guc_dequeue_one_context(struct intel_guc *guc)
   	guc->stalled_request = NULL;
   	return submit;
+
+deadlk:
+	sched_engine->tasklet.callback = NULL;
+	tasklet_disable_nosync(&sched_engine->tasklet);
+	return false;
   }
   static void guc_submission_tasklet(struct tasklet_struct *t)
@@ -463,27 +501,165 @@ static void cs_irq_handler(struct intel_engine_cs *engine, u16 iir)
   		intel_engine_signal_breadcrumbs(engine);
   }
-static void guc_reset_prepare(struct intel_engine_cs *engine)
+static void __guc_context_destroy(struct intel_context *ce);
+static void release_guc_id(struct intel_guc *guc, struct intel_context *ce);
+static void guc_signal_context_fence(struct intel_context *ce);
+
+static void scrub_guc_desc_for_outstanding_g2h(struct intel_guc *guc)
+{
+	struct intel_context *ce;
+	unsigned long index, flags;
+	bool pending_disable, pending_enable, deregister, destroyed;
+
+	xa_for_each(&guc->context_lookup, index, ce) {
+		/* Flush context */
+		spin_lock_irqsave(&ce->guc_state.lock, flags);
+		spin_unlock_irqrestore(&ce->guc_state.lock, flags);
+
+		/*
+		 * Once we are at this point submission_disabled() is guaranteed
+		 * to visible to all callers who set the below flags (see above
+		 * flush and flushes in reset_prepare). If submission_disabled()
+		 * is set, the caller shouldn't set these flags.
+		 */
+
+		destroyed = context_destroyed(ce);
+		pending_enable = context_pending_enable(ce);
+		pending_disable = context_pending_disable(ce);
+		deregister = context_wait_for_deregister_to_register(ce);
+		init_sched_state(ce);
+
+		if (pending_enable || destroyed || deregister) {
+			atomic_dec(&guc->outstanding_submission_g2h);
+			if (deregister)
+				guc_signal_context_fence(ce);
+			if (destroyed) {
+				release_guc_id(guc, ce);
+				__guc_context_destroy(ce);
+			}
+			if (pending_enable|| deregister)
+				intel_context_put(ce);
+		}
+
+		/* Not mutualy exclusive with above if statement. */
+		if (pending_disable) {
+			guc_signal_context_fence(ce);
+			intel_context_sched_disable_unpin(ce);
+			atomic_dec(&guc->outstanding_submission_g2h);
+			intel_context_put(ce);
+		}
+	}
+}
+
+static inline bool
+submission_disabled(struct intel_guc *guc)
+{
+	struct i915_sched_engine * const sched_engine = guc->sched_engine;
+
+	return unlikely(!__tasklet_is_enabled(&sched_engine->tasklet));
+}
+
+static void disable_submission(struct intel_guc *guc)
+{
+	struct i915_sched_engine * const sched_engine = guc->sched_engine;
+
+	if (__tasklet_is_enabled(&sched_engine->tasklet)) {
+		GEM_BUG_ON(!guc->ct.enabled);
+		__tasklet_disable_sync_once(&sched_engine->tasklet);
+		sched_engine->tasklet.callback = NULL;
+	}
+}
+
+static void enable_submission(struct intel_guc *guc)
+{
+	struct i915_sched_engine * const sched_engine = guc->sched_engine;
+	unsigned long flags;
+
+	spin_lock_irqsave(&guc->sched_engine->lock, flags);
+	sched_engine->tasklet.callback = guc_submission_tasklet;
+	wmb();
+	if (!__tasklet_is_enabled(&sched_engine->tasklet) &&
+	    __tasklet_enable(&sched_engine->tasklet)) {
+		GEM_BUG_ON(!guc->ct.enabled);
+
+		/* And kick in case we missed a new request submission. */
+		tasklet_hi_schedule(&sched_engine->tasklet);
+	}
+	spin_unlock_irqrestore(&guc->sched_engine->lock, flags);
+}
+
+static void guc_flush_submissions(struct intel_guc *guc)
   {
-	ENGINE_TRACE(engine, "\n");
+	struct i915_sched_engine * const sched_engine = guc->sched_engine;
+	unsigned long flags;
+
+	spin_lock_irqsave(&sched_engine->lock, flags);
+	spin_unlock_irqrestore(&sched_engine->lock, flags);
+}
+
+void intel_guc_submission_reset_prepare(struct intel_guc *guc)
+{
+	int i;
+
+	if (unlikely(!guc_submission_initialized(guc)))
+		/* Reset called during driver load? GuC not yet initialised! */
+		return;
+
+	disable_submission(guc);
+	guc->interrupts.disable(guc);
+
+	/* Flush IRQ handler */
+	spin_lock_irq(&guc_to_gt(guc)->irq_lock);
+	spin_unlock_irq(&guc_to_gt(guc)->irq_lock);
+
+	guc_flush_submissions(guc);
   	/*
-	 * Prevent request submission to the hardware until we have
-	 * completed the reset in i915_gem_reset_finish(). If a request
-	 * is completed by one engine, it may then queue a request
-	 * to a second via its execlists->tasklet *just* as we are
-	 * calling engine->init_hw() and also writing the ELSP.
-	 * Turning off the execlists->tasklet until the reset is over
-	 * prevents the race.
-	 */
-	__tasklet_disable_sync_once(&engine->sched_engine->tasklet);
+	 * Handle any outstanding G2Hs before reset. Call IRQ handler directly
+	 * each pass as interrupt have been disabled. We always scrub for
+	 * outstanding G2H as it is possible for outstanding_submission_g2h to
+	 * be incremented after the context state update.
+ 	 */
+	for (i = 0; i < 4 && atomic_read(&guc->outstanding_submission_g2h); ++i) {
+		intel_guc_to_host_event_handler(guc);
+#define wait_for_reset(guc, wait_var) \
+		guc_wait_for_pending_msg(guc, wait_var, false, (HZ / 20))
+		do {
+			wait_for_reset(guc, &guc->outstanding_submission_g2h);
+		} while (!list_empty(&guc->ct.requests.incoming));
+	}
+	scrub_guc_desc_for_outstanding_g2h(guc);
   }
-static void guc_reset_state(struct intel_context *ce,
-			    struct intel_engine_cs *engine,
-			    u32 head,
-			    bool scrub)
+static struct intel_engine_cs *
+guc_virtual_get_sibling(struct intel_engine_cs *ve, unsigned int sibling)
   {
+	struct intel_engine_cs *engine;
+	intel_engine_mask_t tmp, mask = ve->mask;
+	unsigned int num_siblings = 0;
+
+	for_each_engine_masked(engine, ve->gt, mask, tmp)
+		if (num_siblings++ == sibling)
+			return engine;
+
+	return NULL;
+}
+
+static inline struct intel_engine_cs *
+__context_to_physical_engine(struct intel_context *ce)
+{
+	struct intel_engine_cs *engine = ce->engine;
+
+	if (intel_engine_is_virtual(engine))
+		engine = guc_virtual_get_sibling(engine, 0);
+
+	return engine;
+}
+
+static void guc_reset_state(struct intel_context *ce, u32 head, bool scrub)
+{
+	struct intel_engine_cs *engine = __context_to_physical_engine(ce);
+
   	GEM_BUG_ON(!intel_context_is_pinned(ce));
   	/*
@@ -501,42 +677,147 @@ static void guc_reset_state(struct intel_context *ce,
   	lrc_update_regs(ce, engine, head);
   }
-static void guc_reset_rewind(struct intel_engine_cs *engine, bool stalled)
+static void guc_reset_nop(struct intel_engine_cs *engine)
   {
-	struct intel_engine_execlists * const execlists = &engine->execlists;
-	struct i915_request *rq;
+}
+
+static void guc_rewind_nop(struct intel_engine_cs *engine, bool stalled)
+{
+}
+
+static void
+__unwind_incomplete_requests(struct intel_context *ce)
+{
+	struct i915_request *rq, *rn;
+	struct list_head *pl;
+	int prio = I915_PRIORITY_INVALID;
+	struct i915_sched_engine * const sched_engine =
+		ce->engine->sched_engine;
   	unsigned long flags;
-	spin_lock_irqsave(&engine->sched_engine->lock, flags);
+	spin_lock_irqsave(&sched_engine->lock, flags);
+	spin_lock(&ce->guc_active.lock);
+	list_for_each_entry_safe(rq, rn,
+				 &ce->guc_active.requests,
+				 sched.link) {
+		if (i915_request_completed(rq))
+			continue;
+
+		list_del_init(&rq->sched.link);
+		spin_unlock(&ce->guc_active.lock);
+
+		__i915_request_unsubmit(rq);
+
+		/* Push the request back into the queue for later resubmission. */
+		GEM_BUG_ON(rq_prio(rq) == I915_PRIORITY_INVALID);
+		if (rq_prio(rq) != prio) {
+			prio = rq_prio(rq);
+			pl = i915_sched_lookup_priolist(sched_engine, prio);
+		}
+		GEM_BUG_ON(i915_sched_engine_is_empty(sched_engine));
+
+		list_add_tail(&rq->sched.link, pl);
+		set_bit(I915_FENCE_FLAG_PQUEUE, &rq->fence.flags);
-	/* Push back any incomplete requests for replay after the reset. */
-	rq = execlists_unwind_incomplete_requests(execlists);
-	if (!rq)
-		goto out_unlock;
+		spin_lock(&ce->guc_active.lock);
+	}
+	spin_unlock(&ce->guc_active.lock);
+	spin_unlock_irqrestore(&sched_engine->lock, flags);
+}
+
+static struct i915_request *context_find_active_request(struct intel_context *ce)
+{
+	struct i915_request *rq, *active = NULL;
+	unsigned long flags;
+
+	spin_lock_irqsave(&ce->guc_active.lock, flags);
+	list_for_each_entry_reverse(rq, &ce->guc_active.requests,
+				    sched.link) {
+		if (i915_request_completed(rq))
+			break;
+
+		active = rq;
+	}
+	spin_unlock_irqrestore(&ce->guc_active.lock, flags);
+
+	return active;
+}
+
+static void __guc_reset_context(struct intel_context *ce, bool stalled)
+{
+	struct i915_request *rq;
+	u32 head;
+
+	/*
+	 * GuC will implicitly mark the context as non-schedulable
+	 * when it sends the reset notification. Make sure our state
+	 * reflects this change. The context will be marked enabled
+	 * on resubmission.
+	 */
+	clr_context_enabled(ce);
+
+	rq = context_find_active_request(ce);
+	if (!rq) {
+		head = ce->ring->tail;
+		stalled = false;
+		goto out_replay;
+	}
   	if (!i915_request_started(rq))
   		stalled = false;
+	GEM_BUG_ON(i915_active_is_idle(&ce->active));
+	head = intel_ring_wrap(ce->ring, rq->head);
   	__i915_request_reset(rq, stalled);
-	guc_reset_state(rq->context, engine, rq->head, stalled);
-out_unlock:
-	spin_unlock_irqrestore(&engine->sched_engine->lock, flags);
+out_replay:
+	guc_reset_state(ce, head, stalled);
+	__unwind_incomplete_requests(ce);
   }
-static void guc_reset_cancel(struct intel_engine_cs *engine)
+void intel_guc_submission_reset(struct intel_guc *guc, bool stalled)
+{
+	struct intel_context *ce;
+	unsigned long index;
+
+	if (unlikely(!guc_submission_initialized(guc)))
+		/* Reset called during driver load? GuC not yet initialised! */
+		return;
+
+	xa_for_each(&guc->context_lookup, index, ce)
+		if (intel_context_is_pinned(ce))
+			__guc_reset_context(ce, stalled);
+
+	/* GuC is blown away, drop all references to contexts */
+	xa_destroy(&guc->context_lookup);
+}
+
+static void guc_cancel_context_requests(struct intel_context *ce)
+{
+	struct i915_sched_engine *sched_engine = ce_to_guc(ce)->sched_engine;
+	struct i915_request *rq;
+	unsigned long flags;
+
+	/* Mark all executing requests as skipped. */
+	spin_lock_irqsave(&sched_engine->lock, flags);
+	spin_lock(&ce->guc_active.lock);
+	list_for_each_entry(rq, &ce->guc_active.requests, sched.link)
+		i915_request_put(i915_request_mark_eio(rq));
+	spin_unlock(&ce->guc_active.lock);
+	spin_unlock_irqrestore(&sched_engine->lock, flags);
+}
+
+static void
+guc_cancel_sched_engine_requests(struct i915_sched_engine *sched_engine)
   {
-	struct i915_sched_engine * const sched_engine = engine->sched_engine;
   	struct i915_request *rq, *rn;
   	struct rb_node *rb;
   	unsigned long flags;
   	/* Can be called during boot if GuC fails to load */
-	if (!engine->gt)
+	if (!sched_engine)
   		return;
-	ENGINE_TRACE(engine, "\n");
-
   	/*
   	 * Before we call engine->cancel_requests(), we should have exclusive
   	 * access to the submission state. This is arranged for us by the
@@ -553,21 +834,16 @@ static void guc_reset_cancel(struct intel_engine_cs *engine)
   	 */
   	spin_lock_irqsave(&sched_engine->lock, flags);
-	/* Mark all executing requests as skipped. */
-	list_for_each_entry(rq, &sched_engine->requests, sched.link) {
-		i915_request_set_error_once(rq, -EIO);
-		i915_request_mark_complete(rq);
-	}
-
   	/* Flush the queued requests to the timeline list (for retiring). */
   	while ((rb = rb_first_cached(&sched_engine->queue))) {
   		struct i915_priolist *p = to_priolist(rb);
   		priolist_for_each_request_consume(rq, rn, p) {
   			list_del_init(&rq->sched.link);
+
   			__i915_request_submit(rq);
-			dma_fence_set_error(&rq->fence, -EIO);
-			i915_request_mark_complete(rq);
+
+			i915_request_put(i915_request_mark_eio(rq));
   		}
   		rb_erase_cached(&p->node, &sched_engine->queue);
@@ -582,14 +858,38 @@ static void guc_reset_cancel(struct intel_engine_cs *engine)
   	spin_unlock_irqrestore(&sched_engine->lock, flags);
   }
-static void guc_reset_finish(struct intel_engine_cs *engine)
+void intel_guc_submission_cancel_requests(struct intel_guc *guc)
   {
-	if (__tasklet_enable(&engine->sched_engine->tasklet))
-		/* And kick in case we missed a new request submission. */
-		tasklet_hi_schedule(&engine->sched_engine->tasklet);
+	struct intel_context *ce;
+	unsigned long index;
+
+	xa_for_each(&guc->context_lookup, index, ce)
+		if (intel_context_is_pinned(ce))
+			guc_cancel_context_requests(ce);
-	ENGINE_TRACE(engine, "depth->%d\n",
-		     atomic_read(&engine->sched_engine->tasklet.count));
+	guc_cancel_sched_engine_requests(guc->sched_engine);
+
+	/* GuC is blown away, drop all references to contexts */
+	xa_destroy(&guc->context_lookup);
+}
+
+void intel_guc_submission_reset_finish(struct intel_guc *guc)
+{
+	/* Reset called during driver load or during wedge? */
+	if (unlikely(!guc_submission_initialized(guc) ||
+		     test_bit(I915_WEDGED, &guc_to_gt(guc)->reset.flags)))
+		return;
+
+	/*
+	 * Technically possible for either of these values to be non-zero here,
+	 * but very unlikely + harmless. Regardless let's add a warn so we can
+	 * see in CI if this happens frequently / a precursor to taking down the
+	 * machine.
+	 */
+	GEM_WARN_ON(atomic_read(&guc->outstanding_submission_g2h));
+	atomic_set(&guc->outstanding_submission_g2h, 0);
+
+	enable_submission(guc);
   }
   /*
@@ -656,6 +956,9 @@ static int guc_bypass_tasklet_submit(struct intel_guc *guc,
   	else
   		trace_i915_request_guc_submit(rq);
+	if (unlikely(ret == -EIO))
+		disable_submission(guc);
+
   	return ret;
   }
@@ -668,7 +971,8 @@ static void guc_submit_request(struct i915_request *rq)
   	/* Will be called from irq-context when using foreign fences. */
   	spin_lock_irqsave(&sched_engine->lock, flags);
-	if (guc->stalled_request || !i915_sched_engine_is_empty(sched_engine))
+	if (submission_disabled(guc) || guc->stalled_request ||
+	    !i915_sched_engine_is_empty(sched_engine))
   		queue_request(sched_engine, rq, rq_prio(rq));
   	else if (guc_bypass_tasklet_submit(guc, rq) == -EBUSY)
   		tasklet_hi_schedule(&sched_engine->tasklet);
@@ -805,7 +1109,8 @@ static void unpin_guc_id(struct intel_guc *guc, struct intel_context *ce)
   static int __guc_action_register_context(struct intel_guc *guc,
   					 u32 guc_id,
-					 u32 offset)
+					 u32 offset,
+					 bool loop)
   {
   	u32 action[] = {
   		INTEL_GUC_ACTION_REGISTER_CONTEXT,
@@ -813,10 +1118,10 @@ static int __guc_action_register_context(struct intel_guc *guc,
   		offset,
   	};
-	return guc_submission_busy_loop(guc, action, ARRAY_SIZE(action), 0, true);
+	return guc_submission_busy_loop(guc, action, ARRAY_SIZE(action), 0, loop);
   }
-static int register_context(struct intel_context *ce)
+static int register_context(struct intel_context *ce, bool loop)
   {
   	struct intel_guc *guc = ce_to_guc(ce);
   	u32 offset = intel_guc_ggtt_offset(guc, guc->lrc_desc_pool) +
@@ -824,11 +1129,12 @@ static int register_context(struct intel_context *ce)
   	trace_intel_context_register(ce);
-	return __guc_action_register_context(guc, ce->guc_id, offset);
+	return __guc_action_register_context(guc, ce->guc_id, offset, loop);
   }
   static int __guc_action_deregister_context(struct intel_guc *guc,
-					   u32 guc_id)
+					   u32 guc_id,
+					   bool loop)
   {
   	u32 action[] = {
   		INTEL_GUC_ACTION_DEREGISTER_CONTEXT,
@@ -836,16 +1142,16 @@ static int __guc_action_deregister_context(struct intel_guc *guc,
   	};
   	return guc_submission_busy_loop(guc, action, ARRAY_SIZE(action),
-					G2H_LEN_DW_DEREGISTER_CONTEXT, true);
+					G2H_LEN_DW_DEREGISTER_CONTEXT, loop);
   }
-static int deregister_context(struct intel_context *ce, u32 guc_id)
+static int deregister_context(struct intel_context *ce, u32 guc_id, bool loop)
   {
   	struct intel_guc *guc = ce_to_guc(ce);
   	trace_intel_context_deregister(ce);
-	return __guc_action_deregister_context(guc, guc_id);
+	return __guc_action_deregister_context(guc, guc_id, loop);
   }
   static intel_engine_mask_t adjust_engine_mask(u8 class, intel_engine_mask_t mask)
@@ -874,7 +1180,7 @@ static void guc_context_policy_init(struct intel_engine_cs *engine,
   	desc->preemption_timeout = CONTEXT_POLICY_DEFAULT_PREEMPTION_TIME_US;
   }
-static int guc_lrc_desc_pin(struct intel_context *ce)
+static int guc_lrc_desc_pin(struct intel_context *ce, bool loop)
   {
   	struct intel_runtime_pm *runtime_pm =
   		&ce->engine->gt->i915->runtime_pm;
@@ -920,18 +1226,44 @@ static int guc_lrc_desc_pin(struct intel_context *ce)
   	 */
   	if (context_registered) {
   		trace_intel_context_steal_guc_id(ce);
-		set_context_wait_for_deregister_to_register(ce);
-		intel_context_get(ce);
+		if (!loop) {
+			set_context_wait_for_deregister_to_register(ce);
+			intel_context_get(ce);
+		} else {
+			bool disabled;
+			unsigned long flags;
+
+			/* Seal race with Reset */
+			spin_lock_irqsave(&ce->guc_state.lock, flags);
+			disabled = submission_disabled(guc);
+			if (likely(!disabled)) {
+				set_context_wait_for_deregister_to_register(ce);
+				intel_context_get(ce);
+			}
+			spin_unlock_irqrestore(&ce->guc_state.lock, flags);
+			if (unlikely(disabled)) {
+				reset_lrc_desc(guc, desc_idx);
+				return 0;	/* Will get registered later */
+			}
+		}
   		/*
   		 * If stealing the guc_id, this ce has the same guc_id as the
   		 * context whos guc_id was stole.
   		 */
   		with_intel_runtime_pm(runtime_pm, wakeref)
-			ret = deregister_context(ce, ce->guc_id);
+			ret = deregister_context(ce, ce->guc_id, loop);
+		if (unlikely(ret == -EBUSY)) {
+			clr_context_wait_for_deregister_to_register(ce);
+			intel_context_put(ce);
+		}
   	} else {
   		with_intel_runtime_pm(runtime_pm, wakeref)
-			ret = register_context(ce);
+			ret = register_context(ce, loop);
+		if (unlikely(ret == -EBUSY))
+			reset_lrc_desc(guc, desc_idx);
+		else if (unlikely(ret == -ENODEV))
+			ret = 0;	/* Will get registered later */
   	}
   	return ret;
@@ -994,7 +1326,6 @@ static void __guc_context_sched_disable(struct intel_guc *guc,
   	GEM_BUG_ON(guc_id == GUC_INVALID_LRC_ID);
   	trace_intel_context_sched_disable(ce);
-	intel_context_get(ce);
   	guc_submission_busy_loop(guc, action, ARRAY_SIZE(action),
   				 G2H_LEN_DW_SCHED_CONTEXT_MODE_SET, true);
@@ -1004,6 +1335,7 @@ static u16 prep_context_pending_disable(struct intel_context *ce)
   {
   	set_context_pending_disable(ce);
   	clr_context_enabled(ce);
+	intel_context_get(ce);
   	return ce->guc_id;
   }
@@ -1016,7 +1348,7 @@ static void guc_context_sched_disable(struct intel_context *ce)
   	u16 guc_id;
   	intel_wakeref_t wakeref;
-	if (context_guc_id_invalid(ce) ||
+	if (submission_disabled(guc) || context_guc_id_invalid(ce) ||
   	    !lrc_desc_registered(guc, ce->guc_id)) {
   		clr_context_enabled(ce);
   		goto unpin;
@@ -1034,6 +1366,7 @@ static void guc_context_sched_disable(struct intel_context *ce)
   	 * request doesn't slip through the 'context_pending_disable' fence.
   	 */
   	if (unlikely(atomic_add_unless(&ce->pin_count, -2, 2))) {
+		spin_unlock_irqrestore(&ce->guc_state.lock, flags);
   		return;
   	}
   	guc_id = prep_context_pending_disable(ce);
@@ -1050,19 +1383,13 @@ static void guc_context_sched_disable(struct intel_context *ce)
   static inline void guc_lrc_desc_unpin(struct intel_context *ce)
   {
-	struct intel_engine_cs *engine = ce->engine;
-	struct intel_guc *guc = &engine->gt->uc.guc;
-	unsigned long flags;
+	struct intel_guc *guc = ce_to_guc(ce);
   	GEM_BUG_ON(!lrc_desc_registered(guc, ce->guc_id));
   	GEM_BUG_ON(ce != __get_context(guc, ce->guc_id));
   	GEM_BUG_ON(context_enabled(ce));
-	spin_lock_irqsave(&ce->guc_state.lock, flags);
-	set_context_destroyed(ce);
-	spin_unlock_irqrestore(&ce->guc_state.lock, flags);
-
-	deregister_context(ce, ce->guc_id);
+	deregister_context(ce, ce->guc_id, true);
   }
   static void __guc_context_destroy(struct intel_context *ce)
@@ -1090,13 +1417,15 @@ static void guc_context_destroy(struct kref *kref)
   	struct intel_guc *guc = &ce->engine->gt->uc.guc;
   	intel_wakeref_t wakeref;
   	unsigned long flags;
+	bool disabled;
   	/*
   	 * If the guc_id is invalid this context has been stolen and we can free
   	 * it immediately. Also can be freed immediately if the context is not
   	 * registered with the GuC.
   	 */
-	if (context_guc_id_invalid(ce) ||
+	if (submission_disabled(guc) ||
+	    context_guc_id_invalid(ce) ||
   	    !lrc_desc_registered(guc, ce->guc_id)) {
   		release_guc_id(guc, ce);
   		__guc_context_destroy(ce);
@@ -1123,6 +1452,18 @@ static void guc_context_destroy(struct kref *kref)
   		list_del_init(&ce->guc_id_link);
   	spin_unlock_irqrestore(&guc->contexts_lock, flags);
+	/* Seal race with Reset */
+	spin_lock_irqsave(&ce->guc_state.lock, flags);
+	disabled = submission_disabled(guc);
+	if (likely(!disabled))
+		set_context_destroyed(ce);
+	spin_unlock_irqrestore(&ce->guc_state.lock, flags);
+	if (unlikely(disabled)) {
+		release_guc_id(guc, ce);
+		__guc_context_destroy(ce);
+		return;
+	}
+
   	/*
   	 * We defer GuC context deregistration until the context is destroyed
   	 * in order to save on CTBs. With this optimization ideally we only need
@@ -1145,6 +1486,33 @@ static int guc_context_alloc(struct intel_context *ce)
   	return lrc_alloc(ce, ce->engine);
   }
+static void add_to_context(struct i915_request *rq)
+{
+	struct intel_context *ce = rq->context;
+
+	spin_lock(&ce->guc_active.lock);
+	list_move_tail(&rq->sched.link, &ce->guc_active.requests);
+	spin_unlock(&ce->guc_active.lock);
+}
+
+static void remove_from_context(struct i915_request *rq)
+{
+	struct intel_context *ce = rq->context;
+
+	spin_lock_irq(&ce->guc_active.lock);
+
+	list_del_init(&rq->sched.link);
+	clear_bit(I915_FENCE_FLAG_PQUEUE, &rq->fence.flags);
+
+	/* Prevent further __await_execution() registering a cb, then flush */
+	set_bit(I915_FENCE_FLAG_ACTIVE, &rq->fence.flags);
+
+	spin_unlock_irq(&ce->guc_active.lock);
+
+	atomic_dec(&ce->guc_id_ref);
+	i915_request_notify_execute_cb_imm(rq);
+}
+
   static const struct intel_context_ops guc_context_ops = {
   	.alloc = guc_context_alloc,
@@ -1183,8 +1551,6 @@ static void guc_signal_context_fence(struct intel_context *ce)
   {
   	unsigned long flags;
-	GEM_BUG_ON(!context_wait_for_deregister_to_register(ce));
-
   	spin_lock_irqsave(&ce->guc_state.lock, flags);
   	clr_context_wait_for_deregister_to_register(ce);
   	__guc_signal_context_fence(ce);
@@ -1193,8 +1559,9 @@ static void guc_signal_context_fence(struct intel_context *ce)
   static bool context_needs_register(struct intel_context *ce, bool new_guc_id)
   {
-	return new_guc_id || test_bit(CONTEXT_LRCA_DIRTY, &ce->flags) ||
-		!lrc_desc_registered(ce_to_guc(ce), ce->guc_id);
+	return (new_guc_id || test_bit(CONTEXT_LRCA_DIRTY, &ce->flags) ||
+		!lrc_desc_registered(ce_to_guc(ce), ce->guc_id)) &&
+		!submission_disabled(ce_to_guc(ce));
   }
   static int guc_request_alloc(struct i915_request *rq)
@@ -1252,8 +1619,12 @@ static int guc_request_alloc(struct i915_request *rq)
   	if (unlikely(ret < 0))
   		return ret;;
   	if (context_needs_register(ce, !!ret)) {
-		ret = guc_lrc_desc_pin(ce);
+		ret = guc_lrc_desc_pin(ce, true);
   		if (unlikely(ret)) {	/* unwind */
+			if (ret == -EIO) {
+				disable_submission(guc);
+				goto out;	/* GPU will be reset */
+			}
   			atomic_dec(&ce->guc_id_ref);
   			unpin_guc_id(guc, ce);
   			return ret;
@@ -1290,20 +1661,6 @@ static int guc_request_alloc(struct i915_request *rq)
   	return 0;
   }
-static struct intel_engine_cs *
-guc_virtual_get_sibling(struct intel_engine_cs *ve, unsigned int sibling)
-{
-	struct intel_engine_cs *engine;
-	intel_engine_mask_t tmp, mask = ve->mask;
-	unsigned int num_siblings = 0;
-
-	for_each_engine_masked(engine, ve->gt, mask, tmp)
-		if (num_siblings++ == sibling)
-			return engine;
-
-	return NULL;
-}
-
   static int guc_virtual_context_pre_pin(struct intel_context *ce,
   				       struct i915_gem_ww_ctx *ww,
   				       void **vaddr)
@@ -1512,7 +1869,7 @@ static inline void guc_kernel_context_pin(struct intel_guc *guc,
   {
   	if (context_guc_id_invalid(ce))
   		pin_guc_id(guc, ce);
-	guc_lrc_desc_pin(ce);
+	guc_lrc_desc_pin(ce, true);
   }
   static inline void guc_init_lrc_mapping(struct intel_guc *guc)
@@ -1578,13 +1935,15 @@ static void guc_default_vfuncs(struct intel_engine_cs *engine)
   	engine->cops = &guc_context_ops;
   	engine->request_alloc = guc_request_alloc;
   	engine->bump_serial = guc_bump_serial;
+	engine->add_active_request = add_to_context;
+	engine->remove_active_request = remove_from_context;
   	engine->sched_engine->schedule = i915_schedule;
-	engine->reset.prepare = guc_reset_prepare;
-	engine->reset.rewind = guc_reset_rewind;
-	engine->reset.cancel = guc_reset_cancel;
-	engine->reset.finish = guc_reset_finish;
+	engine->reset.prepare = guc_reset_nop;
+	engine->reset.rewind = guc_rewind_nop;
+	engine->reset.cancel = guc_reset_nop;
+	engine->reset.finish = guc_reset_nop;
   	engine->emit_flush = gen8_emit_flush_xcs;
   	engine->emit_init_breadcrumb = gen8_emit_init_breadcrumb;
@@ -1757,7 +2116,7 @@ int intel_guc_deregister_done_process_msg(struct intel_guc *guc,
   		 * register this context.
   		 */
   		with_intel_runtime_pm(runtime_pm, wakeref)
-			register_context(ce);
+			register_context(ce, true);
   		guc_signal_context_fence(ce);
   		intel_context_put(ce);
   	} else if (context_destroyed(ce)) {
@@ -1939,6 +2298,10 @@ guc_create_virtual(struct intel_engine_cs **siblings, unsigned int count)
   				 "v%dx%d", ve->base.class, count);
   			ve->base.context_size = sibling->context_size;
+			ve->base.add_active_request =
+				sibling->add_active_request;
+			ve->base.remove_active_request =
+				sibling->remove_active_request;
   			ve->base.emit_bb_start = sibling->emit_bb_start;
   			ve->base.emit_flush = sibling->emit_flush;
   			ve->base.emit_init_breadcrumb =
drivers/gpu/drm/i915/gt/uc/intel_uc.c +38 -1
index 6d8b9233214e..f0b02200aa01 100644
@@ -565,12 +565,49 @@ void intel_uc_reset_prepare(struct intel_uc *uc)
   {
   	struct intel_guc *guc = &uc->guc;
-	if (!intel_guc_is_ready(guc))
+
+	/* Nothing to do if GuC isn't supported */
+	if (!intel_uc_supports_guc(uc))
   		return;
+	/* Firmware expected to be running when this function is called */
+	if (!intel_guc_is_ready(guc))
+		goto sanitize;
+
+	if (intel_uc_uses_guc_submission(uc))
+		intel_guc_submission_reset_prepare(guc);
+
+sanitize:
   	__uc_sanitize(uc);
   }
+void intel_uc_reset(struct intel_uc *uc, bool stalled)
+{
+	struct intel_guc *guc = &uc->guc;
+
+	/* Firmware can not be running when this function is called  */
+	if (intel_uc_uses_guc_submission(uc))
+		intel_guc_submission_reset(guc, stalled);
+}
+
+void intel_uc_reset_finish(struct intel_uc *uc)
+{
+	struct intel_guc *guc = &uc->guc;
+
+	/* Firmware expected to be running when this function is called */
+	if (intel_guc_is_fw_running(guc) && intel_uc_uses_guc_submission(uc))
+		intel_guc_submission_reset_finish(guc);
+}
+
+void intel_uc_cancel_requests(struct intel_uc *uc)
+{
+	struct intel_guc *guc = &uc->guc;
+
+	/* Firmware can not be running when this function is called  */
+	if (intel_uc_uses_guc_submission(uc))
+		intel_guc_submission_cancel_requests(guc);
+}
+
   void intel_uc_runtime_suspend(struct intel_uc *uc)
   {
   	struct intel_guc *guc = &uc->guc;
drivers/gpu/drm/i915/gt/uc/intel_uc.h +3 -0
index c4cef885e984..eaa3202192ac 100644
@@ -37,6 +37,9 @@ void intel_uc_driver_late_release(struct intel_uc *uc);
   void intel_uc_driver_remove(struct intel_uc *uc);
   void intel_uc_init_mmio(struct intel_uc *uc);
   void intel_uc_reset_prepare(struct intel_uc *uc);
+void intel_uc_reset(struct intel_uc *uc, bool stalled);
+void intel_uc_reset_finish(struct intel_uc *uc);
+void intel_uc_cancel_requests(struct intel_uc *uc);
   void intel_uc_suspend(struct intel_uc *uc);
   void intel_uc_runtime_suspend(struct intel_uc *uc);
   int intel_uc_resume(struct intel_uc *uc);
drivers/gpu/drm/i915/i915_request.c +4 -37
index dec5a35c9aa2..192784875a1d 100644
@@ -194,7 +194,7 @@ static bool irq_work_imm(struct irq_work *wrk)
   	return false;
   }
-static void __notify_execute_cb_imm(struct i915_request *rq)
+void i915_request_notify_execute_cb_imm(struct i915_request *rq)
   {
   	__notify_execute_cb(rq, irq_work_imm);
   }
@@ -268,37 +268,6 @@ i915_request_active_engine(struct i915_request *rq,
   	return ret;
   }
-
-static void remove_from_engine(struct i915_request *rq)
-{
-	struct intel_engine_cs *engine, *locked;
-
-	/*
-	 * Virtual engines complicate acquiring the engine timeline lock,
-	 * as their rq->engine pointer is not stable until under that
-	 * engine lock. The simple ploy we use is to take the lock then
-	 * check that the rq still belongs to the newly locked engine.
-	 */
-	locked = READ_ONCE(rq->engine);
-	spin_lock_irq(&locked->sched_engine->lock);
-	while (unlikely(locked != (engine = READ_ONCE(rq->engine)))) {
-		spin_unlock(&locked->sched_engine->lock);
-		spin_lock(&engine->sched_engine->lock);
-		locked = engine;
-	}
-	list_del_init(&rq->sched.link);
-
-	clear_bit(I915_FENCE_FLAG_PQUEUE, &rq->fence.flags);
-	clear_bit(I915_FENCE_FLAG_HOLD, &rq->fence.flags);
-
-	/* Prevent further __await_execution() registering a cb, then flush */
-	set_bit(I915_FENCE_FLAG_ACTIVE, &rq->fence.flags);
-
-	spin_unlock_irq(&locked->sched_engine->lock);
-
-	__notify_execute_cb_imm(rq);
-}
-
   static void __rq_init_watchdog(struct i915_request *rq)
   {
   	rq->watchdog.timer.function = NULL;
@@ -395,9 +364,7 @@ bool i915_request_retire(struct i915_request *rq)
   	 * after removing the breadcrumb and signaling it, so that we do not
   	 * inadvertently attach the breadcrumb to a completed request.
   	 */
-	if (!list_empty(&rq->sched.link))
-		remove_from_engine(rq);
-	atomic_dec(&rq->context->guc_id_ref);
+	rq->engine->remove_active_request(rq);
   	GEM_BUG_ON(!llist_empty(&rq->execute_cb));
   	__list_del_entry(&rq->link); /* poison neither prev/next (RCU walks) */
@@ -539,7 +506,7 @@ __await_execution(struct i915_request *rq,
   	if (llist_add(&cb->work.node.llist, &signal->execute_cb)) {
   		if (i915_request_is_active(signal) ||
   		    __request_in_flight(signal))
-			__notify_execute_cb_imm(signal);
+			i915_request_notify_execute_cb_imm(signal);
   	}
   	return 0;
@@ -676,7 +643,7 @@ bool __i915_request_submit(struct i915_request *request)
   	result = true;
   	GEM_BUG_ON(test_bit(I915_FENCE_FLAG_ACTIVE, &request->fence.flags));
-	list_move_tail(&request->sched.link, &engine->sched_engine->requests);
+	engine->add_active_request(request);
   active:
   	clear_bit(I915_FENCE_FLAG_PQUEUE, &request->fence.flags);
   	set_bit(I915_FENCE_FLAG_ACTIVE, &request->fence.flags);
drivers/gpu/drm/i915/i915_request.h +0 -1
index f870cd75a001..bcc6340c505e 100644
--- a/drivers/gpu/drm/i915/i915_request.h
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/i915/i915_request.h bool · line 654

Quoted 8 lines

+++ b/drivers/gpu/drm/i915/i915_request.h

drivers/gpu/drm/i915/i915_request.h +2 -0
@@ -649,4 +649,6 @@ bool
   i915_request_active_engine(struct i915_request *rq,
   			   struct intel_engine_cs **active);
+void i915_request_notify_execute_cb_imm(struct i915_request *rq);
+
   #endif /* I915_REQUEST_H */
 

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

#106 lore raw

PATCH 32/47 drm/i915: Reset GPU immediately if submission is disabled

In reply to Matthew Brost

If submission is disabled by the backend for any reason, reset the GPU immediately in the heartbeat code as the backend can't be reenabled until the GPU is reset.

---
 .../gpu/drm/i915/gt/intel_engine_heartbeat.c  | 63 +++++++++++++++----
 .../gpu/drm/i915/gt/intel_engine_heartbeat.h  |  4 ++
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c |  9 +++
 drivers/gpu/drm/i915/i915_scheduler.c         |  6 ++
 drivers/gpu/drm/i915/i915_scheduler.h         |  6 ++
 drivers/gpu/drm/i915/i915_scheduler_types.h   |  5 ++
 6 files changed, 80 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +50 -13
index b6a305e6a974..a8495364d906 100644
@@ -70,12 +70,30 @@ static void show_heartbeat(const struct i915_request *rq,
 {
 	struct drm_printer p = drm_debug_printer("heartbeat");
 
-	intel_engine_dump(engine, &p,
-			  "%s heartbeat {seqno:%llx:%lld, prio:%d} not ticking\n",
-			  engine->name,
-			  rq->fence.context,
-			  rq->fence.seqno,
-			  rq->sched.attr.priority);
+	if (!rq) {
+		intel_engine_dump(engine, &p,
+				  "%s heartbeat not ticking\n",
+				  engine->name);
+	} else {
+		intel_engine_dump(engine, &p,
+				  "%s heartbeat {seqno:%llx:%lld, prio:%d} not ticking\n",
+				  engine->name,
+				  rq->fence.context,
+				  rq->fence.seqno,
+				  rq->sched.attr.priority);
+	}
+}
+
+static void
+reset_engine(struct intel_engine_cs *engine, struct i915_request *rq)
+{
+	if (IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM))
+		show_heartbeat(rq, engine);
+
+	intel_gt_handle_error(engine->gt, engine->mask,
+			      I915_ERROR_CAPTURE,
+			      "stopped heartbeat on %s",
+			      engine->name);
 }
 
 static void heartbeat(struct work_struct *wrk)
@@ -102,6 +120,11 @@ static void heartbeat(struct work_struct *wrk)
 	if (intel_gt_is_wedged(engine->gt))
 		goto out;
 
+	if (i915_sched_engine_disabled(engine->sched_engine)) {
+		reset_engine(engine, engine->heartbeat.systole);
+		goto out;
+	}
+
 	if (engine->heartbeat.systole) {
 		long delay = READ_ONCE(engine->props.heartbeat_interval_ms);
 
@@ -139,13 +162,7 @@ static void heartbeat(struct work_struct *wrk)
 			engine->sched_engine->schedule(rq, &attr);
 			local_bh_enable();
 		} else {
-			if (IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM))
-				show_heartbeat(rq, engine);
-
-			intel_gt_handle_error(engine->gt, engine->mask,
-					      I915_ERROR_CAPTURE,
-					      "stopped heartbeat on %s",
-					      engine->name);
+			reset_engine(engine, rq);
 		}
 
 		rq->emitted_jiffies = jiffies;
@@ -194,6 +211,26 @@ void intel_engine_park_heartbeat(struct intel_engine_cs *engine)
 		i915_request_put(fetch_and_zero(&engine->heartbeat.systole));
 }
 
+void intel_gt_unpark_heartbeats(struct intel_gt *gt)
+{
+	struct intel_engine_cs *engine;
+	enum intel_engine_id id;
+
+	for_each_engine(engine, gt, id)
+		if (intel_engine_pm_is_awake(engine))
+			intel_engine_unpark_heartbeat(engine);
+
+}
+
+void intel_gt_park_heartbeats(struct intel_gt *gt)
+{
+	struct intel_engine_cs *engine;
+	enum intel_engine_id id;
+
+	for_each_engine(engine, gt, id)
+		intel_engine_park_heartbeat(engine);
+}
+
 void intel_engine_init_heartbeat(struct intel_engine_cs *engine)
 {
 	INIT_DELAYED_WORK(&engine->heartbeat.work, heartbeat);
drivers/gpu/drm/i915/gt/intel_engine_heartbeat.h +4 -0
index a488ea3e84a3..5da6d809a87a 100644
@@ -7,6 +7,7 @@
 #define INTEL_ENGINE_HEARTBEAT_H
 
 struct intel_engine_cs;
+struct intel_gt;
 
 void intel_engine_init_heartbeat(struct intel_engine_cs *engine);
 
@@ -16,6 +17,9 @@ int intel_engine_set_heartbeat(struct intel_engine_cs *engine,
 void intel_engine_park_heartbeat(struct intel_engine_cs *engine);
 void intel_engine_unpark_heartbeat(struct intel_engine_cs *engine);
 
+void intel_gt_park_heartbeats(struct intel_gt *gt);
+void intel_gt_unpark_heartbeats(struct intel_gt *gt);
+
 int intel_engine_pulse(struct intel_engine_cs *engine);
 int intel_engine_flush_barriers(struct intel_engine_cs *engine);
 
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +9 -0
index b8c894ad8caf..59fca9748c15 100644
@@ -10,6 +10,7 @@
 #include "gt/intel_breadcrumbs.h"
 #include "gt/intel_context.h"
 #include "gt/intel_engine_pm.h"
+#include "gt/intel_engine_heartbeat.h"
 #include "gt/intel_gt.h"
 #include "gt/intel_gt_irq.h"
 #include "gt/intel_gt_pm.h"
@@ -605,6 +606,7 @@ void intel_guc_submission_reset_prepare(struct intel_guc *guc)
 		/* Reset called during driver load? GuC not yet initialised! */
 		return;
 
+	intel_gt_park_heartbeats(guc_to_gt(guc));
 	disable_submission(guc);
 	guc->interrupts.disable(guc);
 
@@ -890,6 +892,7 @@ void intel_guc_submission_reset_finish(struct intel_guc *guc)
 	atomic_set(&guc->outstanding_submission_g2h, 0);
 
 	enable_submission(guc);
+	intel_gt_unpark_heartbeats(guc_to_gt(guc));
 }
 
 /*
@@ -1859,6 +1862,11 @@ static int guc_resume(struct intel_engine_cs *engine)
 	return 0;
 }
 
+static bool guc_sched_engine_disabled(struct i915_sched_engine *sched_engine)
+{
+	return !sched_engine->tasklet.callback;
+}
+
 static void guc_set_default_submission(struct intel_engine_cs *engine)
 {
 	engine->submit_request = guc_submit_request;
@@ -2009,6 +2017,7 @@ int intel_guc_submission_setup(struct intel_engine_cs *engine)
 			return -ENOMEM;
 
 		guc->sched_engine->schedule = i915_schedule;
+		guc->sched_engine->disabled = guc_sched_engine_disabled;
 		guc->sched_engine->private_data = guc;
 		tasklet_setup(&guc->sched_engine->tasklet,
 			      guc_submission_tasklet);
drivers/gpu/drm/i915/i915_scheduler.c +6 -0
index 3a58a9130309..3fb009ea2cb2 100644
@@ -440,6 +440,11 @@ void i915_sched_engine_free(struct kref *kref)
 	kfree(sched_engine);
 }
 
+static bool default_disabled(struct i915_sched_engine *sched_engine)
+{
+	return false;
+}
+
 struct i915_sched_engine *
 i915_sched_engine_create(unsigned int subclass)
 {
@@ -453,6 +458,7 @@ i915_sched_engine_create(unsigned int subclass)
 
 	sched_engine->queue = RB_ROOT_CACHED;
 	sched_engine->queue_priority_hint = INT_MIN;
+	sched_engine->disabled = default_disabled;
 
 	INIT_LIST_HEAD(&sched_engine->requests);
 	INIT_LIST_HEAD(&sched_engine->hold);
drivers/gpu/drm/i915/i915_scheduler.h +6 -0
index 650ab8e0db9f..72105a53b0e1 100644
@@ -98,4 +98,10 @@ void i915_request_show_with_schedule(struct drm_printer *m,
 				     const char *prefix,
 				     int indent);
 
+static inline bool
+i915_sched_engine_disabled(struct i915_sched_engine *sched_engine)
+{
+	return sched_engine->disabled(sched_engine);
+}
+
 #endif /* _I915_SCHEDULER_H_ */
drivers/gpu/drm/i915/i915_scheduler_types.h +5 -0
index 5935c3152bdc..cfaf52e528d0 100644
@@ -163,6 +163,11 @@ struct i915_sched_engine {
 	 */
 	void *private_data;
 
+	/**
+	 * @disabled: check if backend has disabled submission
+	 */
+	bool	(*disabled)(struct i915_sched_engine *sched_engine);
+
 	/**
 	 * @kick_backend: kick backend after a request's priority has changed
 	 */
Signature · 6 lines
2.28.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 32/47
#107 lore raw

Re: [PATCH 32/47] drm/i915: Reset GPU immediately if submission is disabled

Quoted 5 lines · Matthew Brost

If submission is disabled by the backend for any reason, reset the GPU immediately in the heartbeat code as the backend can't be reenabled until the GPU is reset.

Quoted 219 lines
---
  .../gpu/drm/i915/gt/intel_engine_heartbeat.c  | 63 +++++++++++++++----
  .../gpu/drm/i915/gt/intel_engine_heartbeat.h  |  4 ++
  .../gpu/drm/i915/gt/uc/intel_guc_submission.c |  9 +++
  drivers/gpu/drm/i915/i915_scheduler.c         |  6 ++
  drivers/gpu/drm/i915/i915_scheduler.h         |  6 ++
  drivers/gpu/drm/i915/i915_scheduler_types.h   |  5 ++
  6 files changed, 80 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +50 -13
index b6a305e6a974..a8495364d906 100644
@@ -70,12 +70,30 @@ static void show_heartbeat(const struct i915_request *rq,
  {
  	struct drm_printer p = drm_debug_printer("heartbeat");
 
-	intel_engine_dump(engine, &p,
-			  "%s heartbeat {seqno:%llx:%lld, prio:%d} not ticking\n",
-			  engine->name,
-			  rq->fence.context,
-			  rq->fence.seqno,
-			  rq->sched.attr.priority);
+	if (!rq) {
+		intel_engine_dump(engine, &p,
+				  "%s heartbeat not ticking\n",
+				  engine->name);
+	} else {
+		intel_engine_dump(engine, &p,
+				  "%s heartbeat {seqno:%llx:%lld, prio:%d} not ticking\n",
+				  engine->name,
+				  rq->fence.context,
+				  rq->fence.seqno,
+				  rq->sched.attr.priority);
+	}
+}
+
+static void
+reset_engine(struct intel_engine_cs *engine, struct i915_request *rq)
+{
+	if (IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM))
+		show_heartbeat(rq, engine);
+
+	intel_gt_handle_error(engine->gt, engine->mask,
+			      I915_ERROR_CAPTURE,
+			      "stopped heartbeat on %s",
+			      engine->name);
  }
 
  static void heartbeat(struct work_struct *wrk)
@@ -102,6 +120,11 @@ static void heartbeat(struct work_struct *wrk)
  	if (intel_gt_is_wedged(engine->gt))
  		goto out;
 
+	if (i915_sched_engine_disabled(engine->sched_engine)) {
+		reset_engine(engine, engine->heartbeat.systole);
+		goto out;
+	}
+
  	if (engine->heartbeat.systole) {
  		long delay = READ_ONCE(engine->props.heartbeat_interval_ms);
 
@@ -139,13 +162,7 @@ static void heartbeat(struct work_struct *wrk)
  			engine->sched_engine->schedule(rq, &attr);
  			local_bh_enable();
  		} else {
-			if (IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM))
-				show_heartbeat(rq, engine);
-
-			intel_gt_handle_error(engine->gt, engine->mask,
-					      I915_ERROR_CAPTURE,
-					      "stopped heartbeat on %s",
-					      engine->name);
+			reset_engine(engine, rq);
  		}
 
  		rq->emitted_jiffies = jiffies;
@@ -194,6 +211,26 @@ void intel_engine_park_heartbeat(struct intel_engine_cs *engine)
  		i915_request_put(fetch_and_zero(&engine->heartbeat.systole));
  }
 
+void intel_gt_unpark_heartbeats(struct intel_gt *gt)
+{
+	struct intel_engine_cs *engine;
+	enum intel_engine_id id;
+
+	for_each_engine(engine, gt, id)
+		if (intel_engine_pm_is_awake(engine))
+			intel_engine_unpark_heartbeat(engine);
+
+}
+
+void intel_gt_park_heartbeats(struct intel_gt *gt)
+{
+	struct intel_engine_cs *engine;
+	enum intel_engine_id id;
+
+	for_each_engine(engine, gt, id)
+		intel_engine_park_heartbeat(engine);
+}
+
  void intel_engine_init_heartbeat(struct intel_engine_cs *engine)
  {
  	INIT_DELAYED_WORK(&engine->heartbeat.work, heartbeat);
drivers/gpu/drm/i915/gt/intel_engine_heartbeat.h +4 -0
index a488ea3e84a3..5da6d809a87a 100644
@@ -7,6 +7,7 @@
  #define INTEL_ENGINE_HEARTBEAT_H
 
  struct intel_engine_cs;
+struct intel_gt;
 
  void intel_engine_init_heartbeat(struct intel_engine_cs *engine);
 
@@ -16,6 +17,9 @@ int intel_engine_set_heartbeat(struct intel_engine_cs *engine,
  void intel_engine_park_heartbeat(struct intel_engine_cs *engine);
  void intel_engine_unpark_heartbeat(struct intel_engine_cs *engine);
 
+void intel_gt_park_heartbeats(struct intel_gt *gt);
+void intel_gt_unpark_heartbeats(struct intel_gt *gt);
+
  int intel_engine_pulse(struct intel_engine_cs *engine);
  int intel_engine_flush_barriers(struct intel_engine_cs *engine);
 
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +9 -0
index b8c894ad8caf..59fca9748c15 100644
@@ -10,6 +10,7 @@
  #include "gt/intel_breadcrumbs.h"
  #include "gt/intel_context.h"
  #include "gt/intel_engine_pm.h"
+#include "gt/intel_engine_heartbeat.h"
  #include "gt/intel_gt.h"
  #include "gt/intel_gt_irq.h"
  #include "gt/intel_gt_pm.h"
@@ -605,6 +606,7 @@ void intel_guc_submission_reset_prepare(struct intel_guc *guc)
  		/* Reset called during driver load? GuC not yet initialised! */
  		return;
 
+	intel_gt_park_heartbeats(guc_to_gt(guc));
  	disable_submission(guc);
  	guc->interrupts.disable(guc);
 
@@ -890,6 +892,7 @@ void intel_guc_submission_reset_finish(struct intel_guc *guc)
  	atomic_set(&guc->outstanding_submission_g2h, 0);
 
  	enable_submission(guc);
+	intel_gt_unpark_heartbeats(guc_to_gt(guc));
  }
 
  /*
@@ -1859,6 +1862,11 @@ static int guc_resume(struct intel_engine_cs *engine)
  	return 0;
  }
 
+static bool guc_sched_engine_disabled(struct i915_sched_engine *sched_engine)
+{
+	return !sched_engine->tasklet.callback;
+}
+
  static void guc_set_default_submission(struct intel_engine_cs *engine)
  {
  	engine->submit_request = guc_submit_request;
@@ -2009,6 +2017,7 @@ int intel_guc_submission_setup(struct intel_engine_cs *engine)
  			return -ENOMEM;
 
  		guc->sched_engine->schedule = i915_schedule;
+		guc->sched_engine->disabled = guc_sched_engine_disabled;
  		guc->sched_engine->private_data = guc;
  		tasklet_setup(&guc->sched_engine->tasklet,
  			      guc_submission_tasklet);
drivers/gpu/drm/i915/i915_scheduler.c +6 -0
index 3a58a9130309..3fb009ea2cb2 100644
@@ -440,6 +440,11 @@ void i915_sched_engine_free(struct kref *kref)
  	kfree(sched_engine);
  }
 
+static bool default_disabled(struct i915_sched_engine *sched_engine)
+{
+	return false;
+}
+
  struct i915_sched_engine *
  i915_sched_engine_create(unsigned int subclass)
  {
@@ -453,6 +458,7 @@ i915_sched_engine_create(unsigned int subclass)
 
  	sched_engine->queue = RB_ROOT_CACHED;
  	sched_engine->queue_priority_hint = INT_MIN;
+	sched_engine->disabled = default_disabled;
 
  	INIT_LIST_HEAD(&sched_engine->requests);
  	INIT_LIST_HEAD(&sched_engine->hold);
drivers/gpu/drm/i915/i915_scheduler.h +6 -0
index 650ab8e0db9f..72105a53b0e1 100644
@@ -98,4 +98,10 @@ void i915_request_show_with_schedule(struct drm_printer *m,
  				     const char *prefix,
  				     int indent);
 
+static inline bool
+i915_sched_engine_disabled(struct i915_sched_engine *sched_engine)
+{
+	return sched_engine->disabled(sched_engine);
+}
+
  #endif /* _I915_SCHEDULER_H_ */
drivers/gpu/drm/i915/i915_scheduler_types.h +0 -0
index 5935c3152bdc..cfaf52e528d0 100644
@@ -163,6 +163,11 @@ struct i915_sched_engine {
  	 */

drivers/gpu/drm/i915/i915_scheduler_types.h struct i915_sched_engine { · line 173

Quoted 10 lines
drivers/gpu/drm/i915/i915_scheduler_types.h +5 -0
  	void *private_data;
 
+	/**
+	 * @disabled: check if backend has disabled submission
+	 */
+	bool	(*disabled)(struct i915_sched_engine *sched_engine);
+
  	/**
  	 * @kick_backend: kick backend after a request's priority has changed
  	 */

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

#108 lore raw

PATCH 33/47 drm/i915/guc: Add disable interrupts to guc sanitize

In reply to Matthew Brost

Add disable GuC interrupts to intel_guc_sanitize(). Part of this requires moving the guc_*_interrupt wrapper function into header file intel_guc.h.

Cc Daniele Ceraolo Spurio <[email protected]
---
 drivers/gpu/drm/i915/gt/uc/intel_guc.h | 16 ++++++++++++++++
 drivers/gpu/drm/i915/gt/uc/intel_uc.c  | 21 +++------------------
 2 files changed, 19 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc.h +16 -0
index 40c9868762d7..85ef6767f13b 100644
@@ -217,9 +217,25 @@ static inline bool intel_guc_is_ready(struct intel_guc *guc)
 	return intel_guc_is_fw_running(guc) && intel_guc_ct_enabled(&guc->ct);
 }
 
+static inline void intel_guc_reset_interrupts(struct intel_guc *guc)
+{
+	guc->interrupts.reset(guc);
+}
+
+static inline void intel_guc_enable_interrupts(struct intel_guc *guc)
+{
+	guc->interrupts.enable(guc);
+}
+
+static inline void intel_guc_disable_interrupts(struct intel_guc *guc)
+{
+	guc->interrupts.disable(guc);
+}
+
 static inline int intel_guc_sanitize(struct intel_guc *guc)
 {
 	intel_uc_fw_sanitize(&guc->fw);
+	intel_guc_disable_interrupts(guc);
 	intel_guc_ct_sanitize(&guc->ct);
 	guc->mmio_msg = 0;
 
drivers/gpu/drm/i915/gt/uc/intel_uc.c +3 -18
index f0b02200aa01..ab11fe731ee7 100644
@@ -207,21 +207,6 @@ static void guc_handle_mmio_msg(struct intel_guc *guc)
 	spin_unlock_irq(&guc->irq_lock);
 }
 
-static void guc_reset_interrupts(struct intel_guc *guc)
-{
-	guc->interrupts.reset(guc);
-}
-
-static void guc_enable_interrupts(struct intel_guc *guc)
-{
-	guc->interrupts.enable(guc);
-}
-
-static void guc_disable_interrupts(struct intel_guc *guc)
-{
-	guc->interrupts.disable(guc);
-}
-
 static int guc_enable_communication(struct intel_guc *guc)
 {
 	struct intel_gt *gt = guc_to_gt(guc);
@@ -242,7 +227,7 @@ static int guc_enable_communication(struct intel_guc *guc)
 	guc_get_mmio_msg(guc);
 	guc_handle_mmio_msg(guc);
 
-	guc_enable_interrupts(guc);
+	intel_guc_enable_interrupts(guc);
 
 	/* check for CT messages received before we enabled interrupts */
 	spin_lock_irq(&gt->irq_lock);
@@ -265,7 +250,7 @@ static void guc_disable_communication(struct intel_guc *guc)
 	 */
 	guc_clear_mmio_msg(guc);
 
-	guc_disable_interrupts(guc);
+	intel_guc_disable_interrupts(guc);
 
 	intel_guc_ct_disable(&guc->ct);
 
@@ -463,7 +448,7 @@ static int __uc_init_hw(struct intel_uc *uc)
 	if (ret)
 		goto err_out;
 
-	guc_reset_interrupts(guc);
+	intel_guc_reset_interrupts(guc);
 
 	/* WaEnableuKernelHeaderValidFix:skl */
 	/* WaEnableGuCBootHashCheckNotSet:skl,bxt,kbl */
Signature · 6 lines
2.28.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 33/47
#109 lore raw

Re: [PATCH 33/47] drm/i915/guc: Add disable interrupts to guc sanitize

Quoted 6 lines · Matthew Brost

Add disable GuC interrupts to intel_guc_sanitize(). Part of this requires moving the guc_*_interrupt wrapper function into header file intel_guc.h.

Cc Daniele Ceraolo Spurio <[email protected]
Quoted 88 lines
---
  drivers/gpu/drm/i915/gt/uc/intel_guc.h | 16 ++++++++++++++++
  drivers/gpu/drm/i915/gt/uc/intel_uc.c  | 21 +++------------------
  2 files changed, 19 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc.h +16 -0
index 40c9868762d7..85ef6767f13b 100644
@@ -217,9 +217,25 @@ static inline bool intel_guc_is_ready(struct intel_guc *guc)
  	return intel_guc_is_fw_running(guc) && intel_guc_ct_enabled(&guc->ct);
  }
 
+static inline void intel_guc_reset_interrupts(struct intel_guc *guc)
+{
+	guc->interrupts.reset(guc);
+}
+
+static inline void intel_guc_enable_interrupts(struct intel_guc *guc)
+{
+	guc->interrupts.enable(guc);
+}
+
+static inline void intel_guc_disable_interrupts(struct intel_guc *guc)
+{
+	guc->interrupts.disable(guc);
+}
+
  static inline int intel_guc_sanitize(struct intel_guc *guc)
  {
  	intel_uc_fw_sanitize(&guc->fw);
+	intel_guc_disable_interrupts(guc);
  	intel_guc_ct_sanitize(&guc->ct);
  	guc->mmio_msg = 0;
 
drivers/gpu/drm/i915/gt/uc/intel_uc.c +3 -18
index f0b02200aa01..ab11fe731ee7 100644
@@ -207,21 +207,6 @@ static void guc_handle_mmio_msg(struct intel_guc *guc)
  	spin_unlock_irq(&guc->irq_lock);
  }
 
-static void guc_reset_interrupts(struct intel_guc *guc)
-{
-	guc->interrupts.reset(guc);
-}
-
-static void guc_enable_interrupts(struct intel_guc *guc)
-{
-	guc->interrupts.enable(guc);
-}
-
-static void guc_disable_interrupts(struct intel_guc *guc)
-{
-	guc->interrupts.disable(guc);
-}
-
  static int guc_enable_communication(struct intel_guc *guc)
  {
  	struct intel_gt *gt = guc_to_gt(guc);
@@ -242,7 +227,7 @@ static int guc_enable_communication(struct intel_guc *guc)
  	guc_get_mmio_msg(guc);
  	guc_handle_mmio_msg(guc);
 
-	guc_enable_interrupts(guc);
+	intel_guc_enable_interrupts(guc);
 
  	/* check for CT messages received before we enabled interrupts */
  	spin_lock_irq(&gt->irq_lock);
@@ -265,7 +250,7 @@ static void guc_disable_communication(struct intel_guc *guc)
  	 */
  	guc_clear_mmio_msg(guc);
 
-	guc_disable_interrupts(guc);
+	intel_guc_disable_interrupts(guc);
 
  	intel_guc_ct_disable(&guc->ct);
 
@@ -463,7 +448,7 @@ static int __uc_init_hw(struct intel_uc *uc)
  	if (ret)
  		goto err_out;
 
-	guc_reset_interrupts(guc);
+	intel_guc_reset_interrupts(guc);
 
  	/* WaEnableuKernelHeaderValidFix:skl */
  	/* WaEnableGuCBootHashCheckNotSet:skl,bxt,kbl */
#110 lore raw

PATCH 34/47 drm/i915/guc: Suspend/resume implementation for new interface

In reply to Matthew Brost

The new GuC interface introduces an MMIO H2G command, INTEL_GUC_ACTION_RESET_CLIENT, which is used to implement suspend. This MMIO tears down any active contexts generating a context reset G2H CTB for each. Once that step completes the GuC tears down the CTB channels. It is safe to suspend once this MMIO H2G command completes and all G2H CTBs have been processed. In practice the i915 will likely never receive a G2H as suspend should only be called after the GPU is idle.

Resume is implemented in the same manner as before - simply reload the GuC firmware and reinitialize everything (e.g. CTB channels, contexts, etc..).

---
 .../gpu/drm/i915/gt/uc/abi/guc_actions_abi.h  |  1 +
 drivers/gpu/drm/i915/gt/uc/intel_guc.c        | 64 ++++++++-----------
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 14 ++--
 .../gpu/drm/i915/gt/uc/intel_guc_submission.h |  5 ++
 drivers/gpu/drm/i915/gt/uc/intel_uc.c         | 20 ++++--
 5 files changed, 53 insertions(+), 51 deletions(-)
drivers/gpu/drm/i915/gt/uc/abi/guc_actions_abi.h +1 -0
index 57e18babdf4b..596cf4b818e5 100644
@@ -142,6 +142,7 @@ enum intel_guc_action {
 	INTEL_GUC_ACTION_REGISTER_COMMAND_TRANSPORT_BUFFER = 0x4505,
 	INTEL_GUC_ACTION_DEREGISTER_COMMAND_TRANSPORT_BUFFER = 0x4506,
 	INTEL_GUC_ACTION_DEREGISTER_CONTEXT_DONE = 0x4600,
+	INTEL_GUC_ACTION_RESET_CLIENT = 0x5B01,
 	INTEL_GUC_ACTION_LIMIT
 };
 
drivers/gpu/drm/i915/gt/uc/intel_guc.c +26 -38

84 lines not on this page · raw message

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +7 -7
index 59fca9748c15..16b61fe71b07 100644
@@ -304,10 +304,10 @@ static int guc_submission_busy_loop(struct intel_guc* guc,
 	return err;
 }
 
-static int guc_wait_for_pending_msg(struct intel_guc *guc,
-				    atomic_t *wait_var,
-				    bool interruptible,
-				    long timeout)
+int intel_guc_wait_for_pending_msg(struct intel_guc *guc,
+				   atomic_t *wait_var,
+				   bool interruptible,
+				   long timeout)
 {
 	const int state = interruptible ?
 		TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE;
@@ -352,8 +352,8 @@ int intel_guc_wait_for_idle(struct intel_guc *guc, long timeout)
 	if (unlikely(timeout < 0))
 		timeout = -timeout, interruptible = false;
 
-	return guc_wait_for_pending_msg(guc, &guc->outstanding_submission_g2h,
-					interruptible, timeout);
+	return intel_guc_wait_for_pending_msg(guc, &guc->outstanding_submission_g2h,
+					      interruptible, timeout);
 }
 
 static int guc_lrc_desc_pin(struct intel_context *ce, bool loop);
@@ -625,7 +625,7 @@ void intel_guc_submission_reset_prepare(struct intel_guc *guc)
 	for (i = 0; i < 4 && atomic_read(&guc->outstanding_submission_g2h); ++i) {
 		intel_guc_to_host_event_handler(guc);
 #define wait_for_reset(guc, wait_var) \
-		guc_wait_for_pending_msg(guc, wait_var, false, (HZ / 20))
+		intel_guc_wait_for_pending_msg(guc, wait_var, false, (HZ / 20))
 		do {
 			wait_for_reset(guc, &guc->outstanding_submission_g2h);
 		} while (!list_empty(&guc->ct.requests.incoming));
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h +5 -0
index 95df5ab06031..b9b9f0f60f91 100644
@@ -27,6 +27,11 @@ void intel_guc_log_context_info(struct intel_guc *guc, struct drm_printer *p);
 
 bool intel_guc_virtual_engine_has_heartbeat(const struct intel_engine_cs *ve);
 
+int intel_guc_wait_for_pending_msg(struct intel_guc *guc,
+				   atomic_t *wait_var,
+				   bool interruptible,
+				   long timeout);
+
 static inline bool intel_guc_submission_is_supported(struct intel_guc *guc)
 {
 	/* XXX: GuC submission is unavailable for now */
drivers/gpu/drm/i915/gt/uc/intel_uc.c +14 -6
index ab11fe731ee7..b523a8521351 100644
@@ -596,14 +596,18 @@ void intel_uc_cancel_requests(struct intel_uc *uc)
 void intel_uc_runtime_suspend(struct intel_uc *uc)
 {
 	struct intel_guc *guc = &uc->guc;
-	int err;
 
 	if (!intel_guc_is_ready(guc))
 		return;
 
-	err = intel_guc_suspend(guc);
-	if (err)
-		DRM_DEBUG_DRIVER("Failed to suspend GuC, err=%d", err);
+	/*
+	 * Wait for any outstanding CTB before tearing down communication /w the
+	 * GuC.
+	 */
+#define OUTSTANDING_CTB_TIMEOUT_PERIOD	(HZ / 5)
+	intel_guc_wait_for_pending_msg(guc, &guc->outstanding_submission_g2h,
+				       false, OUTSTANDING_CTB_TIMEOUT_PERIOD);
+	GEM_WARN_ON(atomic_read(&guc->outstanding_submission_g2h));
 
 	guc_disable_communication(guc);
 }
@@ -612,12 +616,16 @@ void intel_uc_suspend(struct intel_uc *uc)
 {
 	struct intel_guc *guc = &uc->guc;
 	intel_wakeref_t wakeref;
+	int err;
 
 	if (!intel_guc_is_ready(guc))
 		return;
 
-	with_intel_runtime_pm(uc_to_gt(uc)->uncore->rpm, wakeref)
-		intel_uc_runtime_suspend(uc);
+	with_intel_runtime_pm(&uc_to_gt(uc)->i915->runtime_pm, wakeref) {
+		err = intel_guc_suspend(guc);
+		if (err)
+			DRM_DEBUG_DRIVER("Failed to suspend GuC, err=%d", err);
+	}
 }
 
 static int __uc_resume(struct intel_uc *uc, bool enable_communication)
Signature · 1 line
2.28.0
Reviewed-by on v1 34/47
#111 lore raw

Re: [PATCH 34/47] drm/i915/guc: Suspend/resume implementation for new interface

Quoted 9 lines · Matthew Brost

The new GuC interface introduces an MMIO H2G command, INTEL_GUC_ACTION_RESET_CLIENT, which is used to implement suspend. This MMIO tears down any active contexts generating a context reset G2H CTB for each. Once that step completes the GuC tears down the CTB channels. It is safe to suspend once this MMIO H2G command completes and all G2H CTBs have been processed. In practice the i915 will likely never receive a G2H as suspend should only be called after the GPU is idle.

Quoted 7 lines

Resume is implemented in the same manner as before - simply reload the GuC firmware and reinitialize everything (e.g. CTB channels, contexts, etc..).

Quoted 211 lines
---
  .../gpu/drm/i915/gt/uc/abi/guc_actions_abi.h  |  1 +
  drivers/gpu/drm/i915/gt/uc/intel_guc.c        | 64 ++++++++-----------
  .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 14 ++--
  .../gpu/drm/i915/gt/uc/intel_guc_submission.h |  5 ++
  drivers/gpu/drm/i915/gt/uc/intel_uc.c         | 20 ++++--
  5 files changed, 53 insertions(+), 51 deletions(-)
drivers/gpu/drm/i915/gt/uc/abi/guc_actions_abi.h +1 -0
index 57e18babdf4b..596cf4b818e5 100644
@@ -142,6 +142,7 @@ enum intel_guc_action {
  	INTEL_GUC_ACTION_REGISTER_COMMAND_TRANSPORT_BUFFER = 0x4505,
  	INTEL_GUC_ACTION_DEREGISTER_COMMAND_TRANSPORT_BUFFER = 0x4506,
  	INTEL_GUC_ACTION_DEREGISTER_CONTEXT_DONE = 0x4600,
+	INTEL_GUC_ACTION_RESET_CLIENT = 0x5B01,
  	INTEL_GUC_ACTION_LIMIT
  };
 
drivers/gpu/drm/i915/gt/uc/intel_guc.c +26 -38
index 9b09395b998f..68266cbffd1f 100644
@@ -524,51 +524,34 @@ int intel_guc_auth_huc(struct intel_guc *guc, u32 rsa_offset)
   */
  int intel_guc_suspend(struct intel_guc *guc)
  {
-	struct intel_uncore *uncore = guc_to_gt(guc)->uncore;
  	int ret;
-	u32 status;
  	u32 action[] = {
-		INTEL_GUC_ACTION_ENTER_S_STATE,
-		GUC_POWER_D1, /* any value greater than GUC_POWER_D0 */
+		INTEL_GUC_ACTION_RESET_CLIENT,
  	};
 
-	/*
-	 * If GuC communication is enabled but submission is not supported,
-	 * we do not need to suspend the GuC.
-	 */
-	if (!intel_guc_submission_is_used(guc) || !intel_guc_is_ready(guc))
+	if (!intel_guc_is_ready(guc))
  		return 0;
 
-	/*
-	 * The ENTER_S_STATE action queues the save/restore operation in GuC FW
-	 * and then returns, so waiting on the H2G is not enough to guarantee
-	 * GuC is done. When all the processing is done, GuC writes
-	 * INTEL_GUC_SLEEP_STATE_SUCCESS to scratch register 14, so we can poll
-	 * on that. Note that GuC does not ensure that the value in the register
-	 * is different from INTEL_GUC_SLEEP_STATE_SUCCESS while the action is
-	 * in progress so we need to take care of that ourselves as well.
-	 */
-
-	intel_uncore_write(uncore, SOFT_SCRATCH(14),
-			   INTEL_GUC_SLEEP_STATE_INVALID_MASK);
-
-	ret = intel_guc_send(guc, action, ARRAY_SIZE(action));
-	if (ret)
-		return ret;
-
-	ret = __intel_wait_for_register(uncore, SOFT_SCRATCH(14),
-					INTEL_GUC_SLEEP_STATE_INVALID_MASK,
-					0, 0, 10, &status);
-	if (ret)
-		return ret;
-
-	if (status != INTEL_GUC_SLEEP_STATE_SUCCESS) {
-		DRM_ERROR("GuC failed to change sleep state. "
-			  "action=0x%x, err=%u\n",
-			  action[0], status);
-		return -EIO;
+	if (intel_guc_submission_is_used(guc)) {
+		/*
+		 * This H2G MMIO command tears down the GuC in two steps. First it will
+		 * generate a G2H CTB for every active context indicating a reset. In
+		 * practice the i915 shouldn't ever get a G2H as suspend should only be
+		 * called when the GPU is idle. Next, it tears down the CTBs and this
+		 * H2G MMIO command completes.
+		 *
+		 * Don't abort on a failure code from the GuC. Keep going and do the
+		 * clean up in santize() and re-initialisation on resume and hopefully
+		 * the error here won't be problematic.
+		 */
+		ret = intel_guc_send_mmio(guc, action, ARRAY_SIZE(action), NULL, 0);
+		if (ret)
+			DRM_ERROR("GuC suspend: RESET_CLIENT action failed with error %d!\n", ret);
  	}
 
+	/* Signal that the GuC isn't running. */
+	intel_guc_sanitize(guc);
+
  	return 0;
  }
 
@@ -578,7 +561,12 @@ int intel_guc_suspend(struct intel_guc *guc)
   */
  int intel_guc_resume(struct intel_guc *guc)
  {
-	/* XXX: to be implemented with submission interface rework */
+	/*
+	 * NB: This function can still be called even if GuC submission is
+	 * disabled, e.g. if GuC is enabled for HuC authentication only. Thus,
+	 * if any code is later added here, it must be support doing nothing
+	 * if submission is disabled (as per intel_guc_suspend).
+	 */
  	return 0;
  }
 
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +7 -7
index 59fca9748c15..16b61fe71b07 100644
@@ -304,10 +304,10 @@ static int guc_submission_busy_loop(struct intel_guc* guc,
  	return err;
  }
 
-static int guc_wait_for_pending_msg(struct intel_guc *guc,
-				    atomic_t *wait_var,
-				    bool interruptible,
-				    long timeout)
+int intel_guc_wait_for_pending_msg(struct intel_guc *guc,
+				   atomic_t *wait_var,
+				   bool interruptible,
+				   long timeout)
  {
  	const int state = interruptible ?
  		TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE;
@@ -352,8 +352,8 @@ int intel_guc_wait_for_idle(struct intel_guc *guc, long timeout)
  	if (unlikely(timeout < 0))
  		timeout = -timeout, interruptible = false;
 
-	return guc_wait_for_pending_msg(guc, &guc->outstanding_submission_g2h,
-					interruptible, timeout);
+	return intel_guc_wait_for_pending_msg(guc, &guc->outstanding_submission_g2h,
+					      interruptible, timeout);
  }
 
  static int guc_lrc_desc_pin(struct intel_context *ce, bool loop);
@@ -625,7 +625,7 @@ void intel_guc_submission_reset_prepare(struct intel_guc *guc)
  	for (i = 0; i < 4 && atomic_read(&guc->outstanding_submission_g2h); ++i) {
  		intel_guc_to_host_event_handler(guc);
  #define wait_for_reset(guc, wait_var) \
-		guc_wait_for_pending_msg(guc, wait_var, false, (HZ / 20))
+		intel_guc_wait_for_pending_msg(guc, wait_var, false, (HZ / 20))
  		do {
  			wait_for_reset(guc, &guc->outstanding_submission_g2h);
  		} while (!list_empty(&guc->ct.requests.incoming));
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h +5 -0
index 95df5ab06031..b9b9f0f60f91 100644
@@ -27,6 +27,11 @@ void intel_guc_log_context_info(struct intel_guc *guc, struct drm_printer *p);
 
  bool intel_guc_virtual_engine_has_heartbeat(const struct intel_engine_cs *ve);
 
+int intel_guc_wait_for_pending_msg(struct intel_guc *guc,
+				   atomic_t *wait_var,
+				   bool interruptible,
+				   long timeout);
+
  static inline bool intel_guc_submission_is_supported(struct intel_guc *guc)
  {
  	/* XXX: GuC submission is unavailable for now */
drivers/gpu/drm/i915/gt/uc/intel_uc.c +14 -6
index ab11fe731ee7..b523a8521351 100644
@@ -596,14 +596,18 @@ void intel_uc_cancel_requests(struct intel_uc *uc)
  void intel_uc_runtime_suspend(struct intel_uc *uc)
  {
  	struct intel_guc *guc = &uc->guc;
-	int err;
 
  	if (!intel_guc_is_ready(guc))
  		return;
 
-	err = intel_guc_suspend(guc);
-	if (err)
-		DRM_DEBUG_DRIVER("Failed to suspend GuC, err=%d", err);
+	/*
+	 * Wait for any outstanding CTB before tearing down communication /w the
+	 * GuC.
+	 */
+#define OUTSTANDING_CTB_TIMEOUT_PERIOD	(HZ / 5)
+	intel_guc_wait_for_pending_msg(guc, &guc->outstanding_submission_g2h,
+				       false, OUTSTANDING_CTB_TIMEOUT_PERIOD);
+	GEM_WARN_ON(atomic_read(&guc->outstanding_submission_g2h));
 
  	guc_disable_communication(guc);
  }
@@ -612,12 +616,16 @@ void intel_uc_suspend(struct intel_uc *uc)
  {
  	struct intel_guc *guc = &uc->guc;
  	intel_wakeref_t wakeref;
+	int err;
 
  	if (!intel_guc_is_ready(guc))
  		return;
 
-	with_intel_runtime_pm(uc_to_gt(uc)->uncore->rpm, wakeref)
-		intel_uc_runtime_suspend(uc);
+	with_intel_runtime_pm(&uc_to_gt(uc)->i915->runtime_pm, wakeref) {
+		err = intel_guc_suspend(guc);
+		if (err)
+			DRM_DEBUG_DRIVER("Failed to suspend GuC, err=%d", err);
+	}
  }
 
  static int __uc_resume(struct intel_uc *uc, bool enable_communication)
#112 lore raw

PATCH 35/47 drm/i915/guc: Handle context reset notification

In reply to Matthew Brost

GuC will issue a reset on detecting an engine hang and will notify the driver via a G2H message. The driver will service the notification by resetting the guilty context to a simple state or banning it completely.

Cc Matthew Brost <[email protected]>
Cc John Harrison <[email protected]>
---
 drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  2 ++
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |  3 ++
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 35 +++++++++++++++++++
 drivers/gpu/drm/i915/i915_trace.h             | 10 ++++++
 4 files changed, 50 insertions(+)
drivers/gpu/drm/i915/gt/uc/intel_guc.h +2 -0
index 85ef6767f13b..e94b0ef733da 100644
@@ -262,6 +262,8 @@ int intel_guc_deregister_done_process_msg(struct intel_guc *guc,
 					  const u32 *msg, u32 len);
 int intel_guc_sched_done_process_msg(struct intel_guc *guc,
 				     const u32 *msg, u32 len);
+int intel_guc_context_reset_process_msg(struct intel_guc *guc,
+					const u32 *msg, u32 len);
 
 void intel_guc_submission_reset_prepare(struct intel_guc *guc);
 void intel_guc_submission_reset(struct intel_guc *guc, bool stalled);
drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c +3 -0
index 4ed074df88e5..a2020373b8e8 100644
@@ -945,6 +945,9 @@ static int ct_process_request(struct intel_guc_ct *ct, struct ct_incoming_msg *r
 	case INTEL_GUC_ACTION_SCHED_CONTEXT_MODE_DONE:
 		ret = intel_guc_sched_done_process_msg(guc, payload, len);
 		break;
+	case INTEL_GUC_ACTION_CONTEXT_RESET_NOTIFICATION:
+		ret = intel_guc_context_reset_process_msg(guc, payload, len);
+		break;
 	default:
 		ret = -EOPNOTSUPP;
 		break;
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +35 -0
index 16b61fe71b07..9845c5bd9832 100644
@@ -2192,6 +2192,41 @@ int intel_guc_sched_done_process_msg(struct intel_guc *guc,
 	return 0;
 }
 
+static void guc_context_replay(struct intel_context *ce)
+{
+	struct i915_sched_engine *sched_engine = ce->engine->sched_engine;
+
+	__guc_reset_context(ce, true);
+	tasklet_hi_schedule(&sched_engine->tasklet);
+}
+
+static void guc_handle_context_reset(struct intel_guc *guc,
+				     struct intel_context *ce)
+{
+	trace_intel_context_reset(ce);
+	guc_context_replay(ce);
+}
+
+int intel_guc_context_reset_process_msg(struct intel_guc *guc,
+					const u32 *msg, u32 len)
+{
+	struct intel_context *ce;
+	int desc_idx = msg[0];
+
+	if (unlikely(len != 1)) {
+		drm_dbg(&guc_to_gt(guc)->i915->drm, "Invalid length %u", len);
+		return -EPROTO;
+	}
+
+	ce = g2h_context_lookup(guc, desc_idx);
+	if (unlikely(!ce))
+		return -EPROTO;
+
+	guc_handle_context_reset(guc, ce);
+
+	return 0;
+}
+
 void intel_guc_log_submission_info(struct intel_guc *guc,
 				   struct drm_printer *p)
 {
drivers/gpu/drm/i915/i915_trace.h +10 -0
index 97c2e83984ed..c095c4d39456 100644
@@ -929,6 +929,11 @@ DECLARE_EVENT_CLASS(intel_context,
 		      __entry->guc_sched_state_no_lock)
 );
 
+DEFINE_EVENT(intel_context, intel_context_reset,
+	     TP_PROTO(struct intel_context *ce),
+	     TP_ARGS(ce)
+);
+
 DEFINE_EVENT(intel_context, intel_context_register,
 	     TP_PROTO(struct intel_context *ce),
 	     TP_ARGS(ce)
@@ -1026,6 +1031,11 @@ trace_i915_request_out(struct i915_request *rq)
 {
 }
 
+static inline void
+trace_intel_context_reset(struct intel_context *ce)
+{
+}
+
 static inline void
 trace_intel_context_register(struct intel_context *ce)
 {
Signature · 6 lines
2.28.0

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

Re: [PATCH 35/47] drm/i915/guc: Handle context reset notification

Quoted 60 lines · Matthew Brost

GuC will issue a reset on detecting an engine hang and will notify the driver via a G2H message. The driver will service the notification by resetting the guilty context to a simple state or banning it completely.

Cc Matthew Brost <[email protected]>
Cc John Harrison <[email protected]>
---
  drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  2 ++
  drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |  3 ++
  .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 35 +++++++++++++++++++
  drivers/gpu/drm/i915/i915_trace.h             | 10 ++++++
  4 files changed, 50 insertions(+)
drivers/gpu/drm/i915/gt/uc/intel_guc.h +2 -0
index 85ef6767f13b..e94b0ef733da 100644
@@ -262,6 +262,8 @@ int intel_guc_deregister_done_process_msg(struct intel_guc *guc,
  					  const u32 *msg, u32 len);
  int intel_guc_sched_done_process_msg(struct intel_guc *guc,
  				     const u32 *msg, u32 len);
+int intel_guc_context_reset_process_msg(struct intel_guc *guc,
+					const u32 *msg, u32 len);
 
  void intel_guc_submission_reset_prepare(struct intel_guc *guc);
  void intel_guc_submission_reset(struct intel_guc *guc, bool stalled);
drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c +3 -0
index 4ed074df88e5..a2020373b8e8 100644
@@ -945,6 +945,9 @@ static int ct_process_request(struct intel_guc_ct *ct, struct ct_incoming_msg *r
  	case INTEL_GUC_ACTION_SCHED_CONTEXT_MODE_DONE:
  		ret = intel_guc_sched_done_process_msg(guc, payload, len);
  		break;
+	case INTEL_GUC_ACTION_CONTEXT_RESET_NOTIFICATION:
+		ret = intel_guc_context_reset_process_msg(guc, payload, len);
+		break;
  	default:
  		ret = -EOPNOTSUPP;
  		break;
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +10 -0
index 16b61fe71b07..9845c5bd9832 100644
@@ -2192,6 +2192,41 @@ int intel_guc_sched_done_process_msg(struct intel_guc *guc,
  	return 0;
  }
 
+static void guc_context_replay(struct intel_context *ce)
+{
+	struct i915_sched_engine *sched_engine = ce->engine->sched_engine;
+
+	__guc_reset_context(ce, true);
+	tasklet_hi_schedule(&sched_engine->tasklet);
+}
+
+static void guc_handle_context_reset(struct intel_guc *guc,
+				     struct intel_context *ce)

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c int intel_guc_sched_done_process_msg(struct intel_guc *guc, · line 2214

Quoted 10 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +10 -0
+{
+	trace_intel_context_reset(ce);
+	guc_context_replay(ce);
+}
+
+int intel_guc_context_reset_process_msg(struct intel_guc *guc,
+					const u32 *msg, u32 len)
+{
+	struct intel_context *ce;
+	int desc_idx = msg[0];

Should do this dereference after checking the length? Or is it guaranteed that the length cannot be zero?

John.

Quoted 46 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +15 -0
+
+	if (unlikely(len != 1)) {
+		drm_dbg(&guc_to_gt(guc)->i915->drm, "Invalid length %u", len);
+		return -EPROTO;
+	}
+
+	ce = g2h_context_lookup(guc, desc_idx);
+	if (unlikely(!ce))
+		return -EPROTO;
+
+	guc_handle_context_reset(guc, ce);
+
+	return 0;
+}
+
  void intel_guc_log_submission_info(struct intel_guc *guc,
  				   struct drm_printer *p)
  {
drivers/gpu/drm/i915/i915_trace.h +10 -0
index 97c2e83984ed..c095c4d39456 100644
@@ -929,6 +929,11 @@ DECLARE_EVENT_CLASS(intel_context,
  		      __entry->guc_sched_state_no_lock)
  );
 
+DEFINE_EVENT(intel_context, intel_context_reset,
+	     TP_PROTO(struct intel_context *ce),
+	     TP_ARGS(ce)
+);
+
  DEFINE_EVENT(intel_context, intel_context_register,
  	     TP_PROTO(struct intel_context *ce),
  	     TP_ARGS(ce)
@@ -1026,6 +1031,11 @@ trace_i915_request_out(struct i915_request *rq)
  {
  }
 
+static inline void
+trace_intel_context_reset(struct intel_context *ce)
+{
+}
+
  static inline void
  trace_intel_context_register(struct intel_context *ce)
  {
#114 lore raw

Re: [PATCH 35/47] drm/i915/guc: Handle context reset notification

Quoted 63 lines · John Harrison
Quoted 62 lines · Matthew Brost

GuC will issue a reset on detecting an engine hang and will notify the driver via a G2H message. The driver will service the notification by resetting the guilty context to a simple state or banning it completely.

Cc Matthew Brost <[email protected]>
Cc John Harrison <[email protected]>
---
  drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  2 ++
  drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |  3 ++
  .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 35 +++++++++++++++++++
  drivers/gpu/drm/i915/i915_trace.h             | 10 ++++++
  4 files changed, 50 insertions(+)
drivers/gpu/drm/i915/gt/uc/intel_guc.h +2 -0
index 85ef6767f13b..e94b0ef733da 100644
@@ -262,6 +262,8 @@ int intel_guc_deregister_done_process_msg(struct intel_guc *guc,
  					  const u32 *msg, u32 len);
  int intel_guc_sched_done_process_msg(struct intel_guc *guc,
  				     const u32 *msg, u32 len);
+int intel_guc_context_reset_process_msg(struct intel_guc *guc,
+					const u32 *msg, u32 len);
  void intel_guc_submission_reset_prepare(struct intel_guc *guc);
  void intel_guc_submission_reset(struct intel_guc *guc, bool stalled);
drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c +3 -0
index 4ed074df88e5..a2020373b8e8 100644
@@ -945,6 +945,9 @@ static int ct_process_request(struct intel_guc_ct *ct, struct ct_incoming_msg *r
  	case INTEL_GUC_ACTION_SCHED_CONTEXT_MODE_DONE:
  		ret = intel_guc_sched_done_process_msg(guc, payload, len);
  		break;
+	case INTEL_GUC_ACTION_CONTEXT_RESET_NOTIFICATION:
+		ret = intel_guc_context_reset_process_msg(guc, payload, len);
+		break;
  	default:
  		ret = -EOPNOTSUPP;
  		break;
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +14 -0
index 16b61fe71b07..9845c5bd9832 100644
@@ -2192,6 +2192,41 @@ int intel_guc_sched_done_process_msg(struct intel_guc *guc,
  	return 0;
  }
+static void guc_context_replay(struct intel_context *ce)
+{
+	struct i915_sched_engine *sched_engine = ce->engine->sched_engine;
+
+	__guc_reset_context(ce, true);
+	tasklet_hi_schedule(&sched_engine->tasklet);
+}
+
+static void guc_handle_context_reset(struct intel_guc *guc,
+				     struct intel_context *ce)
+{
+	trace_intel_context_reset(ce);
+	guc_context_replay(ce);
+}
Quoted 9 lines

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c int intel_guc_sched_done_process_msg(struct intel_guc *guc, · line 2214

Quoted 6 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +6 -0
+
+int intel_guc_context_reset_process_msg(struct intel_guc *guc,
+					const u32 *msg, u32 len)
+{
+	struct intel_context *ce;
+	int desc_idx = msg[0];

Should do this dereference after checking the length? Or is it guaranteed that the length cannot be zero?

I think for safety, it should be moved.

Matt

Quoted 38 lines

John.

Quoted 36 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +15 -0
+
+	if (unlikely(len != 1)) {
+		drm_dbg(&guc_to_gt(guc)->i915->drm, "Invalid length %u", len);
+		return -EPROTO;
+	}
+
+	ce = g2h_context_lookup(guc, desc_idx);
+	if (unlikely(!ce))
+		return -EPROTO;
+
+	guc_handle_context_reset(guc, ce);
+
+	return 0;
+}
+
  void intel_guc_log_submission_info(struct intel_guc *guc,
  				   struct drm_printer *p)
  {
drivers/gpu/drm/i915/i915_trace.h +5 -0
index 97c2e83984ed..c095c4d39456 100644
@@ -929,6 +929,11 @@ DECLARE_EVENT_CLASS(intel_context,
  		      __entry->guc_sched_state_no_lock)
  );
+DEFINE_EVENT(intel_context, intel_context_reset,
+	     TP_PROTO(struct intel_context *ce),
+	     TP_ARGS(ce)
+);
+
  DEFINE_EVENT(intel_context, intel_context_register,
  	     TP_PROTO(struct intel_context *ce),
  	     TP_ARGS(ce)
@@ -1026,6 +1031,11 @@ trace_i915_request_out(struct i915_request *rq)
  {
  }
Quoted 9 lines

drivers/gpu/drm/i915/i915_trace.h trace_i915_request_out(struct i915_request *rq) · line 1041

Quoted 8 lines
drivers/gpu/drm/i915/i915_trace.h +5 -0
+static inline void
+trace_intel_context_reset(struct intel_context *ce)
+{
+}
+
  static inline void
  trace_intel_context_register(struct intel_context *ce)
  {

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

#115 lore raw

PATCH 36/47 drm/i915/guc: Handle engine reset failure notification

In reply to Matthew Brost

GuC will notify the driver, via G2H, if it fails to reset an engine. We recover by resorting to a full GPU reset.

---
 drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  2 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |  3 ++
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 43 +++++++++++++++++++
 3 files changed, 48 insertions(+)
drivers/gpu/drm/i915/gt/uc/intel_guc.h +2 -0
index e94b0ef733da..99742625e6ff 100644
@@ -264,6 +264,8 @@ int intel_guc_sched_done_process_msg(struct intel_guc *guc,
 				     const u32 *msg, u32 len);
 int intel_guc_context_reset_process_msg(struct intel_guc *guc,
 					const u32 *msg, u32 len);
+int intel_guc_engine_failure_process_msg(struct intel_guc *guc,
+					 const u32 *msg, u32 len);
 
 void intel_guc_submission_reset_prepare(struct intel_guc *guc);
 void intel_guc_submission_reset(struct intel_guc *guc, bool stalled);
drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c +3 -0
index a2020373b8e8..dd6177c8d75c 100644
@@ -948,6 +948,9 @@ static int ct_process_request(struct intel_guc_ct *ct, struct ct_incoming_msg *r
 	case INTEL_GUC_ACTION_CONTEXT_RESET_NOTIFICATION:
 		ret = intel_guc_context_reset_process_msg(guc, payload, len);
 		break;
+	case INTEL_GUC_ACTION_ENGINE_FAILURE_NOTIFICATION:
+		ret = intel_guc_engine_failure_process_msg(guc, payload, len);
+		break;
 	default:
 		ret = -EOPNOTSUPP;
 		break;
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +43 -0

49 lines not on this page · raw message

Signature · 1 line
2.28.0
Reviewed-by on v1 36/47
#116 lore raw

Re: [PATCH 36/47] drm/i915/guc: Handle engine reset failure notification

Quoted 6 lines · Matthew Brost

GuC will notify the driver, via G2H, if it fails to reset an engine. We recover by resorting to a full GPU reset.

Quoted 87 lines
---
  drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  2 +
  drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |  3 ++
  .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 43 +++++++++++++++++++
  3 files changed, 48 insertions(+)
drivers/gpu/drm/i915/gt/uc/intel_guc.h +2 -0
index e94b0ef733da..99742625e6ff 100644
@@ -264,6 +264,8 @@ int intel_guc_sched_done_process_msg(struct intel_guc *guc,
  				     const u32 *msg, u32 len);
  int intel_guc_context_reset_process_msg(struct intel_guc *guc,
  					const u32 *msg, u32 len);
+int intel_guc_engine_failure_process_msg(struct intel_guc *guc,
+					 const u32 *msg, u32 len);
 
  void intel_guc_submission_reset_prepare(struct intel_guc *guc);
  void intel_guc_submission_reset(struct intel_guc *guc, bool stalled);
drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c +3 -0
index a2020373b8e8..dd6177c8d75c 100644
@@ -948,6 +948,9 @@ static int ct_process_request(struct intel_guc_ct *ct, struct ct_incoming_msg *r
  	case INTEL_GUC_ACTION_CONTEXT_RESET_NOTIFICATION:
  		ret = intel_guc_context_reset_process_msg(guc, payload, len);
  		break;
+	case INTEL_GUC_ACTION_ENGINE_FAILURE_NOTIFICATION:
+		ret = intel_guc_engine_failure_process_msg(guc, payload, len);
+		break;
  	default:
  		ret = -EOPNOTSUPP;
  		break;
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +43 -0
index 9845c5bd9832..c3223958dfe0 100644
@@ -2227,6 +2227,49 @@ int intel_guc_context_reset_process_msg(struct intel_guc *guc,
  	return 0;
  }
 
+static struct intel_engine_cs *
+guc_lookup_engine(struct intel_guc *guc, u8 guc_class, u8 instance)
+{
+	struct intel_gt *gt = guc_to_gt(guc);
+	u8 engine_class = guc_class_to_engine_class(guc_class);
+
+	/* Class index is checked in class converter */
+	GEM_BUG_ON(instance > MAX_ENGINE_INSTANCE);
+
+	return gt->engine_class[engine_class][instance];
+}
+
+int intel_guc_engine_failure_process_msg(struct intel_guc *guc,
+					 const u32 *msg, u32 len)
+{
+	struct intel_engine_cs *engine;
+	u8 guc_class, instance;
+	u32 reason;
+
+	if (unlikely(len != 3)) {
+		drm_dbg(&guc_to_gt(guc)->i915->drm, "Invalid length %u", len);
+		return -EPROTO;
+	}
+
+	guc_class = msg[0];
+	instance = msg[1];
+	reason = msg[2];
+
+	engine = guc_lookup_engine(guc, guc_class, instance);
+	if (unlikely(!engine)) {
+		drm_dbg(&guc_to_gt(guc)->i915->drm,
+			"Invalid engine %d:%d", guc_class, instance);
+		return -EPROTO;
+	}
+
+	intel_gt_handle_error(guc_to_gt(guc), engine->mask,
+			      I915_ERROR_CAPTURE,
+			      "GuC failed to reset %s (reason=0x%08x)\n",
+			      engine->name, reason);
+
+	return 0;
+}
+
  void intel_guc_log_submission_info(struct intel_guc *guc,
  				   struct drm_printer *p)
  {
#117 lore raw

PATCH 37/47 drm/i915/guc: Enable the timer expired interrupt for GuC

In reply to Matthew Brost

The GuC can implement execution qunatums, detect hung contexts and other such things but it requires the timer expired interrupt to do so.

---
 drivers/gpu/drm/i915/gt/intel_rps.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/gt/intel_rps.c +4 -0
index 06e9a8ed4e03..0c8e7f2b06f0 100644
@@ -1877,6 +1877,10 @@ void intel_rps_init(struct intel_rps *rps)
 
 	if (GRAPHICS_VER(i915) >= 8 && GRAPHICS_VER(i915) < 11)
 		rps->pm_intrmsk_mbz |= GEN8_PMINTR_DISABLE_REDIRECT_TO_GUC;
+
+	/* GuC needs ARAT expired interrupt unmasked */
+	if (intel_uc_uses_guc_submission(&rps_to_gt(rps)->uc))
+		rps->pm_intrmsk_mbz |= ARAT_EXPIRED_INTRMSK;
 }
 
 void intel_rps_sanitize(struct intel_rps *rps)
Signature · 1 line
2.28.0
Reviewed-by on v1 37/47
#118 lore raw

Re: [PATCH 37/47] drm/i915/guc: Enable the timer expired interrupt for GuC

Quoted 5 lines · Matthew Brost

The GuC can implement execution qunatums, detect hung contexts and other such things but it requires the timer expired interrupt to do so.

Quoted 19 lines
---
  drivers/gpu/drm/i915/gt/intel_rps.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/gt/intel_rps.c +4 -0
index 06e9a8ed4e03..0c8e7f2b06f0 100644
@@ -1877,6 +1877,10 @@ void intel_rps_init(struct intel_rps *rps)
 
  	if (GRAPHICS_VER(i915) >= 8 && GRAPHICS_VER(i915) < 11)
  		rps->pm_intrmsk_mbz |= GEN8_PMINTR_DISABLE_REDIRECT_TO_GUC;
+
+	/* GuC needs ARAT expired interrupt unmasked */
+	if (intel_uc_uses_guc_submission(&rps_to_gt(rps)->uc))
+		rps->pm_intrmsk_mbz |= ARAT_EXPIRED_INTRMSK;
  }
 
  void intel_rps_sanitize(struct intel_rps *rps)
#119 lore raw

PATCH 38/47 drm/i915/guc: Provide mmio list to be saved/restored on engine reset

In reply to Matthew Brost

From: John Harrison <[email protected]>

The driver must provide GuC with a list of mmio registers that should be saved/restored during a GuC-based engine reset. Unfortunately, the list must be dynamically allocated as its size is variable. That means the driver must generate the list twice - once to work out the size and a second time to actually save it.

---
 drivers/gpu/drm/i915/gt/intel_workarounds.c   |  46 ++--
 .../gpu/drm/i915/gt/intel_workarounds_types.h |   1 +
 drivers/gpu/drm/i915/gt/uc/intel_guc.h        |   1 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c    | 199 +++++++++++++++++-
 drivers/gpu/drm/i915/i915_reg.h               |   1 +
 5 files changed, 222 insertions(+), 26 deletions(-)
drivers/gpu/drm/i915/gt/intel_workarounds.c +24 -22
index d9a5a445ceec..9bb85187f071 100644
@@ -150,13 +150,14 @@ static void _wa_add(struct i915_wa_list *wal, const struct i915_wa *wa)
 }
 
 static void wa_add(struct i915_wa_list *wal, i915_reg_t reg,
-		   u32 clear, u32 set, u32 read_mask)
+		   u32 clear, u32 set, u32 read_mask, bool masked_reg)
 {
 	struct i915_wa wa = {
 		.reg  = reg,
 		.clr  = clear,
 		.set  = set,
 		.read = read_mask,
+		.masked_reg = masked_reg,
 	};
 
 	_wa_add(wal, &wa);
@@ -165,7 +166,7 @@ static void wa_add(struct i915_wa_list *wal, i915_reg_t reg,
 static void
 wa_write_clr_set(struct i915_wa_list *wal, i915_reg_t reg, u32 clear, u32 set)
 {
-	wa_add(wal, reg, clear, set, clear);
+	wa_add(wal, reg, clear, set, clear, false);
 }
 
 static void
@@ -200,20 +201,20 @@ wa_write_clr(struct i915_wa_list *wal, i915_reg_t reg, u32 clr)
 static void
 wa_masked_en(struct i915_wa_list *wal, i915_reg_t reg, u32 val)
 {
-	wa_add(wal, reg, 0, _MASKED_BIT_ENABLE(val), val);
+	wa_add(wal, reg, 0, _MASKED_BIT_ENABLE(val), val, true);
 }
 
 static void
 wa_masked_dis(struct i915_wa_list *wal, i915_reg_t reg, u32 val)
 {
-	wa_add(wal, reg, 0, _MASKED_BIT_DISABLE(val), val);
+	wa_add(wal, reg, 0, _MASKED_BIT_DISABLE(val), val, true);
 }
 
 static void
 wa_masked_field_set(struct i915_wa_list *wal, i915_reg_t reg,
 		    u32 mask, u32 val)
 {
-	wa_add(wal, reg, 0, _MASKED_FIELD(mask, val), mask);
+	wa_add(wal, reg, 0, _MASKED_FIELD(mask, val), mask, true);
 }
 
 static void gen6_ctx_workarounds_init(struct intel_engine_cs *engine,
@@ -583,10 +584,10 @@ static void icl_ctx_workarounds_init(struct intel_engine_cs *engine,
 			     GEN11_BLEND_EMB_FIX_DISABLE_IN_RCC);
 
 	/* WaEnableFloatBlendOptimization:icl */
-	wa_write_clr_set(wal,
-			 GEN10_CACHE_MODE_SS,
-			 0, /* write-only, so skip validation */
-			 _MASKED_BIT_ENABLE(FLOAT_BLEND_OPTIMIZATION_ENABLE));
+	wa_add(wal, GEN10_CACHE_MODE_SS, 0,
+	       _MASKED_BIT_ENABLE(FLOAT_BLEND_OPTIMIZATION_ENABLE),
+	       0 /* write-only, so skip validation */,
+	       true);
 
 	/* WaDisableGPGPUMidThreadPreemption:icl */
 	wa_masked_field_set(wal, GEN8_CS_CHICKEN1,
@@ -631,7 +632,7 @@ static void gen12_ctx_gt_tuning_init(struct intel_engine_cs *engine,
 	       FF_MODE2,
 	       FF_MODE2_TDS_TIMER_MASK,
 	       FF_MODE2_TDS_TIMER_128,
-	       0);
+	       0, false);
 }
 
 static void gen12_ctx_workarounds_init(struct intel_engine_cs *engine,
@@ -669,7 +670,7 @@ static void gen12_ctx_workarounds_init(struct intel_engine_cs *engine,
 	       FF_MODE2,
 	       FF_MODE2_GS_TIMER_MASK,
 	       FF_MODE2_GS_TIMER_224,
-	       0);
+	       0, false);
 }
 
 static void dg1_ctx_workarounds_init(struct intel_engine_cs *engine,
@@ -840,7 +841,7 @@ hsw_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
 	wa_add(wal,
 	       HSW_ROW_CHICKEN3, 0,
 	       _MASKED_BIT_ENABLE(HSW_ROW_CHICKEN3_L3_GLOBAL_ATOMICS_DISABLE),
-		0 /* XXX does this reg exist? */);
+	       0 /* XXX does this reg exist? */, true);
 
 	/* WaVSRefCountFullforceMissDisable:hsw */
 	wa_write_clr(wal, GEN7_FF_THREAD_MODE, GEN7_FF_VS_REF_CNT_FFME);
@@ -1929,10 +1930,10 @@ rcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal)
 		 * disable bit, which we don't touch here, but it's good
 		 * to keep in mind (see 3DSTATE_PS and 3DSTATE_WM).
 		 */
-		wa_add(wal, GEN7_GT_MODE, 0,
-		       _MASKED_FIELD(GEN6_WIZ_HASHING_MASK,
-				     GEN6_WIZ_HASHING_16x4),
-		       GEN6_WIZ_HASHING_16x4);
+		wa_masked_field_set(wal,
+				    GEN7_GT_MODE,
+				    GEN6_WIZ_HASHING_MASK,
+				    GEN6_WIZ_HASHING_16x4);
 	}
 
 	if (IS_GRAPHICS_VER(i915, 6, 7))
@@ -1982,10 +1983,10 @@ rcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal)
 		 * disable bit, which we don't touch here, but it's good
 		 * to keep in mind (see 3DSTATE_PS and 3DSTATE_WM).
 		 */
-		wa_add(wal,
-		       GEN6_GT_MODE, 0,
-		       _MASKED_FIELD(GEN6_WIZ_HASHING_MASK, GEN6_WIZ_HASHING_16x4),
-		       GEN6_WIZ_HASHING_16x4);
+		wa_masked_field_set(wal,
+				    GEN7_GT_MODE,
+				    GEN6_WIZ_HASHING_MASK,
+				    GEN6_WIZ_HASHING_16x4);
 
 		/* WaDisable_RenderCache_OperationalFlush:snb */
 		wa_masked_dis(wal, CACHE_MODE_0, RC_OP_FLUSH_ENABLE);
@@ -2006,7 +2007,7 @@ rcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal)
 		wa_add(wal, MI_MODE,
 		       0, _MASKED_BIT_ENABLE(VS_TIMER_DISPATCH),
 		       /* XXX bit doesn't stick on Broadwater */
-		       IS_I965G(i915) ? 0 : VS_TIMER_DISPATCH);
+		       IS_I965G(i915) ? 0 : VS_TIMER_DISPATCH, true);
 
 	if (GRAPHICS_VER(i915) == 4)
 		/*
@@ -2021,7 +2022,8 @@ rcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal)
 		 */
 		wa_add(wal, ECOSKPD,
 		       0, _MASKED_BIT_ENABLE(ECO_CONSTANT_BUFFER_SR_DISABLE),
-		       0 /* XXX bit doesn't stick on Broadwater */);
+		       0 /* XXX bit doesn't stick on Broadwater */,
+		       true);
 }
 
 static void
drivers/gpu/drm/i915/gt/intel_workarounds_types.h +1 -0
index c214111ea367..1e873681795d 100644
@@ -15,6 +15,7 @@ struct i915_wa {
 	u32		clr;
 	u32		set;
 	u32		read;
+	bool		masked_reg;
 };
 
 struct i915_wa_list {
drivers/gpu/drm/i915/gt/uc/intel_guc.h +1 -0
index 99742625e6ff..ab1a85b508db 100644
@@ -58,6 +58,7 @@ struct intel_guc {
 
 	struct i915_vma *ads_vma;
 	struct __guc_ads_blob *ads_blob;
+	u32 ads_regset_size;
 
 	struct i915_vma *lrc_desc_pool;
 	void *lrc_desc_pool_vaddr;
drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +195 -4

250 lines not on this page · raw message

drivers/gpu/drm/i915/i915_reg.h +1 -0
index a9c2242d61a2..f1217b5c2ff3 100644
@@ -12289,6 +12289,7 @@ enum skl_power_gate {
 
 /* MOCS (Memory Object Control State) registers */
 #define GEN9_LNCFCMOCS(i)	_MMIO(0xb020 + (i) * 4)	/* L3 Cache Control */
+#define GEN9_LNCFCMOCS_REG_COUNT	32
 
 #define __GEN9_RCS0_MOCS0	0xc800
 #define GEN9_GFX_MOCS(i)	_MMIO(__GEN9_RCS0_MOCS0 + (i) * 4)
Signature · 1 line
2.28.0
#120 lore raw

PATCH 39/47 drm/i915/guc: Don't complain about reset races

In reply to Matthew Brost

From: John Harrison <[email protected]>

It is impossible to seal all race conditions of resets occurring concurrent to other operations. At least, not without introducing excesive mutex locking. Instead, don't complain if it occurs. In particular, don't complain if trying to send a H2G during a reset. Whatever the H2G was about should get redone once the reset is over.

---
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 5 ++++-
 drivers/gpu/drm/i915/gt/uc/intel_uc.c     | 3 +++
 drivers/gpu/drm/i915/gt/uc/intel_uc.h     | 2 ++
 3 files changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c +4 -1
index dd6177c8d75c..3b32755f892e 100644
@@ -727,7 +727,10 @@ int intel_guc_ct_send(struct intel_guc_ct *ct, const u32 *action, u32 len,
 	int ret;
 
 	if (unlikely(!ct->enabled)) {
-		WARN(1, "Unexpected send: action=%#x\n", *action);
+		struct intel_guc *guc = ct_to_guc(ct);
+		struct intel_uc *uc = container_of(guc, struct intel_uc, guc);
+
+		WARN(!uc->reset_in_progress, "Unexpected send: action=%#x\n", *action);
 		return -ENODEV;
 	}
 
drivers/gpu/drm/i915/gt/uc/intel_uc.c +3 -0
index b523a8521351..77c1fe2ed883 100644
@@ -550,6 +550,7 @@ void intel_uc_reset_prepare(struct intel_uc *uc)
 {
 	struct intel_guc *guc = &uc->guc;
 
+	uc->reset_in_progress = true;
 
 	/* Nothing to do if GuC isn't supported */
 	if (!intel_uc_supports_guc(uc))
@@ -579,6 +580,8 @@ void intel_uc_reset_finish(struct intel_uc *uc)
 {
 	struct intel_guc *guc = &uc->guc;
 
+	uc->reset_in_progress = false;
+
 	/* Firmware expected to be running when this function is called */
 	if (intel_guc_is_fw_running(guc) && intel_uc_uses_guc_submission(uc))
 		intel_guc_submission_reset_finish(guc);
drivers/gpu/drm/i915/gt/uc/intel_uc.h +2 -0
index eaa3202192ac..91315e3f1c58 100644
@@ -30,6 +30,8 @@ struct intel_uc {
 
 	/* Snapshot of GuC log from last failed load */
 	struct drm_i915_gem_object *load_err_log;
+
+	bool reset_in_progress;
 };
 
 void intel_uc_init_early(struct intel_uc *uc);
Signature · 6 lines
2.28.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author Reviewed-by on v1 39/47
#121 lore raw

Re: [Intel-gfx] [PATCH 39/47] drm/i915/guc: Don't complain about reset races

Quoted 10 lines · Matthew Brost

From: John Harrison <[email protected]>

It is impossible to seal all race conditions of resets occurring concurrent to other operations. At least, not without introducing excesive mutex locking. Instead, don't complain if it occurs. In particular, don't complain if trying to send a H2G during a reset. Whatever the H2G was about should get redone once the reset is over.

Quoted 63 lines
---
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 5 ++++-
 drivers/gpu/drm/i915/gt/uc/intel_uc.c     | 3 +++
 drivers/gpu/drm/i915/gt/uc/intel_uc.h     | 2 ++
 3 files changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c +4 -1
index dd6177c8d75c..3b32755f892e 100644
@@ -727,7 +727,10 @@ int intel_guc_ct_send(struct intel_guc_ct *ct, const u32 *action, u32 len,
 	int ret;
 
 	if (unlikely(!ct->enabled)) {
-		WARN(1, "Unexpected send: action=%#x\n", *action);
+		struct intel_guc *guc = ct_to_guc(ct);
+		struct intel_uc *uc = container_of(guc, struct intel_uc, guc);
+
+		WARN(!uc->reset_in_progress, "Unexpected send: action=%#x\n", *action);
 		return -ENODEV;
 	}
 
drivers/gpu/drm/i915/gt/uc/intel_uc.c +3 -0
index b523a8521351..77c1fe2ed883 100644
@@ -550,6 +550,7 @@ void intel_uc_reset_prepare(struct intel_uc *uc)
 {
 	struct intel_guc *guc = &uc->guc;
 
+	uc->reset_in_progress = true;
 
 	/* Nothing to do if GuC isn't supported */
 	if (!intel_uc_supports_guc(uc))
@@ -579,6 +580,8 @@ void intel_uc_reset_finish(struct intel_uc *uc)
 {
 	struct intel_guc *guc = &uc->guc;
 
+	uc->reset_in_progress = false;
+
 	/* Firmware expected to be running when this function is called */
 	if (intel_guc_is_fw_running(guc) && intel_uc_uses_guc_submission(uc))
 		intel_guc_submission_reset_finish(guc);
drivers/gpu/drm/i915/gt/uc/intel_uc.h +2 -0
index eaa3202192ac..91315e3f1c58 100644
@@ -30,6 +30,8 @@ struct intel_uc {
 
 	/* Snapshot of GuC log from last failed load */
 	struct drm_i915_gem_object *load_err_log;
+
+	bool reset_in_progress;
 };
 
 void intel_uc_init_early(struct intel_uc *uc);
Signature · 6 lines
2.28.0

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

PATCH 40/47 drm/i915/guc: Enable GuC engine reset

In reply to Matthew Brost

From: John Harrison <[email protected]>

Clear the 'disable resets' flag to allow GuC to reset hung contexts (detected via pre-emption timeout).

---
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +1 -2
index 9fd3c911f5fb..d3e86ab7508f 100644
@@ -81,8 +81,7 @@ static void guc_policies_init(struct guc_policies *policies)
 {
 	policies->dpc_promote_time = GLOBAL_POLICY_DEFAULT_DPC_PROMOTE_TIME_US;
 	policies->max_num_work_items = GLOBAL_POLICY_MAX_NUM_WI;
-	/* Disable automatic resets as not yet supported. */
-	policies->global_flags = GLOBAL_POLICY_DISABLE_ENGINE_RESET;
+	policies->global_flags = 0;
 	policies->is_valid = 1;
 }
 
Signature · 6 lines
2.28.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author Reviewed-by on v1 40/47
#123 lore raw

Re: [Intel-gfx] [PATCH 40/47] drm/i915/guc: Enable GuC engine reset

Quoted 7 lines · Matthew Brost

From: John Harrison <[email protected]>

Clear the 'disable resets' flag to allow GuC to reset hung contexts (detected via pre-emption timeout).

Quoted 25 lines
---
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +1 -2
index 9fd3c911f5fb..d3e86ab7508f 100644
@@ -81,8 +81,7 @@ static void guc_policies_init(struct guc_policies *policies)
 {
 	policies->dpc_promote_time = GLOBAL_POLICY_DEFAULT_DPC_PROMOTE_TIME_US;
 	policies->max_num_work_items = GLOBAL_POLICY_MAX_NUM_WI;
-	/* Disable automatic resets as not yet supported. */
-	policies->global_flags = GLOBAL_POLICY_DISABLE_ENGINE_RESET;
+	policies->global_flags = 0;
 	policies->is_valid = 1;
 }
 
Signature · 6 lines
2.28.0

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

PATCH 41/47 drm/i915/guc: Capture error state on context reset

In reply to Matthew Brost

We receive notification of an engine reset from GuC at its completion. Meaning GuC has potentially cleared any HW state we may have been interested in capturing. GuC resumes scheduling on the engine post-reset, as the resets are meant to be transparent, further muddling our error state.

There is ongoing work to define an API for a GuC debug state dump. The suggestion for now is to manually disable FW initiated resets in cases where debug state is needed.

---
 drivers/gpu/drm/i915/gt/intel_context.c       | 20 +++++++++++
 drivers/gpu/drm/i915/gt/intel_context.h       |  3 ++
 drivers/gpu/drm/i915/gt/intel_engine.h        | 21 ++++++++++-
 drivers/gpu/drm/i915/gt/intel_engine_cs.c     | 11 ++++--
 drivers/gpu/drm/i915/gt/intel_engine_types.h  |  2 ++
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 35 +++++++++----------
 drivers/gpu/drm/i915/i915_gpu_error.c         | 25 ++++++++++---
 7 files changed, 91 insertions(+), 26 deletions(-)
drivers/gpu/drm/i915/gt/intel_context.c +20 -0
index 2f01437056a8..3fe7794b2bfd 100644
@@ -514,6 +514,26 @@ struct i915_request *intel_context_create_request(struct intel_context *ce)
 	return rq;
 }
 
+struct i915_request *intel_context_find_active_request(struct intel_context *ce)
+{
+	struct i915_request *rq, *active = NULL;
+	unsigned long flags;
+
+	GEM_BUG_ON(!intel_engine_uses_guc(ce->engine));
+
+	spin_lock_irqsave(&ce->guc_active.lock, flags);
+	list_for_each_entry_reverse(rq, &ce->guc_active.requests,
+				    sched.link) {
+		if (i915_request_completed(rq))
+			break;
+
+		active = rq;
+	}
+	spin_unlock_irqrestore(&ce->guc_active.lock, flags);
+
+	return active;
+}
+
 #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
 #include "selftest_context.c"
 #endif
drivers/gpu/drm/i915/gt/intel_context.h +3 -0
index a592a9605dc8..3363b59c0c40 100644
@@ -201,6 +201,9 @@ int intel_context_prepare_remote_request(struct intel_context *ce,
 
 struct i915_request *intel_context_create_request(struct intel_context *ce);
 
+struct i915_request *
+intel_context_find_active_request(struct intel_context *ce);
+
 static inline struct intel_ring *__intel_context_ring_size(u64 sz)
 {
 	return u64_to_ptr(struct intel_ring, sz);
drivers/gpu/drm/i915/gt/intel_engine.h +20 -1
index e9e0657f847a..6ea5643a3aaa 100644
@@ -245,7 +245,7 @@ ktime_t intel_engine_get_busy_time(struct intel_engine_cs *engine,
 				   ktime_t *now);
 
 struct i915_request *
-intel_engine_find_active_request(struct intel_engine_cs *engine);
+intel_engine_execlist_find_hung_request(struct intel_engine_cs *engine);
 
 u32 intel_engine_context_size(struct intel_gt *gt, u8 class);
 struct intel_context *
@@ -328,4 +328,23 @@ intel_engine_get_sibling(struct intel_engine_cs *engine, unsigned int sibling)
 	return engine->cops->get_sibling(engine, sibling);
 }
 
+static inline void
+intel_engine_set_hung_context(struct intel_engine_cs *engine,
+			      struct intel_context *ce)
+{
+	engine->hung_ce = ce;
+}
+
+static inline void
+intel_engine_clear_hung_context(struct intel_engine_cs *engine)
+{
+	intel_engine_set_hung_context(engine, NULL);
+}
+
+static inline struct intel_context *
+intel_engine_get_hung_context(struct intel_engine_cs *engine)
+{
+	return engine->hung_ce;
+}
+
 #endif /* _INTEL_RINGBUFFER_H_ */
drivers/gpu/drm/i915/gt/intel_engine_cs.c +9 -2
index 69245670b8b0..1d243b83b023 100644
@@ -1671,7 +1671,7 @@ void intel_engine_dump(struct intel_engine_cs *engine,
 	drm_printf(m, "\tRequests:\n");
 
 	spin_lock_irqsave(&engine->sched_engine->lock, flags);
-	rq = intel_engine_find_active_request(engine);
+	rq = intel_engine_execlist_find_hung_request(engine);
 	if (rq) {
 		struct intel_timeline *tl = get_timeline(rq);
 
@@ -1782,10 +1782,17 @@ static bool match_ring(struct i915_request *rq)
 }
 
 struct i915_request *
-intel_engine_find_active_request(struct intel_engine_cs *engine)
+intel_engine_execlist_find_hung_request(struct intel_engine_cs *engine)
 {
 	struct i915_request *request, *active = NULL;
 
+	/*
+	 * This search does not work in GuC submission mode. However, the GuC
+	 * will report the hanging context directly to the driver itself. So
+	 * the driver should never get here when in GuC mode.
+	 */
+	GEM_BUG_ON(intel_uc_uses_guc_submission(&engine->gt->uc));
+
 	/*
 	 * We are called by the error capture, reset and to dump engine
 	 * state at random points in time. In particular, note that neither is
drivers/gpu/drm/i915/gt/intel_engine_types.h +2 -0
index f9d264c008e8..0ceffa2be7a7 100644
@@ -303,6 +303,8 @@ struct intel_engine_cs {
 	/* keep a request in reserve for a [pm] barrier under oom */
 	struct i915_request *request_pool;
 
+	struct intel_context *hung_ce;
+
 	struct llist_head barrier_tasks;
 
 	struct intel_context *kernel_context; /* pinned */
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +16 -19
index c3223958dfe0..315edeaa186a 100644
@@ -727,24 +727,6 @@ __unwind_incomplete_requests(struct intel_context *ce)
 	spin_unlock_irqrestore(&sched_engine->lock, flags);
 }
 
-static struct i915_request *context_find_active_request(struct intel_context *ce)
-{
-	struct i915_request *rq, *active = NULL;
-	unsigned long flags;
-
-	spin_lock_irqsave(&ce->guc_active.lock, flags);
-	list_for_each_entry_reverse(rq, &ce->guc_active.requests,
-				    sched.link) {
-		if (i915_request_completed(rq))
-			break;
-
-		active = rq;
-	}
-	spin_unlock_irqrestore(&ce->guc_active.lock, flags);
-
-	return active;
-}
-
 static void __guc_reset_context(struct intel_context *ce, bool stalled)
 {
 	struct i915_request *rq;
@@ -758,7 +740,7 @@ static void __guc_reset_context(struct intel_context *ce, bool stalled)
 	 */
 	clr_context_enabled(ce);
 
-	rq = context_find_active_request(ce);
+	rq = intel_context_find_active_request(ce);
 	if (!rq) {
 		head = ce->ring->tail;
 		stalled = false;
@@ -2192,6 +2174,20 @@ int intel_guc_sched_done_process_msg(struct intel_guc *guc,
 	return 0;
 }
 
+static void capture_error_state(struct intel_guc *guc,
+				struct intel_context *ce)
+{
+	struct intel_gt *gt = guc_to_gt(guc);
+	struct drm_i915_private *i915 = gt->i915;
+	struct intel_engine_cs *engine = __context_to_physical_engine(ce);
+	intel_wakeref_t wakeref;
+
+	intel_engine_set_hung_context(engine, ce);
+	with_intel_runtime_pm(&i915->runtime_pm, wakeref)
+		i915_capture_error_state(gt, engine->mask);
+	atomic_inc(&i915->gpu_error.reset_engine_count[engine->uabi_class]);
+}
+
 static void guc_context_replay(struct intel_context *ce)
 {
 	struct i915_sched_engine *sched_engine = ce->engine->sched_engine;
@@ -2204,6 +2200,7 @@ static void guc_handle_context_reset(struct intel_guc *guc,
 				     struct intel_context *ce)
 {
 	trace_intel_context_reset(ce);
+	capture_error_state(guc, ce);
 	guc_context_replay(ce);
 }
 
drivers/gpu/drm/i915/i915_gpu_error.c +21 -4
index cb182c6d265a..20e0a1bfadc1 100644
@@ -1429,20 +1429,37 @@ capture_engine(struct intel_engine_cs *engine,
 {
 	struct intel_engine_capture_vma *capture = NULL;
 	struct intel_engine_coredump *ee;
-	struct i915_request *rq;
+	struct intel_context *ce;
+	struct i915_request *rq = NULL;
 	unsigned long flags;
 
 	ee = intel_engine_coredump_alloc(engine, GFP_KERNEL);
 	if (!ee)
 		return NULL;
 
-	spin_lock_irqsave(&engine->sched_engine->lock, flags);
-	rq = intel_engine_find_active_request(engine);
+	ce = intel_engine_get_hung_context(engine);
+	if (ce) {
+		intel_engine_clear_hung_context(engine);
+		rq = intel_context_find_active_request(ce);
+		if (!rq || !i915_request_started(rq))
+			goto no_request_capture;
+	} else {
+		/*
+		 * Getting here with GuC enabled means it is a forced error capture
+		 * with no actual hang. So, no need to attempt the execlist search.
+		 */
+		if (!intel_uc_uses_guc_submission(&engine->gt->uc)) {
+			spin_lock_irqsave(&engine->sched_engine->lock, flags);
+			rq = intel_engine_execlist_find_hung_request(engine);
+			spin_unlock_irqrestore(&engine->sched_engine->lock,
+					       flags);
+		}
+	}
 	if (rq)
 		capture = intel_engine_coredump_add_request(ee, rq,
 							    ATOMIC_MAYFAIL);
-	spin_unlock_irqrestore(&engine->sched_engine->lock, flags);
 	if (!capture) {
+no_request_capture:
 		kfree(ee);
 		return NULL;
 	}
Signature · 6 lines
2.28.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 41/47
#125 lore raw

Re: [PATCH 41/47] drm/i915/guc: Capture error state on context reset

Quoted 11 lines · Matthew Brost

We receive notification of an engine reset from GuC at its completion. Meaning GuC has potentially cleared any HW state we may have been interested in capturing. GuC resumes scheduling on the engine post-reset, as the resets are meant to be transparent, further muddling our error state.

There is ongoing work to define an API for a GuC debug state dump. The suggestion for now is to manually disable FW initiated resets in cases where debug state is needed.

Quoted 240 lines
---
  drivers/gpu/drm/i915/gt/intel_context.c       | 20 +++++++++++
  drivers/gpu/drm/i915/gt/intel_context.h       |  3 ++
  drivers/gpu/drm/i915/gt/intel_engine.h        | 21 ++++++++++-
  drivers/gpu/drm/i915/gt/intel_engine_cs.c     | 11 ++++--
  drivers/gpu/drm/i915/gt/intel_engine_types.h  |  2 ++
  .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 35 +++++++++----------
  drivers/gpu/drm/i915/i915_gpu_error.c         | 25 ++++++++++---
  7 files changed, 91 insertions(+), 26 deletions(-)
drivers/gpu/drm/i915/gt/intel_context.c +20 -0
index 2f01437056a8..3fe7794b2bfd 100644
@@ -514,6 +514,26 @@ struct i915_request *intel_context_create_request(struct intel_context *ce)
  	return rq;
  }
 
+struct i915_request *intel_context_find_active_request(struct intel_context *ce)
+{
+	struct i915_request *rq, *active = NULL;
+	unsigned long flags;
+
+	GEM_BUG_ON(!intel_engine_uses_guc(ce->engine));
+
+	spin_lock_irqsave(&ce->guc_active.lock, flags);
+	list_for_each_entry_reverse(rq, &ce->guc_active.requests,
+				    sched.link) {
+		if (i915_request_completed(rq))
+			break;
+
+		active = rq;
+	}
+	spin_unlock_irqrestore(&ce->guc_active.lock, flags);
+
+	return active;
+}
+
  #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
  #include "selftest_context.c"
  #endif
drivers/gpu/drm/i915/gt/intel_context.h +3 -0
index a592a9605dc8..3363b59c0c40 100644
@@ -201,6 +201,9 @@ int intel_context_prepare_remote_request(struct intel_context *ce,
 
  struct i915_request *intel_context_create_request(struct intel_context *ce);
 
+struct i915_request *
+intel_context_find_active_request(struct intel_context *ce);
+
  static inline struct intel_ring *__intel_context_ring_size(u64 sz)
  {
  	return u64_to_ptr(struct intel_ring, sz);
drivers/gpu/drm/i915/gt/intel_engine.h +20 -1
index e9e0657f847a..6ea5643a3aaa 100644
@@ -245,7 +245,7 @@ ktime_t intel_engine_get_busy_time(struct intel_engine_cs *engine,
  				   ktime_t *now);
 
  struct i915_request *
-intel_engine_find_active_request(struct intel_engine_cs *engine);
+intel_engine_execlist_find_hung_request(struct intel_engine_cs *engine);
 
  u32 intel_engine_context_size(struct intel_gt *gt, u8 class);
  struct intel_context *
@@ -328,4 +328,23 @@ intel_engine_get_sibling(struct intel_engine_cs *engine, unsigned int sibling)
  	return engine->cops->get_sibling(engine, sibling);
  }
 
+static inline void
+intel_engine_set_hung_context(struct intel_engine_cs *engine,
+			      struct intel_context *ce)
+{
+	engine->hung_ce = ce;
+}
+
+static inline void
+intel_engine_clear_hung_context(struct intel_engine_cs *engine)
+{
+	intel_engine_set_hung_context(engine, NULL);
+}
+
+static inline struct intel_context *
+intel_engine_get_hung_context(struct intel_engine_cs *engine)
+{
+	return engine->hung_ce;
+}
+
  #endif /* _INTEL_RINGBUFFER_H_ */
drivers/gpu/drm/i915/gt/intel_engine_cs.c +9 -2
index 69245670b8b0..1d243b83b023 100644
@@ -1671,7 +1671,7 @@ void intel_engine_dump(struct intel_engine_cs *engine,
  	drm_printf(m, "\tRequests:\n");
 
  	spin_lock_irqsave(&engine->sched_engine->lock, flags);
-	rq = intel_engine_find_active_request(engine);
+	rq = intel_engine_execlist_find_hung_request(engine);
  	if (rq) {
  		struct intel_timeline *tl = get_timeline(rq);
 
@@ -1782,10 +1782,17 @@ static bool match_ring(struct i915_request *rq)
  }
 
  struct i915_request *
-intel_engine_find_active_request(struct intel_engine_cs *engine)
+intel_engine_execlist_find_hung_request(struct intel_engine_cs *engine)
  {
  	struct i915_request *request, *active = NULL;
 
+	/*
+	 * This search does not work in GuC submission mode. However, the GuC
+	 * will report the hanging context directly to the driver itself. So
+	 * the driver should never get here when in GuC mode.
+	 */
+	GEM_BUG_ON(intel_uc_uses_guc_submission(&engine->gt->uc));
+
  	/*
  	 * We are called by the error capture, reset and to dump engine
  	 * state at random points in time. In particular, note that neither is
drivers/gpu/drm/i915/gt/intel_engine_types.h +2 -0
index f9d264c008e8..0ceffa2be7a7 100644
@@ -303,6 +303,8 @@ struct intel_engine_cs {
  	/* keep a request in reserve for a [pm] barrier under oom */
  	struct i915_request *request_pool;
 
+	struct intel_context *hung_ce;
+
  	struct llist_head barrier_tasks;
 
  	struct intel_context *kernel_context; /* pinned */
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +16 -19
index c3223958dfe0..315edeaa186a 100644
@@ -727,24 +727,6 @@ __unwind_incomplete_requests(struct intel_context *ce)
  	spin_unlock_irqrestore(&sched_engine->lock, flags);
  }
 
-static struct i915_request *context_find_active_request(struct intel_context *ce)
-{
-	struct i915_request *rq, *active = NULL;
-	unsigned long flags;
-
-	spin_lock_irqsave(&ce->guc_active.lock, flags);
-	list_for_each_entry_reverse(rq, &ce->guc_active.requests,
-				    sched.link) {
-		if (i915_request_completed(rq))
-			break;
-
-		active = rq;
-	}
-	spin_unlock_irqrestore(&ce->guc_active.lock, flags);
-
-	return active;
-}
-
  static void __guc_reset_context(struct intel_context *ce, bool stalled)
  {
  	struct i915_request *rq;
@@ -758,7 +740,7 @@ static void __guc_reset_context(struct intel_context *ce, bool stalled)
  	 */
  	clr_context_enabled(ce);
 
-	rq = context_find_active_request(ce);
+	rq = intel_context_find_active_request(ce);
  	if (!rq) {
  		head = ce->ring->tail;
  		stalled = false;
@@ -2192,6 +2174,20 @@ int intel_guc_sched_done_process_msg(struct intel_guc *guc,
  	return 0;
  }
 
+static void capture_error_state(struct intel_guc *guc,
+				struct intel_context *ce)
+{
+	struct intel_gt *gt = guc_to_gt(guc);
+	struct drm_i915_private *i915 = gt->i915;
+	struct intel_engine_cs *engine = __context_to_physical_engine(ce);
+	intel_wakeref_t wakeref;
+
+	intel_engine_set_hung_context(engine, ce);
+	with_intel_runtime_pm(&i915->runtime_pm, wakeref)
+		i915_capture_error_state(gt, engine->mask);
+	atomic_inc(&i915->gpu_error.reset_engine_count[engine->uabi_class]);
+}
+
  static void guc_context_replay(struct intel_context *ce)
  {
  	struct i915_sched_engine *sched_engine = ce->engine->sched_engine;
@@ -2204,6 +2200,7 @@ static void guc_handle_context_reset(struct intel_guc *guc,
  				     struct intel_context *ce)
  {
  	trace_intel_context_reset(ce);
+	capture_error_state(guc, ce);
  	guc_context_replay(ce);
  }
 
drivers/gpu/drm/i915/i915_gpu_error.c +19 -3
index cb182c6d265a..20e0a1bfadc1 100644
@@ -1429,20 +1429,37 @@ capture_engine(struct intel_engine_cs *engine,
  {
  	struct intel_engine_capture_vma *capture = NULL;
  	struct intel_engine_coredump *ee;
-	struct i915_request *rq;
+	struct intel_context *ce;
+	struct i915_request *rq = NULL;
  	unsigned long flags;
 
  	ee = intel_engine_coredump_alloc(engine, GFP_KERNEL);
  	if (!ee)
  		return NULL;
 
-	spin_lock_irqsave(&engine->sched_engine->lock, flags);
-	rq = intel_engine_find_active_request(engine);
+	ce = intel_engine_get_hung_context(engine);
+	if (ce) {
+		intel_engine_clear_hung_context(engine);
+		rq = intel_context_find_active_request(ce);
+		if (!rq || !i915_request_started(rq))
+			goto no_request_capture;
+	} else {
+		/*
+		 * Getting here with GuC enabled means it is a forced error capture
+		 * with no actual hang. So, no need to attempt the execlist search.
+		 */
+		if (!intel_uc_uses_guc_submission(&engine->gt->uc)) {
+			spin_lock_irqsave(&engine->sched_engine->lock, flags);
+			rq = intel_engine_execlist_find_hung_request(engine);
+			spin_unlock_irqrestore(&engine->sched_engine->lock,
+					       flags);
+		}

drivers/gpu/drm/i915/i915_gpu_error.c capture_engine(struct intel_engine_cs *engine, · line 1465

Quoted 10 lines
drivers/gpu/drm/i915/i915_gpu_error.c +2 -1
+	}
  	if (rq)
  		capture = intel_engine_coredump_add_request(ee, rq,
  							    ATOMIC_MAYFAIL);
-	spin_unlock_irqrestore(&engine->sched_engine->lock, flags);
  	if (!capture) {
+no_request_capture:
  		kfree(ee);
  		return NULL;
  	}

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

#126 lore raw

PATCH 42/47 drm/i915/guc: Fix for error capture after full GPU reset with GuC

In reply to Matthew Brost

From: John Harrison <[email protected]>

In the case of a full GPU reset (e.g. because GuC has died or because GuC's hang detection has been disabled), the driver can't rely on GuC reporting the guilty context. Instead, the driver needs to scan all active contexts and find one that is currently executing, as per the execlist mode behaviour. In GuC mode, this scan is different to execlist mode as the active request list is handled very differently.

Similarly, the request state dump in debugfs needs to be handled differently when in GuC submission mode.

Also refactured some of the request scanning code to avoid duplication across the multiple code paths that are now replicating it.

---
 drivers/gpu/drm/i915/gt/intel_engine.h        |   3 +
 drivers/gpu/drm/i915/gt/intel_engine_cs.c     | 139 ++++++++++++------
 .../gpu/drm/i915/gt/intel_engine_heartbeat.c  |   8 +
 drivers/gpu/drm/i915/gt/intel_reset.c         |   2 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc.h        |   2 +
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c |  67 +++++++++
 .../gpu/drm/i915/gt/uc/intel_guc_submission.h |   3 +
 drivers/gpu/drm/i915/i915_request.c           |  41 ++++++
 drivers/gpu/drm/i915/i915_request.h           |  11 ++
 9 files changed, 229 insertions(+), 47 deletions(-)
drivers/gpu/drm/i915/gt/intel_engine.h +3 -0
index 6ea5643a3aaa..9ba131175564 100644
@@ -240,6 +240,9 @@ __printf(3, 4)
 void intel_engine_dump(struct intel_engine_cs *engine,
 		       struct drm_printer *m,
 		       const char *header, ...);
+void intel_engine_dump_active_requests(struct list_head *requests,
+				       struct i915_request *hung_rq,
+				       struct drm_printer *m);
 
 ktime_t intel_engine_get_busy_time(struct intel_engine_cs *engine,
 				   ktime_t *now);
drivers/gpu/drm/i915/gt/intel_engine_cs.c +93 -46

165 lines not on this page · raw message

drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +8 -0
index a8495364d906..f0768824de6f 100644
@@ -90,6 +90,14 @@ reset_engine(struct intel_engine_cs *engine, struct i915_request *rq)
 	if (IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM))
 		show_heartbeat(rq, engine);
 
+	if (intel_engine_uses_guc(engine))
+		/*
+		 * GuC itself is toast or GuC's hang detection
+		 * is disabled. Either way, need to find the
+		 * hang culprit manually.
+		 */
+		intel_guc_find_hung_context(engine);
+
 	intel_gt_handle_error(engine->gt, engine->mask,
 			      I915_ERROR_CAPTURE,
 			      "stopped heartbeat on %s",
drivers/gpu/drm/i915/gt/intel_reset.c +1 -1
index 2987282dff6d..f3cdbf4ba5c8 100644
@@ -156,7 +156,7 @@ void __i915_request_reset(struct i915_request *rq, bool guilty)
 	if (guilty) {
 		i915_request_set_error_once(rq, -EIO);
 		__i915_request_skip(rq);
-		if (mark_guilty(rq))
+		if (mark_guilty(rq) && !intel_engine_uses_guc(rq->engine))
 			skip_context(rq);
 	} else {
 		i915_request_set_error_once(rq, -EAGAIN);
drivers/gpu/drm/i915/gt/uc/intel_guc.h +2 -0
index ab1a85b508db..c38365cd5fab 100644
@@ -268,6 +268,8 @@ int intel_guc_context_reset_process_msg(struct intel_guc *guc,
 int intel_guc_engine_failure_process_msg(struct intel_guc *guc,
 					 const u32 *msg, u32 len);
 
+void intel_guc_find_hung_context(struct intel_engine_cs *engine);
+
 void intel_guc_submission_reset_prepare(struct intel_guc *guc);
 void intel_guc_submission_reset(struct intel_guc *guc, bool stalled);
 void intel_guc_submission_reset_finish(struct intel_guc *guc);
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +67 -0

73 lines not on this page · raw message

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h +3 -0
index b9b9f0f60f91..a2a3fad72be1 100644
@@ -24,6 +24,9 @@ int intel_guc_submission_setup(struct intel_engine_cs *engine);
 void intel_guc_log_submission_info(struct intel_guc *guc,
 				   struct drm_printer *p);
 void intel_guc_log_context_info(struct intel_guc *guc, struct drm_printer *p);
+void intel_guc_dump_active_requests(struct intel_engine_cs *engine,
+				    struct i915_request *hung_rq,
+				    struct drm_printer *m);
 
 bool intel_guc_virtual_engine_has_heartbeat(const struct intel_engine_cs *ve);
 
drivers/gpu/drm/i915/i915_request.c +41 -0

47 lines not on this page · raw message

drivers/gpu/drm/i915/i915_request.h +11 -0
index bcc6340c505e..f98385f72782 100644
@@ -651,4 +651,15 @@ i915_request_active_engine(struct i915_request *rq,
 
 void i915_request_notify_execute_cb_imm(struct i915_request *rq);
 
+enum i915_request_state
+{
+	I915_REQUEST_UNKNOWN = 0,
+	I915_REQUEST_COMPLETE,
+	I915_REQUEST_PENDING,
+	I915_REQUEST_QUEUED,
+	I915_REQUEST_ACTIVE,
+};
+
+enum i915_request_state i915_test_request_state(struct i915_request *rq);
+
 #endif /* I915_REQUEST_H */
Signature · 6 lines
2.28.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author Reviewed-by on v1 42/47
#127 lore raw

Re: [Intel-gfx] [PATCH 42/47] drm/i915/guc: Fix for error capture after full GPU reset with GuC

Quoted 9 lines · Matthew Brost

From: John Harrison <[email protected]>

In the case of a full GPU reset (e.g. because GuC has died or because GuC's hang detection has been disabled), the driver can't rely on GuC reporting the guilty context. Instead, the driver needs to scan all active contexts and find one that is currently executing, as per the execlist mode behaviour. In GuC mode, this scan is different to execlist mode as the active request list is handled very differently.

Quoted 8 lines

Similarly, the request state dump in debugfs needs to be handled differently when in GuC submission mode.

Also refactured some of the request scanning code to avoid duplication across the multiple code paths that are now replicating it.

Quoted 415 lines
---
 drivers/gpu/drm/i915/gt/intel_engine.h        |   3 +
 drivers/gpu/drm/i915/gt/intel_engine_cs.c     | 139 ++++++++++++------
 .../gpu/drm/i915/gt/intel_engine_heartbeat.c  |   8 +
 drivers/gpu/drm/i915/gt/intel_reset.c         |   2 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc.h        |   2 +
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c |  67 +++++++++
 .../gpu/drm/i915/gt/uc/intel_guc_submission.h |   3 +
 drivers/gpu/drm/i915/i915_request.c           |  41 ++++++
 drivers/gpu/drm/i915/i915_request.h           |  11 ++
 9 files changed, 229 insertions(+), 47 deletions(-)
drivers/gpu/drm/i915/gt/intel_engine.h +3 -0
index 6ea5643a3aaa..9ba131175564 100644
@@ -240,6 +240,9 @@ __printf(3, 4)
 void intel_engine_dump(struct intel_engine_cs *engine,
 		       struct drm_printer *m,
 		       const char *header, ...);
+void intel_engine_dump_active_requests(struct list_head *requests,
+				       struct i915_request *hung_rq,
+				       struct drm_printer *m);
 
 ktime_t intel_engine_get_busy_time(struct intel_engine_cs *engine,
 				   ktime_t *now);
drivers/gpu/drm/i915/gt/intel_engine_cs.c +93 -46
index 1d243b83b023..bbea7c9a367d 100644
@@ -1624,6 +1624,97 @@ static void print_properties(struct intel_engine_cs *engine,
 			   read_ul(&engine->defaults, p->offset));
 }
 
+static void engine_dump_request(struct i915_request *rq, struct drm_printer *m, const char *msg)
+{
+	struct intel_timeline *tl = get_timeline(rq);
+
+	i915_request_show(m, rq, msg, 0);
+
+	drm_printf(m, "\t\tring->start:  0x%08x\n",
+		   i915_ggtt_offset(rq->ring->vma));
+	drm_printf(m, "\t\tring->head:   0x%08x\n",
+		   rq->ring->head);
+	drm_printf(m, "\t\tring->tail:   0x%08x\n",
+		   rq->ring->tail);
+	drm_printf(m, "\t\tring->emit:   0x%08x\n",
+		   rq->ring->emit);
+	drm_printf(m, "\t\tring->space:  0x%08x\n",
+		   rq->ring->space);
+
+	if (tl) {
+		drm_printf(m, "\t\tring->hwsp:   0x%08x\n",
+			   tl->hwsp_offset);
+		intel_timeline_put(tl);
+	}
+
+	print_request_ring(m, rq);
+
+	if (rq->context->lrc_reg_state) {
+		drm_printf(m, "Logical Ring Context:\n");
+		hexdump(m, rq->context->lrc_reg_state, PAGE_SIZE);
+	}
+}
+
+void intel_engine_dump_active_requests(struct list_head *requests,
+				       struct i915_request *hung_rq,
+				       struct drm_printer *m)
+{
+	struct i915_request *rq;
+	const char *msg;
+	enum i915_request_state state;
+
+	list_for_each_entry(rq, requests, sched.link) {
+		if (rq == hung_rq)
+			continue;
+
+		state = i915_test_request_state(rq);
+		if (state < I915_REQUEST_QUEUED)
+			continue;
+
+		if (state == I915_REQUEST_ACTIVE)
+			msg = "\t\tactive on engine";
+		else
+			msg = "\t\tactive in queue";
+
+		engine_dump_request(rq, m, msg);
+	}
+}
+
+static void engine_dump_active_requests(struct intel_engine_cs *engine, struct drm_printer *m)
+{
+	struct i915_request *hung_rq = NULL;
+	struct intel_context *ce;
+	bool guc;
+
+	/*
+	 * No need for an engine->irq_seqno_barrier() before the seqno reads.
+	 * The GPU is still running so requests are still executing and any
+	 * hardware reads will be out of date by the time they are reported.
+	 * But the intention here is just to report an instantaneous snapshot
+	 * so that's fine.
+	 */
+	lockdep_assert_held(&engine->sched_engine->lock);
+
+	drm_printf(m, "\tRequests:\n");
+
+	guc = intel_uc_uses_guc_submission(&engine->gt->uc);
+	if (guc) {
+		ce = intel_engine_get_hung_context(engine);
+		if (ce)
+			hung_rq = intel_context_find_active_request(ce);
+	} else
+		hung_rq = intel_engine_execlist_find_hung_request(engine);
+
+	if (hung_rq)
+		engine_dump_request(hung_rq, m, "\t\thung");
+
+	if (guc)
+		intel_guc_dump_active_requests(engine, hung_rq, m);
+	else
+		intel_engine_dump_active_requests(&engine->sched_engine->requests,
+						  hung_rq, m);
+}
+
 void intel_engine_dump(struct intel_engine_cs *engine,
 		       struct drm_printer *m,
 		       const char *header, ...)
@@ -1668,39 +1759,9 @@ void intel_engine_dump(struct intel_engine_cs *engine,
 		   i915_reset_count(error));
 	print_properties(engine, m);
 
-	drm_printf(m, "\tRequests:\n");
-
 	spin_lock_irqsave(&engine->sched_engine->lock, flags);
-	rq = intel_engine_execlist_find_hung_request(engine);
-	if (rq) {
-		struct intel_timeline *tl = get_timeline(rq);
-
-		i915_request_show(m, rq, "\t\tactive ", 0);
-
-		drm_printf(m, "\t\tring->start:  0x%08x\n",
-			   i915_ggtt_offset(rq->ring->vma));
-		drm_printf(m, "\t\tring->head:   0x%08x\n",
-			   rq->ring->head);
-		drm_printf(m, "\t\tring->tail:   0x%08x\n",
-			   rq->ring->tail);
-		drm_printf(m, "\t\tring->emit:   0x%08x\n",
-			   rq->ring->emit);
-		drm_printf(m, "\t\tring->space:  0x%08x\n",
-			   rq->ring->space);
-
-		if (tl) {
-			drm_printf(m, "\t\tring->hwsp:   0x%08x\n",
-				   tl->hwsp_offset);
-			intel_timeline_put(tl);
-		}
-
-		print_request_ring(m, rq);
+	engine_dump_active_requests(engine, m);
 
-		if (rq->context->lrc_reg_state) {
-			drm_printf(m, "Logical Ring Context:\n");
-			hexdump(m, rq->context->lrc_reg_state, PAGE_SIZE);
-		}
-	}
 	drm_printf(m, "\tOn hold?: %lu\n",
 		   list_count(&engine->sched_engine->hold));
 	spin_unlock_irqrestore(&engine->sched_engine->lock, flags);
@@ -1774,13 +1835,6 @@ intel_engine_create_virtual(struct intel_engine_cs **siblings,
 	return siblings[0]->cops->create_virtual(siblings, count);
 }
 
-static bool match_ring(struct i915_request *rq)
-{
-	u32 ring = ENGINE_READ(rq->engine, RING_START);
-
-	return ring == i915_ggtt_offset(rq->ring->vma);
-}
-
 struct i915_request *
 intel_engine_execlist_find_hung_request(struct intel_engine_cs *engine)
 {
@@ -1824,14 +1878,7 @@ intel_engine_execlist_find_hung_request(struct intel_engine_cs *engine)
 
 	list_for_each_entry(request, &engine->sched_engine->requests,
 			    sched.link) {
-		if (__i915_request_is_complete(request))
-			continue;
-
-		if (!__i915_request_has_started(request))
-			continue;
-
-		/* More than one preemptible request may match! */
-		if (!match_ring(request))
+		if (i915_test_request_state(request) != I915_REQUEST_ACTIVE)
 			continue;
 
 		active = request;
drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +8 -0
index a8495364d906..f0768824de6f 100644
@@ -90,6 +90,14 @@ reset_engine(struct intel_engine_cs *engine, struct i915_request *rq)
 	if (IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM))
 		show_heartbeat(rq, engine);
 
+	if (intel_engine_uses_guc(engine))
+		/*
+		 * GuC itself is toast or GuC's hang detection
+		 * is disabled. Either way, need to find the
+		 * hang culprit manually.
+		 */
+		intel_guc_find_hung_context(engine);
+
 	intel_gt_handle_error(engine->gt, engine->mask,
 			      I915_ERROR_CAPTURE,
 			      "stopped heartbeat on %s",
drivers/gpu/drm/i915/gt/intel_reset.c +1 -1
index 2987282dff6d..f3cdbf4ba5c8 100644
@@ -156,7 +156,7 @@ void __i915_request_reset(struct i915_request *rq, bool guilty)
 	if (guilty) {
 		i915_request_set_error_once(rq, -EIO);
 		__i915_request_skip(rq);
-		if (mark_guilty(rq))
+		if (mark_guilty(rq) && !intel_engine_uses_guc(rq->engine))
 			skip_context(rq);
 	} else {
 		i915_request_set_error_once(rq, -EAGAIN);
drivers/gpu/drm/i915/gt/uc/intel_guc.h +2 -0
index ab1a85b508db..c38365cd5fab 100644
@@ -268,6 +268,8 @@ int intel_guc_context_reset_process_msg(struct intel_guc *guc,
 int intel_guc_engine_failure_process_msg(struct intel_guc *guc,
 					 const u32 *msg, u32 len);
 
+void intel_guc_find_hung_context(struct intel_engine_cs *engine);
+
 void intel_guc_submission_reset_prepare(struct intel_guc *guc);
 void intel_guc_submission_reset(struct intel_guc *guc, bool stalled);
 void intel_guc_submission_reset_finish(struct intel_guc *guc);
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +67 -0
index 315edeaa186a..6188189314d5 100644
@@ -2267,6 +2267,73 @@ int intel_guc_engine_failure_process_msg(struct intel_guc *guc,
 	return 0;
 }
 
+void intel_guc_find_hung_context(struct intel_engine_cs *engine)
+{
+	struct intel_guc *guc = &engine->gt->uc.guc;
+	struct intel_context *ce;
+	struct i915_request *rq;
+	unsigned long index;
+
+	/* Reset called during driver load? GuC not yet initialised! */
+	if (unlikely(!guc_submission_initialized(guc)))
+		return;
+
+	xa_for_each(&guc->context_lookup, index, ce) {
+		if (!intel_context_is_pinned(ce))
+			continue;
+
+		if (intel_engine_is_virtual(ce->engine)) {
+			if (!(ce->engine->mask & engine->mask))
+				continue;
+		} else {
+			if (ce->engine != engine)
+				continue;
+		}
+
+		list_for_each_entry(rq, &ce->guc_active.requests, sched.link) {
+			if (i915_test_request_state(rq) != I915_REQUEST_ACTIVE)
+				continue;
+
+			intel_engine_set_hung_context(engine, ce);
+
+			/* Can only cope with one hang at a time... */
+			return;
+		}
+	}
+}
+
+void intel_guc_dump_active_requests(struct intel_engine_cs *engine,
+				    struct i915_request *hung_rq,
+				    struct drm_printer *m)
+{
+	struct intel_guc *guc = &engine->gt->uc.guc;
+	struct intel_context *ce;
+	unsigned long index;
+	unsigned long flags;
+
+	/* Reset called during driver load? GuC not yet initialised! */
+	if (unlikely(!guc_submission_initialized(guc)))
+		return;
+
+	xa_for_each(&guc->context_lookup, index, ce) {
+		if (!intel_context_is_pinned(ce))
+			continue;
+
+		if (intel_engine_is_virtual(ce->engine)) {
+			if (!(ce->engine->mask & engine->mask))
+				continue;
+		} else {
+			if (ce->engine != engine)
+				continue;
+		}
+
+		spin_lock_irqsave(&ce->guc_active.lock, flags);
+		intel_engine_dump_active_requests(&ce->guc_active.requests,
+						  hung_rq, m);
+		spin_unlock_irqrestore(&ce->guc_active.lock, flags);
+	}
+}
+
 void intel_guc_log_submission_info(struct intel_guc *guc,
 				   struct drm_printer *p)
 {
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h +3 -0
index b9b9f0f60f91..a2a3fad72be1 100644
@@ -24,6 +24,9 @@ int intel_guc_submission_setup(struct intel_engine_cs *engine);
 void intel_guc_log_submission_info(struct intel_guc *guc,
 				   struct drm_printer *p);
 void intel_guc_log_context_info(struct intel_guc *guc, struct drm_printer *p);
+void intel_guc_dump_active_requests(struct intel_engine_cs *engine,
+				    struct i915_request *hung_rq,
+				    struct drm_printer *m);
 
 bool intel_guc_virtual_engine_has_heartbeat(const struct intel_engine_cs *ve);
 
drivers/gpu/drm/i915/i915_request.c +41 -0
index 192784875a1d..2978c8d45021 100644
@@ -2076,6 +2076,47 @@ void i915_request_show(struct drm_printer *m,
 		   name);
 }
 
+static bool engine_match_ring(struct intel_engine_cs *engine, struct i915_request *rq)
+{
+	u32 ring = ENGINE_READ(engine, RING_START);
+
+	return ring == i915_ggtt_offset(rq->ring->vma);
+}
+
+static bool match_ring(struct i915_request *rq)
+{
+	struct intel_engine_cs *engine;
+	bool found;
+	int i;
+
+	if (!intel_engine_is_virtual(rq->engine))
+		return engine_match_ring(rq->engine, rq);
+
+	found = false;
+	i = 0;
+	while ((engine = intel_engine_get_sibling(rq->engine, i++))) {
+		found = engine_match_ring(engine, rq);
+		if (found)
+			break;
+	}
+
+	return found;
+}
+
+enum i915_request_state i915_test_request_state(struct i915_request *rq)
+{
+	if (i915_request_completed(rq))
+		return I915_REQUEST_COMPLETE;
+
+	if (!i915_request_started(rq))
+		return I915_REQUEST_PENDING;
+
+	if (match_ring(rq))
+		return I915_REQUEST_ACTIVE;
+
+	return I915_REQUEST_QUEUED;
+}
+
 #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
 #include "selftests/mock_request.c"
 #include "selftests/i915_request.c"
drivers/gpu/drm/i915/i915_request.h +11 -0
index bcc6340c505e..f98385f72782 100644
@@ -651,4 +651,15 @@ i915_request_active_engine(struct i915_request *rq,
 
 void i915_request_notify_execute_cb_imm(struct i915_request *rq);
 
+enum i915_request_state
+{
+	I915_REQUEST_UNKNOWN = 0,
+	I915_REQUEST_COMPLETE,
+	I915_REQUEST_PENDING,
+	I915_REQUEST_QUEUED,
+	I915_REQUEST_ACTIVE,
+};
+
+enum i915_request_state i915_test_request_state(struct i915_request *rq);
+
 #endif /* I915_REQUEST_H */
Signature · 6 lines
2.28.0

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

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

#128 lore raw

PATCH 43/47 drm/i915/guc: Hook GuC scheduling policies up

In reply to Matthew Brost

From: John Harrison <[email protected]>

Use the official driver default scheduling policies for configuring the GuC scheduler rather than a bunch of hardcoded values.

---
 drivers/gpu/drm/i915/gt/intel_engine_types.h  |  1 +
 drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  2 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c    | 44 ++++++++++++++++++-
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 11 +++--
 4 files changed, 53 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/gt/intel_engine_types.h +1 -0
index 0ceffa2be7a7..37db857bb56c 100644
@@ -455,6 +455,7 @@ struct intel_engine_cs {
 #define I915_ENGINE_IS_VIRTUAL       BIT(5)
 #define I915_ENGINE_HAS_RELATIVE_MMIO BIT(6)
 #define I915_ENGINE_REQUIRES_CMD_PARSER BIT(7)
+#define I915_ENGINE_WANT_FORCED_PREEMPTION BIT(8)
 	unsigned int flags;
 
 	/*
drivers/gpu/drm/i915/gt/uc/intel_guc.h +2 -0
index c38365cd5fab..905ecbc7dbe3 100644
@@ -270,6 +270,8 @@ int intel_guc_engine_failure_process_msg(struct intel_guc *guc,
 
 void intel_guc_find_hung_context(struct intel_engine_cs *engine);
 
+int intel_guc_global_policies_update(struct intel_guc *guc);
+
 void intel_guc_submission_reset_prepare(struct intel_guc *guc);
 void intel_guc_submission_reset(struct intel_guc *guc, bool stalled);
 void intel_guc_submission_reset_finish(struct intel_guc *guc);
drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +42 -2

63 lines not on this page · raw message

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +8 -3
index 6188189314d5..a427336ce916 100644
@@ -873,6 +873,7 @@ void intel_guc_submission_reset_finish(struct intel_guc *guc)
 	GEM_WARN_ON(atomic_read(&guc->outstanding_submission_g2h));
 	atomic_set(&guc->outstanding_submission_g2h, 0);
 
+	intel_guc_global_policies_update(guc);
 	enable_submission(guc);
 	intel_gt_unpark_heartbeats(guc_to_gt(guc));
 }
@@ -1161,8 +1162,12 @@ static void guc_context_policy_init(struct intel_engine_cs *engine,
 {
 	desc->policy_flags = 0;
 
-	desc->execution_quantum = CONTEXT_POLICY_DEFAULT_EXECUTION_QUANTUM_US;
-	desc->preemption_timeout = CONTEXT_POLICY_DEFAULT_PREEMPTION_TIME_US;
+	if (engine->flags & I915_ENGINE_WANT_FORCED_PREEMPTION)
+		desc->policy_flags |= CONTEXT_POLICY_FLAG_PREEMPT_TO_IDLE;
+
+	/* NB: For both of these, zero means disabled. */
+	desc->execution_quantum = engine->props.timeslice_duration_ms * 1000;
+	desc->preemption_timeout = engine->props.preempt_timeout_ms * 1000;
 }
 
 static int guc_lrc_desc_pin(struct intel_context *ce, bool loop)
@@ -1945,13 +1950,13 @@ static void guc_default_vfuncs(struct intel_engine_cs *engine)
 	engine->set_default_submission = guc_set_default_submission;
 
 	engine->flags |= I915_ENGINE_HAS_PREEMPTION;
+	engine->flags |= I915_ENGINE_HAS_TIMESLICES;
 
 	/*
 	 * TODO: GuC supports timeslicing and semaphores as well, but they're
 	 * handled by the firmware so some minor tweaks are required before
 	 * enabling.
 	 *
-	 * engine->flags |= I915_ENGINE_HAS_TIMESLICES;
 	 * engine->flags |= I915_ENGINE_HAS_SEMAPHORES;
 	 */
 
Signature · 6 lines
2.28.0

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

Re: [Intel-gfx] [PATCH 43/47] drm/i915/guc: Hook GuC scheduling policies up

Quoted 122 lines · Matthew Brost

From: John Harrison <[email protected]>

Use the official driver default scheduling policies for configuring the GuC scheduler rather than a bunch of hardcoded values.

---
 drivers/gpu/drm/i915/gt/intel_engine_types.h  |  1 +
 drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  2 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c    | 44 ++++++++++++++++++-
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 11 +++--
 4 files changed, 53 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/gt/intel_engine_types.h +1 -0
index 0ceffa2be7a7..37db857bb56c 100644
@@ -455,6 +455,7 @@ struct intel_engine_cs {
 #define I915_ENGINE_IS_VIRTUAL       BIT(5)
 #define I915_ENGINE_HAS_RELATIVE_MMIO BIT(6)
 #define I915_ENGINE_REQUIRES_CMD_PARSER BIT(7)
+#define I915_ENGINE_WANT_FORCED_PREEMPTION BIT(8)
 	unsigned int flags;
 
 	/*
drivers/gpu/drm/i915/gt/uc/intel_guc.h +2 -0
index c38365cd5fab..905ecbc7dbe3 100644
@@ -270,6 +270,8 @@ int intel_guc_engine_failure_process_msg(struct intel_guc *guc,
 
 void intel_guc_find_hung_context(struct intel_engine_cs *engine);
 
+int intel_guc_global_policies_update(struct intel_guc *guc);
+
 void intel_guc_submission_reset_prepare(struct intel_guc *guc);
 void intel_guc_submission_reset(struct intel_guc *guc, bool stalled);
 void intel_guc_submission_reset_finish(struct intel_guc *guc);
drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +42 -2
index d3e86ab7508f..2ad5fcd4e1b7 100644
@@ -77,14 +77,54 @@ static u32 guc_ads_blob_size(struct intel_guc *guc)
 	       guc_ads_private_data_size(guc);
 }
 
-static void guc_policies_init(struct guc_policies *policies)
+static void guc_policies_init(struct intel_guc *guc, struct guc_policies *policies)
 {
+	struct intel_gt *gt = guc_to_gt(guc);
+	struct drm_i915_private *i915 = gt->i915;
+
 	policies->dpc_promote_time = GLOBAL_POLICY_DEFAULT_DPC_PROMOTE_TIME_US;
 	policies->max_num_work_items = GLOBAL_POLICY_MAX_NUM_WI;
+
 	policies->global_flags = 0;
+	if (i915->params.reset < 2)
+		policies->global_flags |= GLOBAL_POLICY_DISABLE_ENGINE_RESET;
+
 	policies->is_valid = 1;
 }
 
+static int guc_action_policies_update(struct intel_guc *guc, u32 policy_offset)
+{
+	u32 action[] = {
+		INTEL_GUC_ACTION_GLOBAL_SCHED_POLICY_CHANGE,
+		policy_offset
+	};
+
+	return intel_guc_send(guc, action, ARRAY_SIZE(action));
+}
+
+int intel_guc_global_policies_update(struct intel_guc *guc)
+{
+	struct __guc_ads_blob *blob = guc->ads_blob;
+	struct intel_gt *gt = guc_to_gt(guc);
+	intel_wakeref_t wakeref;
+	int ret;
+
+	if (!blob)
+		return -ENOTSUPP;
+
+	GEM_BUG_ON(!blob->ads.scheduler_policies);
+
+	guc_policies_init(guc, &blob->policies);
+
+	if (!intel_guc_is_ready(guc))
+		return 0;
+
+	with_intel_runtime_pm(&gt->i915->runtime_pm, wakeref)
+		ret = guc_action_policies_update(guc, blob->ads.scheduler_policies);
+
+	return ret;
+}
+
 static void guc_mapping_table_init(struct intel_gt *gt,
 				   struct guc_gt_system_info *system_info)
 {
@@ -281,7 +321,7 @@ static void __guc_ads_init(struct intel_guc *guc)
 	u8 engine_class, guc_class;
 
 	/* GuC scheduling policies */
-	guc_policies_init(&blob->policies);
+	guc_policies_init(guc, &blob->policies);
 
 	/*
 	 * GuC expects a per-engine-class context image and size
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +1 -0
index 6188189314d5..a427336ce916 100644
@@ -873,6 +873,7 @@ void intel_guc_submission_reset_finish(struct intel_guc *guc)
 	GEM_WARN_ON(atomic_read(&guc->outstanding_submission_g2h));
 	atomic_set(&guc->outstanding_submission_g2h, 0);
 
+	intel_guc_global_policies_update(guc);
 	enable_submission(guc);
 	intel_gt_unpark_heartbeats(guc_to_gt(guc));
 }

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c static void guc_context_policy_init(struct intel_engine_cs *engine, · line 1165

Quoted 6 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +1 -2
@@ -1161,8 +1162,12 @@ static void guc_context_policy_init(struct intel_engine_cs *engine,
 {
 	desc->policy_flags = 0;
 
-	desc->execution_quantum = CONTEXT_POLICY_DEFAULT_EXECUTION_QUANTUM_US;
-	desc->preemption_timeout = CONTEXT_POLICY_DEFAULT_PREEMPTION_TIME_US;
+	if (engine->flags & I915_ENGINE_WANT_FORCED_PREEMPTION)

I can't see where we set this in this series, although I do see a selftest we need to fixup that sets this. Perhaps we drop this until we fix that selftest? Or at minimum add a comment saying it will be used in the future by selftests. What do you think John?

Quoted 9 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +5 -0
+		desc->policy_flags |= CONTEXT_POLICY_FLAG_PREEMPT_TO_IDLE;
+
+	/* NB: For both of these, zero means disabled. */
+	desc->execution_quantum = engine->props.timeslice_duration_ms * 1000;
+	desc->preemption_timeout = engine->props.preempt_timeout_ms * 1000;
 }
 
 static int guc_lrc_desc_pin(struct intel_context *ce, bool loop)

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c static void guc_default_vfuncs(struct intel_engine_cs *engine) · line 1956

Quoted 7 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +1 -0
@@ -1945,13 +1950,13 @@ static void guc_default_vfuncs(struct intel_engine_cs *engine)
 	engine->set_default_submission = guc_set_default_submission;
 
 	engine->flags |= I915_ENGINE_HAS_PREEMPTION;
+	engine->flags |= I915_ENGINE_HAS_TIMESLICES;
 
 	/*
 	 * TODO: GuC supports timeslicing and semaphores as well, but they're

Nit, we now support timeslicing. I can fix that up in next rev.

Matt

Quoted 14 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +0 -1
 	 * handled by the firmware so some minor tweaks are required before
 	 * enabling.
 	 *
-	 * engine->flags |= I915_ENGINE_HAS_TIMESLICES;
 	 * engine->flags |= I915_ENGINE_HAS_SEMAPHORES;
 	 */
 
Signature · 6 lines
2.28.0

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

Re: [Intel-gfx] [PATCH 43/47] drm/i915/guc: Hook GuC scheduling policies up

Quoted 126 lines · Matthew Brost
Quoted 125 lines · Matthew Brost

From: John Harrison <[email protected]>

Use the official driver default scheduling policies for configuring the GuC scheduler rather than a bunch of hardcoded values.

---
  drivers/gpu/drm/i915/gt/intel_engine_types.h  |  1 +
  drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  2 +
  drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c    | 44 ++++++++++++++++++-
  .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 11 +++--
  4 files changed, 53 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/gt/intel_engine_types.h +1 -0
index 0ceffa2be7a7..37db857bb56c 100644
@@ -455,6 +455,7 @@ struct intel_engine_cs {
  #define I915_ENGINE_IS_VIRTUAL       BIT(5)
  #define I915_ENGINE_HAS_RELATIVE_MMIO BIT(6)
  #define I915_ENGINE_REQUIRES_CMD_PARSER BIT(7)
+#define I915_ENGINE_WANT_FORCED_PREEMPTION BIT(8)
  	unsigned int flags;
 
  	/*
drivers/gpu/drm/i915/gt/uc/intel_guc.h +2 -0
index c38365cd5fab..905ecbc7dbe3 100644
@@ -270,6 +270,8 @@ int intel_guc_engine_failure_process_msg(struct intel_guc *guc,
 
  void intel_guc_find_hung_context(struct intel_engine_cs *engine);
 
+int intel_guc_global_policies_update(struct intel_guc *guc);
+
  void intel_guc_submission_reset_prepare(struct intel_guc *guc);
  void intel_guc_submission_reset(struct intel_guc *guc, bool stalled);
  void intel_guc_submission_reset_finish(struct intel_guc *guc);
drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +42 -2
index d3e86ab7508f..2ad5fcd4e1b7 100644
@@ -77,14 +77,54 @@ static u32 guc_ads_blob_size(struct intel_guc *guc)
  	       guc_ads_private_data_size(guc);
  }
 
-static void guc_policies_init(struct guc_policies *policies)
+static void guc_policies_init(struct intel_guc *guc, struct guc_policies *policies)
  {
+	struct intel_gt *gt = guc_to_gt(guc);
+	struct drm_i915_private *i915 = gt->i915;
+
  	policies->dpc_promote_time = GLOBAL_POLICY_DEFAULT_DPC_PROMOTE_TIME_US;
  	policies->max_num_work_items = GLOBAL_POLICY_MAX_NUM_WI;
+
  	policies->global_flags = 0;
+	if (i915->params.reset < 2)
+		policies->global_flags |= GLOBAL_POLICY_DISABLE_ENGINE_RESET;
+
  	policies->is_valid = 1;
  }
 
+static int guc_action_policies_update(struct intel_guc *guc, u32 policy_offset)
+{
+	u32 action[] = {
+		INTEL_GUC_ACTION_GLOBAL_SCHED_POLICY_CHANGE,
+		policy_offset
+	};
+
+	return intel_guc_send(guc, action, ARRAY_SIZE(action));
+}
+
+int intel_guc_global_policies_update(struct intel_guc *guc)
+{
+	struct __guc_ads_blob *blob = guc->ads_blob;
+	struct intel_gt *gt = guc_to_gt(guc);
+	intel_wakeref_t wakeref;
+	int ret;
+
+	if (!blob)
+		return -ENOTSUPP;
+
+	GEM_BUG_ON(!blob->ads.scheduler_policies);
+
+	guc_policies_init(guc, &blob->policies);
+
+	if (!intel_guc_is_ready(guc))
+		return 0;
+
+	with_intel_runtime_pm(&gt->i915->runtime_pm, wakeref)
+		ret = guc_action_policies_update(guc, blob->ads.scheduler_policies);
+
+	return ret;
+}
+
  static void guc_mapping_table_init(struct intel_gt *gt,
  				   struct guc_gt_system_info *system_info)
  {
@@ -281,7 +321,7 @@ static void __guc_ads_init(struct intel_guc *guc)
  	u8 engine_class, guc_class;
 
  	/* GuC scheduling policies */
-	guc_policies_init(&blob->policies);
+	guc_policies_init(guc, &blob->policies);
 
  	/*
  	 * GuC expects a per-engine-class context image and size
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +1 -0
index 6188189314d5..a427336ce916 100644
@@ -873,6 +873,7 @@ void intel_guc_submission_reset_finish(struct intel_guc *guc)
  	GEM_WARN_ON(atomic_read(&guc->outstanding_submission_g2h));
  	atomic_set(&guc->outstanding_submission_g2h, 0);
 
+	intel_guc_global_policies_update(guc);
  	enable_submission(guc);
  	intel_gt_unpark_heartbeats(guc_to_gt(guc));
  }
@@ -1161,8 +1162,12 @@ static void guc_context_policy_init(struct intel_engine_cs *engine,
  {
  	desc->policy_flags = 0;
 
Quoted 7 lines

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c static void guc_context_policy_init(struct intel_engine_cs *engine, · line 1165

Quoted 3 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +1 -2
-	desc->execution_quantum = CONTEXT_POLICY_DEFAULT_EXECUTION_QUANTUM_US;
-	desc->preemption_timeout = CONTEXT_POLICY_DEFAULT_PREEMPTION_TIME_US;
+	if (engine->flags & I915_ENGINE_WANT_FORCED_PREEMPTION)

I can't see where we set this in this series, although I do see a selftest we need to fixup that sets this. Perhaps we drop this until we fix that selftest? Or at minimum add a comment saying it will be used in the future by selftests. What do you think John?

Yeah, it is only ever intended to be used by selftests. So yes, it could be punted down the road until the selftest patch. Likewise the definition for the flag, too.

John.

Quoted 38 lines
Quoted 9 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +5 -0
+		desc->policy_flags |= CONTEXT_POLICY_FLAG_PREEMPT_TO_IDLE;
+
+	/* NB: For both of these, zero means disabled. */
+	desc->execution_quantum = engine->props.timeslice_duration_ms * 1000;
+	desc->preemption_timeout = engine->props.preempt_timeout_ms * 1000;
  }
 
  static int guc_lrc_desc_pin(struct intel_context *ce, bool loop)

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c static void guc_default_vfuncs(struct intel_engine_cs *engine) · line 1956

Quoted 7 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +1 -0
@@ -1945,13 +1950,13 @@ static void guc_default_vfuncs(struct intel_engine_cs *engine)
  	engine->set_default_submission = guc_set_default_submission;
 
  	engine->flags |= I915_ENGINE_HAS_PREEMPTION;
+	engine->flags |= I915_ENGINE_HAS_TIMESLICES;
 
  	/*
  	 * TODO: GuC supports timeslicing and semaphores as well, but they're

Nit, we now support timeslicing. I can fix that up in next rev.

Matt

Quoted 14 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +0 -1
  	 * handled by the firmware so some minor tweaks are required before
  	 * enabling.
  	 *
-	 * engine->flags |= I915_ENGINE_HAS_TIMESLICES;
  	 * engine->flags |= I915_ENGINE_HAS_SEMAPHORES;
  	 */
 
Signature · 6 lines
2.28.0

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

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

author Reviewed-by
#131 lore raw

Re: [Intel-gfx] [PATCH 43/47] drm/i915/guc: Hook GuC scheduling policies up

Quoted 125 lines · John Harrison
Quoted 116 lines · Matthew Brost
Quoted 115 lines · Matthew Brost

From: John Harrison <[email protected]>

Use the official driver default scheduling policies for configuring the GuC scheduler rather than a bunch of hardcoded values.

---
  drivers/gpu/drm/i915/gt/intel_engine_types.h  |  1 +
  drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  2 +
  drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c    | 44 ++++++++++++++++++-
  .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 11 +++--
  4 files changed, 53 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/gt/intel_engine_types.h +1 -0
index 0ceffa2be7a7..37db857bb56c 100644
@@ -455,6 +455,7 @@ struct intel_engine_cs {
  #define I915_ENGINE_IS_VIRTUAL       BIT(5)
  #define I915_ENGINE_HAS_RELATIVE_MMIO BIT(6)
  #define I915_ENGINE_REQUIRES_CMD_PARSER BIT(7)
+#define I915_ENGINE_WANT_FORCED_PREEMPTION BIT(8)
  	unsigned int flags;
  	/*
drivers/gpu/drm/i915/gt/uc/intel_guc.h +2 -0
index c38365cd5fab..905ecbc7dbe3 100644
@@ -270,6 +270,8 @@ int intel_guc_engine_failure_process_msg(struct intel_guc *guc,
  void intel_guc_find_hung_context(struct intel_engine_cs *engine);
+int intel_guc_global_policies_update(struct intel_guc *guc);
+
  void intel_guc_submission_reset_prepare(struct intel_guc *guc);
  void intel_guc_submission_reset(struct intel_guc *guc, bool stalled);
  void intel_guc_submission_reset_finish(struct intel_guc *guc);
drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +42 -2
index d3e86ab7508f..2ad5fcd4e1b7 100644
@@ -77,14 +77,54 @@ static u32 guc_ads_blob_size(struct intel_guc *guc)
  	       guc_ads_private_data_size(guc);
  }
-static void guc_policies_init(struct guc_policies *policies)
+static void guc_policies_init(struct intel_guc *guc, struct guc_policies *policies)
  {
+	struct intel_gt *gt = guc_to_gt(guc);
+	struct drm_i915_private *i915 = gt->i915;
+
  	policies->dpc_promote_time = GLOBAL_POLICY_DEFAULT_DPC_PROMOTE_TIME_US;
  	policies->max_num_work_items = GLOBAL_POLICY_MAX_NUM_WI;
+
  	policies->global_flags = 0;
+	if (i915->params.reset < 2)
+		policies->global_flags |= GLOBAL_POLICY_DISABLE_ENGINE_RESET;
+
  	policies->is_valid = 1;
  }
+static int guc_action_policies_update(struct intel_guc *guc, u32 policy_offset)
+{
+	u32 action[] = {
+		INTEL_GUC_ACTION_GLOBAL_SCHED_POLICY_CHANGE,
+		policy_offset
+	};
+
+	return intel_guc_send(guc, action, ARRAY_SIZE(action));
+}
+
+int intel_guc_global_policies_update(struct intel_guc *guc)
+{
+	struct __guc_ads_blob *blob = guc->ads_blob;
+	struct intel_gt *gt = guc_to_gt(guc);
+	intel_wakeref_t wakeref;
+	int ret;
+
+	if (!blob)
+		return -ENOTSUPP;
+
+	GEM_BUG_ON(!blob->ads.scheduler_policies);
+
+	guc_policies_init(guc, &blob->policies);
+
+	if (!intel_guc_is_ready(guc))
+		return 0;
+
+	with_intel_runtime_pm(&gt->i915->runtime_pm, wakeref)
+		ret = guc_action_policies_update(guc, blob->ads.scheduler_policies);
+
+	return ret;
+}
+
  static void guc_mapping_table_init(struct intel_gt *gt,
  				   struct guc_gt_system_info *system_info)
  {
@@ -281,7 +321,7 @@ static void __guc_ads_init(struct intel_guc *guc)
  	u8 engine_class, guc_class;
  	/* GuC scheduling policies */
-	guc_policies_init(&blob->policies);
+	guc_policies_init(guc, &blob->policies);
  	/*
  	 * GuC expects a per-engine-class context image and size
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +1 -0
index 6188189314d5..a427336ce916 100644
@@ -873,6 +873,7 @@ void intel_guc_submission_reset_finish(struct intel_guc *guc)
  	GEM_WARN_ON(atomic_read(&guc->outstanding_submission_g2h));
  	atomic_set(&guc->outstanding_submission_g2h, 0);
+	intel_guc_global_policies_update(guc);
  	enable_submission(guc);
  	intel_gt_unpark_heartbeats(guc_to_gt(guc));
  }
@@ -1161,8 +1162,12 @@ static void guc_context_policy_init(struct intel_engine_cs *engine,
  {
Quoted 8 lines

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c static void guc_context_policy_init(struct intel_engine_cs *engine, · line 1165

Quoted 4 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +1 -2
  	desc->policy_flags = 0;
-	desc->execution_quantum = CONTEXT_POLICY_DEFAULT_EXECUTION_QUANTUM_US;
-	desc->preemption_timeout = CONTEXT_POLICY_DEFAULT_PREEMPTION_TIME_US;
+	if (engine->flags & I915_ENGINE_WANT_FORCED_PREEMPTION)

I can't see where we set this in this series, although I do see a selftest we need to fixup that sets this. Perhaps we drop this until we fix that selftest? Or at minimum add a comment saying it will be used in the future by selftests. What do you think John?

Quoted 4 lines

Yeah, it is only ever intended to be used by selftests. So yes, it could be punted down the road until the selftest patch. Likewise the definition for the flag, too.

Ok, fixed that in my branch. With that:

Quoted 37 lines

John.

Quoted 34 lines

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c static void guc_default_vfuncs(struct intel_engine_cs *engine) · line 1954

Quoted 13 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +6 -0
+		desc->policy_flags |= CONTEXT_POLICY_FLAG_PREEMPT_TO_IDLE;
+
+	/* NB: For both of these, zero means disabled. */
+	desc->execution_quantum = engine->props.timeslice_duration_ms * 1000;
+	desc->preemption_timeout = engine->props.preempt_timeout_ms * 1000;
  }
  static int guc_lrc_desc_pin(struct intel_context *ce, bool loop)
@@ -1945,13 +1950,13 @@ static void guc_default_vfuncs(struct intel_engine_cs *engine)
  	engine->set_default_submission = guc_set_default_submission;
  	engine->flags |= I915_ENGINE_HAS_PREEMPTION;
+	engine->flags |= I915_ENGINE_HAS_TIMESLICES;
  	/*
  	 * TODO: GuC supports timeslicing and semaphores as well, but they're

Nit, we now support timeslicing. I can fix that up in next rev.

Matt

Quoted 13 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +0 -1
  	 * handled by the firmware so some minor tweaks are required before
  	 * enabling.
  	 *
-	 * engine->flags |= I915_ENGINE_HAS_TIMESLICES;
  	 * engine->flags |= I915_ENGINE_HAS_SEMAPHORES;
  	 */
Signature · 6 lines
2.28.0

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

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

#132 lore raw

PATCH 44/47 drm/i915/guc: Connect reset modparam updates to GuC policy flags

In reply to Matthew Brost

From: John Harrison <[email protected]>

Changing the reset module parameter has no effect on a running GuC. The corresponding entry in the ADS must be updated and then the GuC informed via a Host2GuC message.

The new debugfs interface to module parameters allows this to happen. However, connecting the parameter data address back to anything useful is messy. One option would be to pass a new private data structure address through instead of just the parameter pointer. However, that means having a new (and different) data structure for each parameter and a new (and different) write function for each parameter. This method keeps everything generic by instead using a string lookup on the directory entry name.

---
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c |  2 +-
 drivers/gpu/drm/i915/i915_debugfs_params.c | 31 ++++++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +1 -1
index 2ad5fcd4e1b7..c6d0b762d82c 100644
@@ -99,7 +99,7 @@ static int guc_action_policies_update(struct intel_guc *guc, u32 policy_offset)
 		policy_offset
 	};
 
-	return intel_guc_send(guc, action, ARRAY_SIZE(action));
+	return intel_guc_send_busy_loop(guc, action, ARRAY_SIZE(action), 0, true);
 }
 
 int intel_guc_global_policies_update(struct intel_guc *guc)
drivers/gpu/drm/i915/i915_debugfs_params.c +31 -0
index 4e2b077692cb..8ecd8b42f048 100644
@@ -6,9 +6,20 @@
 #include <linux/kernel.h>
 
 #include "i915_debugfs_params.h"
+#include "gt/intel_gt.h"
+#include "gt/uc/intel_guc.h"
 #include "i915_drv.h"
 #include "i915_params.h"
 
+#define MATCH_DEBUGFS_NODE_NAME(_file, _name)	(strcmp((_file)->f_path.dentry->d_name.name, (_name)) == 0)
+
+#define GET_I915(i915, name, ptr)	\
+	do {	\
+		struct i915_params *params;	\
+		params = container_of(((void *) (ptr)), typeof(*params), name);	\
+		(i915) = container_of(params, typeof(*(i915)), params);	\
+	} while(0)
+
 /* int param */
 static int i915_param_int_show(struct seq_file *m, void *data)
 {
@@ -24,6 +35,16 @@ static int i915_param_int_open(struct inode *inode, struct file *file)
 	return single_open(file, i915_param_int_show, inode->i_private);
 }
 
+static int notify_guc(struct drm_i915_private *i915)
+{
+	int ret = 0;
+
+	if (intel_uc_uses_guc_submission(&i915->gt.uc))
+		ret = intel_guc_global_policies_update(&i915->gt.uc.guc);
+
+	return ret;
+}
+
 static ssize_t i915_param_int_write(struct file *file,
 				    const char __user *ubuf, size_t len,
 				    loff_t *offp)
@@ -81,8 +102,10 @@ static ssize_t i915_param_uint_write(struct file *file,
 				     const char __user *ubuf, size_t len,
 				     loff_t *offp)
 {
+	struct drm_i915_private *i915;
 	struct seq_file *m = file->private_data;
 	unsigned int *value = m->private;
+	unsigned int old = *value;
 	int ret;
 
 	ret = kstrtouint_from_user(ubuf, len, 0, value);
@@ -95,6 +118,14 @@ static ssize_t i915_param_uint_write(struct file *file,
 			*value = b;
 	}
 
+	if (!ret && MATCH_DEBUGFS_NODE_NAME(file, "reset")) {
+		GET_I915(i915, reset, value);
+
+		ret = notify_guc(i915);
+		if (ret)
+			*value = old;
+	}
+
 	return ret ?: len;
 }
 
Signature · 6 lines
2.28.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author Reviewed-by on v1 44/47
#133 lore raw

Re: [Intel-gfx] [PATCH 44/47] drm/i915/guc: Connect reset modparam updates to GuC policy flags

Quoted 89 lines · Matthew Brost

From: John Harrison <[email protected]>

Changing the reset module parameter has no effect on a running GuC. The corresponding entry in the ADS must be updated and then the GuC informed via a Host2GuC message.

The new debugfs interface to module parameters allows this to happen. However, connecting the parameter data address back to anything useful is messy. One option would be to pass a new private data structure address through instead of just the parameter pointer. However, that means having a new (and different) data structure for each parameter and a new (and different) write function for each parameter. This method keeps everything generic by instead using a string lookup on the directory entry name.

---
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c |  2 +-
 drivers/gpu/drm/i915/i915_debugfs_params.c | 31 ++++++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +1 -1
index 2ad5fcd4e1b7..c6d0b762d82c 100644
@@ -99,7 +99,7 @@ static int guc_action_policies_update(struct intel_guc *guc, u32 policy_offset)
 		policy_offset
 	};
 
-	return intel_guc_send(guc, action, ARRAY_SIZE(action));
+	return intel_guc_send_busy_loop(guc, action, ARRAY_SIZE(action), 0, true);
 }
 
 int intel_guc_global_policies_update(struct intel_guc *guc)
drivers/gpu/drm/i915/i915_debugfs_params.c +23 -0
index 4e2b077692cb..8ecd8b42f048 100644
@@ -6,9 +6,20 @@
 #include <linux/kernel.h>
 
 #include "i915_debugfs_params.h"
+#include "gt/intel_gt.h"
+#include "gt/uc/intel_guc.h"
 #include "i915_drv.h"
 #include "i915_params.h"
 
+#define MATCH_DEBUGFS_NODE_NAME(_file, _name)	(strcmp((_file)->f_path.dentry->d_name.name, (_name)) == 0)
+
+#define GET_I915(i915, name, ptr)	\
+	do {	\
+		struct i915_params *params;	\
+		params = container_of(((void *) (ptr)), typeof(*params), name);	\
+		(i915) = container_of(params, typeof(*(i915)), params);	\
+	} while(0)
+
 /* int param */
 static int i915_param_int_show(struct seq_file *m, void *data)
 {
@@ -24,6 +35,16 @@ static int i915_param_int_open(struct inode *inode, struct file *file)
 	return single_open(file, i915_param_int_show, inode->i_private);
 }
 
+static int notify_guc(struct drm_i915_private *i915)
+{
+	int ret = 0;
+
+	if (intel_uc_uses_guc_submission(&i915->gt.uc))
+		ret = intel_guc_global_policies_update(&i915->gt.uc.guc);
+
+	return ret;
+}
+
 static ssize_t i915_param_int_write(struct file *file,
 				    const char __user *ubuf, size_t len,
 				    loff_t *offp)
@@ -81,8 +102,10 @@ static ssize_t i915_param_uint_write(struct file *file,
 				     const char __user *ubuf, size_t len,
 				     loff_t *offp)
 {
+	struct drm_i915_private *i915;
 	struct seq_file *m = file->private_data;
 	unsigned int *value = m->private;
+	unsigned int old = *value;
 	int ret;
 
 	ret = kstrtouint_from_user(ubuf, len, 0, value);

drivers/gpu/drm/i915/i915_debugfs_params.c static ssize_t i915_param_uint_write(struct file *file, · line 122

Quoted 5 lines
drivers/gpu/drm/i915/i915_debugfs_params.c +2 -0
@@ -95,6 +118,14 @@ static ssize_t i915_param_uint_write(struct file *file,
 			*value = b;
 	}
 
+	if (!ret && MATCH_DEBUGFS_NODE_NAME(file, "reset")) {
+		GET_I915(i915, reset, value);

We might want to make this into a macro in case we need to update more than just "reset" with the GuC going forward but that is not a blocker.

With that:

Quoted 16 lines
drivers/gpu/drm/i915/i915_debugfs_params.c +6 -0
+
+		ret = notify_guc(i915);
+		if (ret)
+			*value = old;
+	}
+
 	return ret ?: len;
 }
 
Signature · 6 lines
2.28.0

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

PATCH 45/47 drm/i915/guc: Include scheduling policies in the debugfs state dump

In reply to Matthew Brost

From: John Harrison <[email protected]>

Added the scheduling policy parameters to the 'guc_info' debugfs state dump.

---
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c     | 13 +++++++++++++
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h     |  2 ++
 drivers/gpu/drm/i915/gt/uc/intel_guc_debugfs.c |  2 ++
 3 files changed, 17 insertions(+)
drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +13 -0
index c6d0b762d82c..b8182844aa00 100644
@@ -92,6 +92,19 @@ static void guc_policies_init(struct intel_guc *guc, struct guc_policies *polici
 	policies->is_valid = 1;
 }
 
+void intel_guc_log_policy_info(struct intel_guc *guc, struct drm_printer *dp)
+{
+	struct __guc_ads_blob *blob = guc->ads_blob;
+
+	if (unlikely(!blob))
+		return;
+
+	drm_printf(dp, "Global scheduling policies:\n");
+	drm_printf(dp, "  DPC promote time   = %u\n", blob->policies.dpc_promote_time);
+	drm_printf(dp, "  Max num work items = %u\n", blob->policies.max_num_work_items);
+	drm_printf(dp, "  Flags              = %u\n", blob->policies.global_flags);
+}
+
 static int guc_action_policies_update(struct intel_guc *guc, u32 policy_offset)
 {
 	u32 action[] = {
drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h +2 -0
index b00d3ae1113a..0fdcb3583601 100644
@@ -7,9 +7,11 @@
 #define _INTEL_GUC_ADS_H_
 
 struct intel_guc;
+struct drm_printer;
 
 int intel_guc_ads_create(struct intel_guc *guc);
 void intel_guc_ads_destroy(struct intel_guc *guc);
 void intel_guc_ads_reset(struct intel_guc *guc);
+void intel_guc_log_policy_info(struct intel_guc *guc, struct drm_printer *p);
 
 #endif
drivers/gpu/drm/i915/gt/uc/intel_guc_debugfs.c +2 -0
index 62b9ce0fafaa..9a03ff56e654 100644
@@ -10,6 +10,7 @@
 #include "intel_guc_debugfs.h"
 #include "intel_guc_log_debugfs.h"
 #include "gt/uc/intel_guc_ct.h"
+#include "gt/uc/intel_guc_ads.h"
 #include "gt/uc/intel_guc_submission.h"
 
 static int guc_info_show(struct seq_file *m, void *data)
@@ -29,6 +30,7 @@ static int guc_info_show(struct seq_file *m, void *data)
 
 	intel_guc_log_ct_info(&guc->ct, &p);
 	intel_guc_log_submission_info(guc, &p);
+	intel_guc_log_policy_info(guc, &p);
 
 	return 0;
 }
Signature · 1 line
2.28.0
author Reviewed-by on v1 45/47
#135 lore raw

Re: [PATCH 45/47] drm/i915/guc: Include scheduling policies in the debugfs state dump

Quoted 7 lines · Matthew Brost

From: John Harrison <[email protected]>

Added the scheduling policy parameters to the 'guc_info' debugfs state dump.

Quoted 69 lines
---
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c     | 13 +++++++++++++
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h     |  2 ++
 drivers/gpu/drm/i915/gt/uc/intel_guc_debugfs.c |  2 ++
 3 files changed, 17 insertions(+)
drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +13 -0
index c6d0b762d82c..b8182844aa00 100644
@@ -92,6 +92,19 @@ static void guc_policies_init(struct intel_guc *guc, struct guc_policies *polici
 	policies->is_valid = 1;
 }
 
+void intel_guc_log_policy_info(struct intel_guc *guc, struct drm_printer *dp)
+{
+	struct __guc_ads_blob *blob = guc->ads_blob;
+
+	if (unlikely(!blob))
+		return;
+
+	drm_printf(dp, "Global scheduling policies:\n");
+	drm_printf(dp, "  DPC promote time   = %u\n", blob->policies.dpc_promote_time);
+	drm_printf(dp, "  Max num work items = %u\n", blob->policies.max_num_work_items);
+	drm_printf(dp, "  Flags              = %u\n", blob->policies.global_flags);
+}
+
 static int guc_action_policies_update(struct intel_guc *guc, u32 policy_offset)
 {
 	u32 action[] = {
drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h +2 -0
index b00d3ae1113a..0fdcb3583601 100644
@@ -7,9 +7,11 @@
 #define _INTEL_GUC_ADS_H_
 
 struct intel_guc;
+struct drm_printer;
 
 int intel_guc_ads_create(struct intel_guc *guc);
 void intel_guc_ads_destroy(struct intel_guc *guc);
 void intel_guc_ads_reset(struct intel_guc *guc);
+void intel_guc_log_policy_info(struct intel_guc *guc, struct drm_printer *p);
 
 #endif
drivers/gpu/drm/i915/gt/uc/intel_guc_debugfs.c +2 -0
index 62b9ce0fafaa..9a03ff56e654 100644
@@ -10,6 +10,7 @@
 #include "intel_guc_debugfs.h"
 #include "intel_guc_log_debugfs.h"
 #include "gt/uc/intel_guc_ct.h"
+#include "gt/uc/intel_guc_ads.h"
 #include "gt/uc/intel_guc_submission.h"
 
 static int guc_info_show(struct seq_file *m, void *data)
@@ -29,6 +30,7 @@ static int guc_info_show(struct seq_file *m, void *data)
 
 	intel_guc_log_ct_info(&guc->ct, &p);
 	intel_guc_log_submission_info(guc, &p);
+	intel_guc_log_policy_info(guc, &p);
 
 	return 0;
 }
Signature · 1 line
2.28.0

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

#136 lore raw

PATCH 46/47 drm/i915/guc: Add golden context to GuC ADS

In reply to Matthew Brost

From: John Harrison <[email protected]>

The media watchdog mechanism involves GuC doing a silent reset and continue of the hung context. This requires the i915 driver provide a golden context to GuC in the ADS.

---
 drivers/gpu/drm/i915/gt/intel_gt.c         |   2 +
 drivers/gpu/drm/i915/gt/uc/intel_guc.c     |   5 +
 drivers/gpu/drm/i915/gt/uc/intel_guc.h     |   2 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 213 ++++++++++++++++++---
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h |   1 +
 drivers/gpu/drm/i915/gt/uc/intel_uc.c      |   5 +
 drivers/gpu/drm/i915/gt/uc/intel_uc.h      |   1 +
 7 files changed, 199 insertions(+), 30 deletions(-)
drivers/gpu/drm/i915/gt/intel_gt.c +2 -0
index acfdd53b2678..ceeb517ba259 100644
@@ -654,6 +654,8 @@ int intel_gt_init(struct intel_gt *gt)
 	if (err)
 		goto err_gt;
 
+	intel_uc_init_late(&gt->uc);
+
 	err = i915_inject_probe_error(gt->i915, -EIO);
 	if (err)
 		goto err_gt;
drivers/gpu/drm/i915/gt/uc/intel_guc.c +5 -0
index 68266cbffd1f..979128e28372 100644
@@ -180,6 +180,11 @@ void intel_guc_init_early(struct intel_guc *guc)
 	}
 }
 
+void intel_guc_init_late(struct intel_guc *guc)
+{
+	intel_guc_ads_init_late(guc);
+}
+
 static u32 guc_ctl_debug_flags(struct intel_guc *guc)
 {
 	u32 level = intel_guc_log_get_level(&guc->log);
drivers/gpu/drm/i915/gt/uc/intel_guc.h +2 -0
index 905ecbc7dbe3..fae01dc8e1b9 100644
@@ -59,6 +59,7 @@ struct intel_guc {
 	struct i915_vma *ads_vma;
 	struct __guc_ads_blob *ads_blob;
 	u32 ads_regset_size;
+	u32 ads_golden_ctxt_size;
 
 	struct i915_vma *lrc_desc_pool;
 	void *lrc_desc_pool_vaddr;
@@ -176,6 +177,7 @@ static inline u32 intel_guc_ggtt_offset(struct intel_guc *guc,
 }
 
 void intel_guc_init_early(struct intel_guc *guc);
+void intel_guc_init_late(struct intel_guc *guc);
 void intel_guc_init_send_regs(struct intel_guc *guc);
 void intel_guc_write_params(struct intel_guc *guc);
 int intel_guc_init(struct intel_guc *guc);
drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +183 -30

284 lines not on this page · raw message

drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h +1 -0
index 0fdcb3583601..dac0dc32da34 100644
@@ -11,6 +11,7 @@ struct drm_printer;
 
 int intel_guc_ads_create(struct intel_guc *guc);
 void intel_guc_ads_destroy(struct intel_guc *guc);
+void intel_guc_ads_init_late(struct intel_guc *guc);
 void intel_guc_ads_reset(struct intel_guc *guc);
 void intel_guc_log_policy_info(struct intel_guc *guc, struct drm_printer *p);
 
drivers/gpu/drm/i915/gt/uc/intel_uc.c +5 -0
index 77c1fe2ed883..7a69c3c027e9 100644
@@ -120,6 +120,11 @@ void intel_uc_init_early(struct intel_uc *uc)
 		uc->ops = &uc_ops_off;
 }
 
+void intel_uc_init_late(struct intel_uc *uc)
+{
+	intel_guc_init_late(&uc->guc);
+}
+
 void intel_uc_driver_late_release(struct intel_uc *uc)
 {
 }
drivers/gpu/drm/i915/gt/uc/intel_uc.h +1 -0
index 91315e3f1c58..e2da2b6e76e1 100644
@@ -35,6 +35,7 @@ struct intel_uc {
 };
 
 void intel_uc_init_early(struct intel_uc *uc);
+void intel_uc_init_late(struct intel_uc *uc);
 void intel_uc_driver_late_release(struct intel_uc *uc);
 void intel_uc_driver_remove(struct intel_uc *uc);
 void intel_uc_init_mmio(struct intel_uc *uc);
Signature · 6 lines
2.28.0

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

PATCH 47/47 drm/i915/guc: Unblock GuC submission on Gen11+

In reply to Matthew Brost

From: Daniele Ceraolo Spurio <[email protected]>

Unblock GuC submission on Gen11+ platforms.

---
 drivers/gpu/drm/i915/gt/uc/intel_guc.h            |  1 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c |  8 ++++++++
 drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h |  3 +--
 drivers/gpu/drm/i915/gt/uc/intel_uc.c             | 14 +++++++++-----
 4 files changed, 19 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc.h +1 -0
index fae01dc8e1b9..77981788204f 100644
@@ -54,6 +54,7 @@ struct intel_guc {
 	struct ida guc_ids;
 	struct list_head guc_id_list;
 
+	bool submission_supported;
 	bool submission_selected;
 
 	struct i915_vma *ads_vma;
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +8 -0
index a427336ce916..405339202280 100644
@@ -2042,6 +2042,13 @@ void intel_guc_submission_disable(struct intel_guc *guc)
 	/* Note: By the time we're here, GuC may have already been reset */
 }
 
+static bool __guc_submission_supported(struct intel_guc *guc)
+{
+	/* GuC submission is unavailable for pre-Gen11 */
+	return intel_guc_is_supported(guc) &&
+	       INTEL_GEN(guc_to_gt(guc)->i915) >= 11;
+}
+
 static bool __guc_submission_selected(struct intel_guc *guc)
 {
 	struct drm_i915_private *i915 = guc_to_gt(guc)->i915;
@@ -2054,6 +2061,7 @@ static bool __guc_submission_selected(struct intel_guc *guc)
 
 void intel_guc_submission_init_early(struct intel_guc *guc)
 {
+	guc->submission_supported = __guc_submission_supported(guc);
 	guc->submission_selected = __guc_submission_selected(guc);
 }
 
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h +1 -2
index a2a3fad72be1..be767eb6ff71 100644
@@ -37,8 +37,7 @@ int intel_guc_wait_for_pending_msg(struct intel_guc *guc,
 
 static inline bool intel_guc_submission_is_supported(struct intel_guc *guc)
 {
-	/* XXX: GuC submission is unavailable for now */
-	return false;
+	return guc->submission_supported;
 }
 
 static inline bool intel_guc_submission_is_wanted(struct intel_guc *guc)
drivers/gpu/drm/i915/gt/uc/intel_uc.c +9 -5
index 7a69c3c027e9..61be0aa81492 100644
@@ -34,8 +34,15 @@ static void uc_expand_default_options(struct intel_uc *uc)
 		return;
 	}
 
-	/* Default: enable HuC authentication only */
-	i915->params.enable_guc = ENABLE_GUC_LOAD_HUC;
+	/* Intermediate platforms are HuC authentication only */
+	if (IS_DG1(i915) || IS_ALDERLAKE_S(i915)) {
+		drm_dbg(&i915->drm, "Disabling GuC only due to old platform\n");
+		i915->params.enable_guc = ENABLE_GUC_LOAD_HUC;
+		return;
+	}
+
+	/* Default: enable HuC authentication and GuC submission */
+	i915->params.enable_guc = ENABLE_GUC_LOAD_HUC | ENABLE_GUC_SUBMISSION;
 }
 
 /* Reset GuC providing us with fresh state for both GuC and HuC.
@@ -313,9 +320,6 @@ static int __uc_init(struct intel_uc *uc)
 	if (i915_inject_probe_failure(uc_to_gt(uc)->i915))
 		return -ENOMEM;
 
-	/* XXX: GuC submission is unavailable for now */
-	GEM_BUG_ON(intel_uc_uses_guc_submission(uc));
-
 	ret = intel_guc_init(guc);
 	if (ret)
 		return ret;
Signature · 6 lines
2.28.0

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

Re: [PATCH 47/47] drm/i915/guc: Unblock GuC submission on Gen11+

Quoted 71 lines · Matthew Brost

From: Daniele Ceraolo Spurio <[email protected]>

Unblock GuC submission on Gen11+ platforms.

---
  drivers/gpu/drm/i915/gt/uc/intel_guc.h            |  1 +
  drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c |  8 ++++++++
  drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h |  3 +--
  drivers/gpu/drm/i915/gt/uc/intel_uc.c             | 14 +++++++++-----
  4 files changed, 19 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc.h +1 -0
index fae01dc8e1b9..77981788204f 100644
@@ -54,6 +54,7 @@ struct intel_guc {
  	struct ida guc_ids;
  	struct list_head guc_id_list;
 
+	bool submission_supported;
  	bool submission_selected;
 
  	struct i915_vma *ads_vma;
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +8 -0
index a427336ce916..405339202280 100644
@@ -2042,6 +2042,13 @@ void intel_guc_submission_disable(struct intel_guc *guc)
  	/* Note: By the time we're here, GuC may have already been reset */
  }
 
+static bool __guc_submission_supported(struct intel_guc *guc)
+{
+	/* GuC submission is unavailable for pre-Gen11 */
+	return intel_guc_is_supported(guc) &&
+	       INTEL_GEN(guc_to_gt(guc)->i915) >= 11;
+}
+
  static bool __guc_submission_selected(struct intel_guc *guc)
  {
  	struct drm_i915_private *i915 = guc_to_gt(guc)->i915;
@@ -2054,6 +2061,7 @@ static bool __guc_submission_selected(struct intel_guc *guc)
 
  void intel_guc_submission_init_early(struct intel_guc *guc)
  {
+	guc->submission_supported = __guc_submission_supported(guc);
  	guc->submission_selected = __guc_submission_selected(guc);
  }
 
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h +1 -2
index a2a3fad72be1..be767eb6ff71 100644
@@ -37,8 +37,7 @@ int intel_guc_wait_for_pending_msg(struct intel_guc *guc,
 
  static inline bool intel_guc_submission_is_supported(struct intel_guc *guc)
  {
-	/* XXX: GuC submission is unavailable for now */
-	return false;
+	return guc->submission_supported;
  }
 
  static inline bool intel_guc_submission_is_wanted(struct intel_guc *guc)
drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -0
index 7a69c3c027e9..61be0aa81492 100644

drivers/gpu/drm/i915/gt/uc/intel_uc.c static void uc_expand_default_options(struct intel_uc *uc) · line 39

Quoted 8 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +3 -2
@@ -34,8 +34,15 @@ static void uc_expand_default_options(struct intel_uc *uc)
  		return;
  	}
 
-	/* Default: enable HuC authentication only */
-	i915->params.enable_guc = ENABLE_GUC_LOAD_HUC;
+	/* Intermediate platforms are HuC authentication only */
+	if (IS_DG1(i915) || IS_ALDERLAKE_S(i915)) {
+		drm_dbg(&i915->drm, "Disabling GuC only due to old platform\n");

This comment does not seem accurate, given that DG1 is barely out, and ADL is not out yet. How about:

"Disabling GuC on untested platforms"?

drivers/gpu/drm/i915/gt/uc/intel_uc.c static void uc_expand_default_options(struct intel_uc *uc) · line 45

Quoted 6 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +6 -0
+		i915->params.enable_guc = ENABLE_GUC_LOAD_HUC;
+		return;
+	}
+
+	/* Default: enable HuC authentication and GuC submission */
+	i915->params.enable_guc = ENABLE_GUC_LOAD_HUC | ENABLE_GUC_SUBMISSION;

This seems to be in contradiction with the GuC submission plan which states:

"Not enabled by default on any current platforms but can be enabled via modparam enable_guc".

When you rework the patch, could you please add a warning when the user force-enables the GuC Command Submission? Something like:

"WARNING: The user force-enabled the experimental GuC command submission backend using i915.enable_guc. Please disable it if experiencing stability issues. No bug reports will be accepted on this backend".

This should allow you to work on the backend, while communicating clearly to users that it is not ready just yet. Once it has matured, the warning can be removed.

Cheers,
Martin

Quoted 5 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -0
  }
 
  /* Reset GuC providing us with fresh state for both GuC and HuC.

drivers/gpu/drm/i915/gt/uc/intel_uc.c static int __uc_init(struct intel_uc *uc) · line 325

Quoted 9 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -3
@@ -313,9 +320,6 @@ static int __uc_init(struct intel_uc *uc)
  	if (i915_inject_probe_failure(uc_to_gt(uc)->i915))
  		return -ENOMEM;
 
-	/* XXX: GuC submission is unavailable for now */
-	GEM_BUG_ON(intel_uc_uses_guc_submission(uc));
-
  	ret = intel_guc_init(guc);
  	if (ret)
  		return ret;

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

#139 lore raw

Re: [PATCH 47/47] drm/i915/guc: Unblock GuC submission on Gen11+

Quoted 78 lines · Martin Peres
Quoted 64 lines · Matthew Brost

From: Daniele Ceraolo Spurio <[email protected]>

Unblock GuC submission on Gen11+ platforms.

---
  drivers/gpu/drm/i915/gt/uc/intel_guc.h            |  1 +
  drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c |  8 ++++++++
  drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h |  3 +--
  drivers/gpu/drm/i915/gt/uc/intel_uc.c             | 14 +++++++++-----
  4 files changed, 19 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc.h +1 -0
index fae01dc8e1b9..77981788204f 100644
@@ -54,6 +54,7 @@ struct intel_guc {
  	struct ida guc_ids;
  	struct list_head guc_id_list;
+	bool submission_supported;
  	bool submission_selected;
  	struct i915_vma *ads_vma;
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +8 -0
index a427336ce916..405339202280 100644
@@ -2042,6 +2042,13 @@ void intel_guc_submission_disable(struct intel_guc *guc)
  	/* Note: By the time we're here, GuC may have already been reset */
  }
+static bool __guc_submission_supported(struct intel_guc *guc)
+{
+	/* GuC submission is unavailable for pre-Gen11 */
+	return intel_guc_is_supported(guc) &&
+	       INTEL_GEN(guc_to_gt(guc)->i915) >= 11;
+}
+
  static bool __guc_submission_selected(struct intel_guc *guc)
  {
  	struct drm_i915_private *i915 = guc_to_gt(guc)->i915;
@@ -2054,6 +2061,7 @@ static bool __guc_submission_selected(struct intel_guc *guc)
  void intel_guc_submission_init_early(struct intel_guc *guc)
  {
+	guc->submission_supported = __guc_submission_supported(guc);
  	guc->submission_selected = __guc_submission_selected(guc);
  }
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h +1 -2
index a2a3fad72be1..be767eb6ff71 100644
@@ -37,8 +37,7 @@ int intel_guc_wait_for_pending_msg(struct intel_guc *guc,
  static inline bool intel_guc_submission_is_supported(struct intel_guc *guc)
  {
-	/* XXX: GuC submission is unavailable for now */
-	return false;
+	return guc->submission_supported;
  }
  static inline bool intel_guc_submission_is_wanted(struct intel_guc *guc)
drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -0
index 7a69c3c027e9..61be0aa81492 100644

drivers/gpu/drm/i915/gt/uc/intel_uc.c static void uc_expand_default_options(struct intel_uc *uc) · line 38

Quoted 7 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +3 -2
@@ -34,8 +34,15 @@ static void uc_expand_default_options(struct intel_uc *uc)
  		return;
  	}
-	/* Default: enable HuC authentication only */
-	i915->params.enable_guc = ENABLE_GUC_LOAD_HUC;
+	/* Intermediate platforms are HuC authentication only */
+	if (IS_DG1(i915) || IS_ALDERLAKE_S(i915)) {
+		drm_dbg(&i915->drm, "Disabling GuC only due to old platform\n");

This comment does not seem accurate, given that DG1 is barely out, and ADL is not out yet. How about:

Quoted 1 line

"Disabling GuC on untested platforms"?

This isn't my comment but it seems right to me. AFAIK this describes the current PR but it is subject to change (i.e. we may enable GuC on DG1 by default at some point).

Quoted 10 lines

drivers/gpu/drm/i915/gt/uc/intel_uc.c static void uc_expand_default_options(struct intel_uc *uc) · line 45

Quoted 7 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +6 -0
+		i915->params.enable_guc = ENABLE_GUC_LOAD_HUC;
+		return;
+	}
+
+	/* Default: enable HuC authentication and GuC submission */
+	i915->params.enable_guc = ENABLE_GUC_LOAD_HUC | ENABLE_GUC_SUBMISSION;

This seems to be in contradiction with the GuC submission plan which states:

Quoted 3 lines

"Not enabled by default on any current platforms but can be enabled via modparam enable_guc".

I don't believe any current platform gets this point where GuC submission would be enabled by default. The first would be ADL-P which isn't out yet.

Quoted 10 lines

When you rework the patch, could you please add a warning when the user force-enables the GuC Command Submission? Something like:

"WARNING: The user force-enabled the experimental GuC command submission backend using i915.enable_guc. Please disable it if experiencing stability issues. No bug reports will be accepted on this backend".

This should allow you to work on the backend, while communicating clearly to users that it is not ready just yet. Once it has matured, the warning can be removed.

This is a good idea but the only issue I see this message blowing up CI. We plan to enable GuC submission, via a modparam, on several platforms (e.g. TGL) where TGL isn't the PR in CI. I think if is a debug level message CI should be happy but I'll double check on this.

Matt

Quoted 4 lines

Cheers,
Martin

Quoted 12 lines

drivers/gpu/drm/i915/gt/uc/intel_uc.c static int __uc_init(struct intel_uc *uc) · line 325

Quoted 12 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -3
  }
  /* Reset GuC providing us with fresh state for both GuC and HuC.
@@ -313,9 +320,6 @@ static int __uc_init(struct intel_uc *uc)
  	if (i915_inject_probe_failure(uc_to_gt(uc)->i915))
  		return -ENOMEM;
-	/* XXX: GuC submission is unavailable for now */
-	GEM_BUG_ON(intel_uc_uses_guc_submission(uc));
-
  	ret = intel_guc_init(guc);
  	if (ret)
  		return ret;
 

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

#140 lore raw

Re: [PATCH 47/47] drm/i915/guc: Unblock GuC submission on Gen11+

Quoted 79 lines · Matthew Brost
Quoted 78 lines · Martin Peres
Quoted 64 lines · Matthew Brost

From: Daniele Ceraolo Spurio <[email protected]>

Unblock GuC submission on Gen11+ platforms.

---
   drivers/gpu/drm/i915/gt/uc/intel_guc.h            |  1 +
   drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c |  8 ++++++++
   drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h |  3 +--
   drivers/gpu/drm/i915/gt/uc/intel_uc.c             | 14 +++++++++-----
   4 files changed, 19 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc.h +1 -0
index fae01dc8e1b9..77981788204f 100644
@@ -54,6 +54,7 @@ struct intel_guc {
   	struct ida guc_ids;
   	struct list_head guc_id_list;
+	bool submission_supported;
   	bool submission_selected;
   	struct i915_vma *ads_vma;
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +8 -0
index a427336ce916..405339202280 100644
@@ -2042,6 +2042,13 @@ void intel_guc_submission_disable(struct intel_guc *guc)
   	/* Note: By the time we're here, GuC may have already been reset */
   }
+static bool __guc_submission_supported(struct intel_guc *guc)
+{
+	/* GuC submission is unavailable for pre-Gen11 */
+	return intel_guc_is_supported(guc) &&
+	       INTEL_GEN(guc_to_gt(guc)->i915) >= 11;
+}
+
   static bool __guc_submission_selected(struct intel_guc *guc)
   {
   	struct drm_i915_private *i915 = guc_to_gt(guc)->i915;
@@ -2054,6 +2061,7 @@ static bool __guc_submission_selected(struct intel_guc *guc)
   void intel_guc_submission_init_early(struct intel_guc *guc)
   {
+	guc->submission_supported = __guc_submission_supported(guc);
   	guc->submission_selected = __guc_submission_selected(guc);
   }
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h +1 -2
index a2a3fad72be1..be767eb6ff71 100644
@@ -37,8 +37,7 @@ int intel_guc_wait_for_pending_msg(struct intel_guc *guc,
   static inline bool intel_guc_submission_is_supported(struct intel_guc *guc)
   {
-	/* XXX: GuC submission is unavailable for now */
-	return false;
+	return guc->submission_supported;
   }
   static inline bool intel_guc_submission_is_wanted(struct intel_guc *guc)
drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -0
index 7a69c3c027e9..61be0aa81492 100644

drivers/gpu/drm/i915/gt/uc/intel_uc.c static void uc_expand_default_options(struct intel_uc *uc) · line 38

Quoted 7 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +3 -2
@@ -34,8 +34,15 @@ static void uc_expand_default_options(struct intel_uc *uc)
   		return;
   	}
-	/* Default: enable HuC authentication only */
-	i915->params.enable_guc = ENABLE_GUC_LOAD_HUC;
+	/* Intermediate platforms are HuC authentication only */
+	if (IS_DG1(i915) || IS_ALDERLAKE_S(i915)) {
+		drm_dbg(&i915->drm, "Disabling GuC only due to old platform\n");

This comment does not seem accurate, given that DG1 is barely out, and ADL is not out yet. How about:

Quoted 5 lines
Quoted 1 line

"Disabling GuC on untested platforms"?

This isn't my comment but it seems right to me. AFAIK this describes the current PR but it is subject to change (i.e. we may enable GuC on DG1 by default at some point).

Well, it's pretty bad PR to say that DG1 and ADL are old when they are not even out ;)

But seriously, fix this sentence, it makes no sense at all unless you are really trying to confuse non-native speakers (and annoy language purists too).

Quoted 11 lines
Quoted 11 lines

drivers/gpu/drm/i915/gt/uc/intel_uc.c static void uc_expand_default_options(struct intel_uc *uc) · line 45

Quoted 8 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +6 -0
+		i915->params.enable_guc = ENABLE_GUC_LOAD_HUC;
+		return;
+	}
+
+	/* Default: enable HuC authentication and GuC submission */
+	i915->params.enable_guc = ENABLE_GUC_LOAD_HUC | ENABLE_GUC_SUBMISSION;

This seems to be in contradiction with the GuC submission plan which states:

Quoted 7 lines
Quoted 3 lines

"Not enabled by default on any current platforms but can be enabled via modparam enable_guc".

I don't believe any current platform gets this point where GuC submission would be enabled by default. The first would be ADL-P which isn't out yet.

Isn't that exactly what the line above does?

Quoted 8 lines
Quoted 8 lines

When you rework the patch, could you please add a warning when the user force-enables the GuC Command Submission? Something like:

"WARNING: The user force-enabled the experimental GuC command submission backend using i915.enable_guc. Please disable it if experiencing stability issues. No bug reports will be accepted on this backend".

Quoted 8 lines
Quoted 3 lines

This should allow you to work on the backend, while communicating clearly to users that it is not ready just yet. Once it has matured, the warning can be removed.

This is a good idea but the only issue I see this message blowing up CI. We plan to enable GuC submission, via a modparam, on several platforms (e.g. TGL) where TGL isn't the PR in CI. I think if is a debug level message CI should be happy but I'll double check on this.

Some taints would be problematic. The only issue you may have is the IGT reload tests which could give you a dmesg-warn if you were to use any level under level 5. So put is as an info message and you'll be good :)

In case of doubt, just ask Petri / Adrinael, he is your local IGT maintainer.

Martin

Quoted 7 lines

Matt

Quoted 4 lines

Cheers,
Martin

Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -0
   }
   /* Reset GuC providing us with fresh state for both GuC and HuC.
@@ -313,9 +320,6 @@ static int __uc_init(struct intel_uc *uc)
   	if (i915_inject_probe_failure(uc_to_gt(uc)->i915))
Quoted 8 lines

drivers/gpu/drm/i915/gt/uc/intel_uc.c static int __uc_init(struct intel_uc *uc)

Quoted 8 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -3
   		return -ENOMEM;
-	/* XXX: GuC submission is unavailable for now */
-	GEM_BUG_ON(intel_uc_uses_guc_submission(uc));
-
   	ret = intel_guc_init(guc);
   	if (ret)
   		return ret;
 

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

#141 lore raw

Re: [PATCH 47/47] drm/i915/guc: Unblock GuC submission on Gen11+

On 01/07/2021 21:24, Martin Peres wrote:
[...]

Quoted 16 lines
Quoted 16 lines
Quoted 15 lines
Quoted 9 lines

+        i915->params.enable_guc = ENABLE_GUC_LOAD_HUC; +        return;
+    }
+
+    /* Default: enable HuC authentication and GuC submission */ +    i915->params.enable_guc = ENABLE_GUC_LOAD_HUC | ENABLE_GUC_SUBMISSION;

This seems to be in contradiction with the GuC submission plan which states:

"Not enabled by default on any current platforms but can be enabled via modparam enable_guc".

Quoted 5 lines
Quoted 3 lines

I don't believe any current platform gets this point where GuC submission would be enabled by default. The first would be ADL-P which isn't out yet.

Isn't that exactly what the line above does?

In case you missed this crucial part of the review. Please answer the above question.

Cheers,
Martin

#142 lore raw

Re: [PATCH 47/47] drm/i915/guc: Unblock GuC submission on Gen11+

Quoted 19 lines · Martin Peres

On 01/07/2021 21:24, Martin Peres wrote:
[...]

Quoted 17 lines
Quoted 17 lines
Quoted 16 lines
Quoted 9 lines

+        i915->params.enable_guc = ENABLE_GUC_LOAD_HUC; +        return;
+    }
+
+    /* Default: enable HuC authentication and GuC submission */ +    i915->params.enable_guc = ENABLE_GUC_LOAD_HUC | ENABLE_GUC_SUBMISSION;

This seems to be in contradiction with the GuC submission plan which states:

"Not enabled by default on any current platforms but can be enabled via modparam enable_guc".

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

I don't believe any current platform gets this point where GuC submission would be enabled by default. The first would be ADL-P which isn't out yet.

Isn't that exactly what the line above does?

In case you missed this crucial part of the review. Please answer the above question.

I guess there is some misunderstanding here, and I must admit I had similar doubt, but if you look beyond patch diff and check function code you will find that the very condition is:

	/* Don't enable GuC/HuC on pre-Gen12 */
	if (GRAPHICS_VER(i915) < 12) {
		i915->params.enable_guc = 0;
		return;
	}

so all pre-Gen12 platforms will continue to have GuC/HuC disabled.

Thanks,
Michal
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#143 lore raw

Re: [PATCH 47/47] drm/i915/guc: Unblock GuC submission on Gen11+

Quoted 35 lines · Michal Wajdeczko
Quoted 19 lines · Martin Peres

On 01/07/2021 21:24, Martin Peres wrote:
[...]

Quoted 17 lines
Quoted 17 lines
Quoted 16 lines
Quoted 9 lines

+        i915->params.enable_guc = ENABLE_GUC_LOAD_HUC; +        return;
+    }
+
+    /* Default: enable HuC authentication and GuC submission */ +    i915->params.enable_guc = ENABLE_GUC_LOAD_HUC | ENABLE_GUC_SUBMISSION;

This seems to be in contradiction with the GuC submission plan which states:

"Not enabled by default on any current platforms but can be enabled via modparam enable_guc".

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

I don't believe any current platform gets this point where GuC submission would be enabled by default. The first would be ADL-P which isn't out yet.

Isn't that exactly what the line above does?

In case you missed this crucial part of the review. Please answer the above question.

I guess there is some misunderstanding here, and I must admit I had similar doubt, but if you look beyond patch diff and check function code you will find that the very condition is:

Quoted 7 lines
	/* Don't enable GuC/HuC on pre-Gen12 */
	if (GRAPHICS_VER(i915) < 12) {
		i915->params.enable_guc = 0;
		return;
	}

so all pre-Gen12 platforms will continue to have GuC/HuC disabled.

Thanks Michal, but then the problem is the other way: how can one enable it on gen11?

I like what Daniele was going for here: separating the capability from the user-requested value, but then it seems the patch stopped half way. How about never touching the parameter, and having a AND between the two values to get the effective enable_guc?

Right now, the code is really confusing :s

Thanks,
Martin

Quoted 4 lines

Thanks,
Michal

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

#144 lore raw

Re: [PATCH 47/47] drm/i915/guc: Unblock GuC submission on Gen11+

Quoted 43 lines · Martin Peres
Quoted 42 lines · Michal Wajdeczko
Quoted 20 lines · Martin Peres

On 01/07/2021 21:24, Martin Peres wrote:
[...]

Quoted 18 lines
Quoted 18 lines
Quoted 17 lines
Quoted 9 lines

+        i915->params.enable_guc = ENABLE_GUC_LOAD_HUC; +        return;
+    }
+
+    /* Default: enable HuC authentication and GuC submission */ +    i915->params.enable_guc = ENABLE_GUC_LOAD_HUC | ENABLE_GUC_SUBMISSION;

This seems to be in contradiction with the GuC submission plan which states:

"Not enabled by default on any current platforms but can be enabled via
modparam enable_guc".

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

I don't believe any current platform gets this point where GuC submission would be enabled by default. The first would be ADL-P which isn't out yet.

Isn't that exactly what the line above does?

In case you missed this crucial part of the review. Please answer the above question.

I guess there is some misunderstanding here, and I must admit I had similar doubt, but if you look beyond patch diff and check function code you will find that the very condition is:

    /* Don't enable GuC/HuC on pre-Gen12 */
    if (GRAPHICS_VER(i915) < 12) {
        i915->params.enable_guc = 0;
        return;
    }

Quoted 4 lines
Quoted 1 line

so all pre-Gen12 platforms will continue to have GuC/HuC disabled.

Thanks Michal, but then the problem is the other way: how can one enable it on gen11?

this code here converts default GuC auto mode (enable_guc=-1) into per platform desired (tested) GuC/HuC enables.

to override that default, you may still use enable_guc=1 to explicitly enable GuC submission and since we also have this code:

+static bool __guc_submission_supported(struct intel_guc *guc) +{
+ /* GuC submission is unavailable for pre-Gen11 */
+ return intel_guc_is_supported(guc) &&
+ INTEL_GEN(guc_to_gt(guc)->i915) >= 11;
+}

it should work on any Gen11+.

Michal

Quoted 15 lines

I like what Daniele was going for here: separating the capability from the user-requested value, but then it seems the patch stopped half way. How about never touching the parameter, and having a AND between the two values to get the effective enable_guc?

Right now, the code is really confusing :s

Thanks,
Martin

Quoted 4 lines

Thanks,
Michal

#145 lore raw

Re: [PATCH 47/47] drm/i915/guc: Unblock GuC submission on Gen11+

In reply to Martin Peres
Quoted 80 lines · Martin Peres
Quoted 70 lines · Matthew Brost

From: Daniele Ceraolo Spurio <[email protected]>

Unblock GuC submission on Gen11+ platforms.

---
  drivers/gpu/drm/i915/gt/uc/intel_guc.h            |  1 + drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c |  8 ++++++++ drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h |  3 +-- drivers/gpu/drm/i915/gt/uc/intel_uc.c             | 14 +++++++++-----

  4 files changed, 19 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc.h +0 -0
index fae01dc8e1b9..77981788204f 100644
@@ -54,6 +54,7 @@ struct intel_guc {
       struct ida guc_ids;
       struct list_head guc_id_list;
   +    bool submission_supported;
       bool submission_selected;
         struct i915_vma *ads_vma;
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +6 -0
index a427336ce916..405339202280 100644
@@ -2042,6 +2042,13 @@ void intel_guc_submission_disable(struct 
 intel_guc *guc)
       /* Note: By the time we're here, GuC may have already been reset */
   }
   +static bool __guc_submission_supported(struct intel_guc *guc)
+{
+    /* GuC submission is unavailable for pre-Gen11 */
+    return intel_guc_is_supported(guc) &&
+           INTEL_GEN(guc_to_gt(guc)->i915) >= 11;
+}
+
   static bool __guc_submission_selected(struct intel_guc *guc)
   {

      struct drm_i915_private *i915 = guc_to_gt(guc)->i915;

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +1 -0
@@ -2054,6 +2061,7 @@ static bool __guc_submission_selected(struct 
 intel_guc *guc)
     void intel_guc_submission_init_early(struct intel_guc *guc)
   {
+    guc->submission_supported = __guc_submission_supported(guc);
       guc->submission_selected = __guc_submission_selected(guc);
   }

  diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h index a2a3fad72be1..be767eb6ff71 100644

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h +1 -2
@@ -37,8 +37,7 @@ int intel_guc_wait_for_pending_msg(struct intel_guc 
 *guc,
     static inline bool intel_guc_submission_is_supported(struct intel_guc *guc)
   {
-    /* XXX: GuC submission is unavailable for now */
-    return false;
+    return guc->submission_supported;
   }
     static inline bool intel_guc_submission_is_wanted(struct intel_guc *guc)
drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -0
index 7a69c3c027e9..61be0aa81492 100644
@@ -34,8 +34,15 @@ static void uc_expand_default_options(struct 
 intel_uc *uc)
           return;
       }
Quoted 6 lines

  -    /* Default: enable HuC authentication only */ -    i915->params.enable_guc = ENABLE_GUC_LOAD_HUC; +    /* Intermediate platforms are HuC authentication only */ +    if (IS_DG1(i915) || IS_ALDERLAKE_S(i915)) {
+        drm_dbg(&i915->drm, "Disabling GuC only due to old platform\n");

This comment does not seem accurate, given that DG1 is barely out, and ADL is not out yet. How about:

Quoted 2 lines

"Disabling GuC on untested platforms"?

Just because something is not in the shops yet does not mean it is new. Technology is always obsolete by the time it goes on sale.

And the issue is not a lack of testing, it is a question of whether we are allowed to change the default on something that has already started being used by customers or not (including pre-release beta customers). I.e. it is basically a political decision not an engineering decision.

Quoted 11 lines
Quoted 7 lines

+        i915->params.enable_guc = ENABLE_GUC_LOAD_HUC; +        return;
+    }
+
+    /* Default: enable HuC authentication and GuC submission */ +    i915->params.enable_guc = ENABLE_GUC_LOAD_HUC | ENABLE_GUC_SUBMISSION;

This seems to be in contradiction with the GuC submission plan which states:

"Not enabled by default on any current platforms but can be enabled via modparam enable_guc".

All current platforms have already been explicitly tested for above. This is setting the default on newer platforms - ADL-P and later. For which the official expectation is to have GuC enabled.

Quoted 2 lines

When you rework the patch, could you please add a warning when the user force-enables the GuC Command Submission?

There already is one. If you set the module parameter then the kernel is tainted. That means 'here be dragons' - you have done something officially not supported to your kernel so all bets are off, if it blows up it is your own problem.

Quoted 5 lines

Something like:

"WARNING: The user force-enabled the experimental GuC command submission backend using i915.enable_guc. Please disable it if experiencing stability issues. No bug reports will be accepted on this backend".

This should allow you to work on the backend, while communicating clearly to users that it is not ready just yet. Once it has matured, the warning can be removed.

The fact that ADL-P is not on the shelves in your local retail store should be sufficient to ensure that users are aware that ADL-P support is not entirely mature yet. And in many ways, not just GuC based submission.

John.

Quoted 4 lines

Cheers,
Martin

Quoted 12 lines
Quoted 5 lines

  }
    /* Reset GuC providing us with fresh state for both GuC and HuC.

drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -0
@@ -313,9 +320,6 @@ static int __uc_init(struct intel_uc *uc)
       if (i915_inject_probe_failure(uc_to_gt(uc)->i915))
           return -ENOMEM;
Quoted 7 lines

  -    /* XXX: GuC submission is unavailable for now */ -    GEM_BUG_ON(intel_uc_uses_guc_submission(uc)); -
      ret = intel_guc_init(guc);
      if (ret)
          return ret;

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

#146 lore raw

Re: [PATCH 47/47] drm/i915/guc: Unblock GuC submission on Gen11+

Quoted 16 lines · On Wed, 30 Jun 2021 11:58:25 -0700 John Harrison <[email protected]>…
Quoted 15 lines · Martin Peres
Quoted 14 lines · Matthew Brost

From: Daniele Ceraolo Spurio <[email protected]>

Unblock GuC submission on Gen11+ platforms.

---
  drivers/gpu/drm/i915/gt/uc/intel_guc.h            |  1 + drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c |  8 ++++++++ drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h |  3 +-- drivers/gpu/drm/i915/gt/uc/intel_uc.c             | 14 +++++++++-----

  4 files changed, 19 insertions(+), 7 deletions(-)

...

Quoted 19 lines
Quoted 19 lines
Quoted 9 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -0
index 7a69c3c027e9..61be0aa81492 100644
@@ -34,8 +34,15 @@ static void uc_expand_default_options(struct 
 intel_uc *uc)
           return;
       }
Quoted 6 lines

  -    /* Default: enable HuC authentication only */ -    i915->params.enable_guc = ENABLE_GUC_LOAD_HUC; +    /* Intermediate platforms are HuC authentication only */ +    if (IS_DG1(i915) || IS_ALDERLAKE_S(i915)) {
+        drm_dbg(&i915->drm, "Disabling GuC only due to old platform\n");

This comment does not seem accurate, given that DG1 is barely out, and ADL is not out yet. How about:

Quoted 4 lines
Quoted 2 lines

"Disabling GuC on untested platforms"?

Just because something is not in the shops yet does not mean it is new. Technology is always obsolete by the time it goes on sale.

That is a very good reason to not use terminology like "new", "old", "current", "modern" etc. at all.

End users like me definitely do not share your interpretation of "old".

Thanks,
pq

Quoted 4 lines

And the issue is not a lack of testing, it is a question of whether we are allowed to change the default on something that has already started being used by customers or not (including pre-release beta customers). I.e. it is basically a political decision not an engineering decision.

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

#147 lore raw

Re: [PATCH 47/47] drm/i915/guc: Unblock GuC submission on Gen11+

Quoted 43 lines · Pekka Paalanen
Quoted 16 lines · On Wed, 30 Jun 2021 11:58:25 -0700 John Harrison <[email protected]>…
Quoted 15 lines · Martin Peres
Quoted 14 lines · Matthew Brost

From: Daniele Ceraolo Spurio <[email protected]>

Unblock GuC submission on Gen11+ platforms.

---
   drivers/gpu/drm/i915/gt/uc/intel_guc.h            |  1 +
   drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c |  8 ++++++++
   drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h |  3 +--
   drivers/gpu/drm/i915/gt/uc/intel_uc.c             | 14 +++++++++-----
   4 files changed, 19 insertions(+), 7 deletions(-)

...

Quoted 21 lines
Quoted 21 lines
Quoted 6 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -0
index 7a69c3c027e9..61be0aa81492 100644

drivers/gpu/drm/i915/gt/uc/intel_uc.c static void uc_expand_default_options(struct · line 41

Quoted 9 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +3 -1
@@ -34,8 +34,15 @@ static void uc_expand_default_options(struct
 intel_uc *uc)
           return;
       }
   -    /* Default: enable HuC authentication only */
-    i915->params.enable_guc = ENABLE_GUC_LOAD_HUC;
+    /* Intermediate platforms are HuC authentication only */
+    if (IS_DG1(i915) || IS_ALDERLAKE_S(i915)) {
+        drm_dbg(&i915->drm, "Disabling GuC only due to old
 platform\n");

This comment does not seem accurate, given that DG1 is barely out, and ADL is not out yet. How about:

"Disabling GuC on untested platforms"?

Quoted 7 lines
Quoted 2 lines

Just because something is not in the shops yet does not mean it is new. Technology is always obsolete by the time it goes on sale.

That is a very good reason to not use terminology like "new", "old", "current", "modern" etc. at all.

End users like me definitely do not share your interpretation of "old".

Yep, old and new is relative. In the end, what matters is the validation effort, which is why I was proposing "untested platforms".

Also, remember that you are not writing these messages for Intel engineers, but instead are writing for Linux *users*.

Cheers,
Martin

Quoted 11 lines

Thanks,
pq

Quoted 4 lines

And the issue is not a lack of testing, it is a question of whether we are allowed to change the default on something that has already started being used by customers or not (including pre-release beta customers). I.e. it is basically a political decision not an engineering decision.

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

#148 lore raw

Re: [Intel-gfx] [PATCH 47/47] drm/i915/guc: Unblock GuC submission on Gen11+

Quoted 51 lines · Martin Peres
Quoted 49 lines · Pekka Paalanen
Quoted 16 lines · On Wed, 30 Jun 2021 11:58:25 -0700 John Harrison <[email protected]>…
Quoted 15 lines · Martin Peres
Quoted 14 lines · Matthew Brost

From: Daniele Ceraolo Spurio <[email protected]>

Unblock GuC submission on Gen11+ platforms.

---
   drivers/gpu/drm/i915/gt/uc/intel_guc.h            |  1 +
   drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c |  8 ++++++++
   drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h |  3 +--
   drivers/gpu/drm/i915/gt/uc/intel_uc.c             | 14 +++++++++-----
   4 files changed, 19 insertions(+), 7 deletions(-)

...

Quoted 19 lines
Quoted 19 lines
Quoted 6 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -0
index 7a69c3c027e9..61be0aa81492 100644

drivers/gpu/drm/i915/gt/uc/intel_uc.c static void uc_expand_default_options(struct · line 41

Quoted 9 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +3 -1
@@ -34,8 +34,15 @@ static void uc_expand_default_options(struct
 intel_uc *uc)
           return;
       }
   -    /* Default: enable HuC authentication only */
-    i915->params.enable_guc = ENABLE_GUC_LOAD_HUC;
+    /* Intermediate platforms are HuC authentication only */
+    if (IS_DG1(i915) || IS_ALDERLAKE_S(i915)) {
+        drm_dbg(&i915->drm, "Disabling GuC only due to old
 platform\n");

This comment does not seem accurate, given that DG1 is barely out, and ADL is not out yet. How about:

Quoted 4 lines
Quoted 2 lines

"Disabling GuC on untested platforms"?

Just because something is not in the shops yet does not mean it is new. Technology is always obsolete by the time it goes on sale.

That is a very good reason to not use terminology like "new", "old", "current", "modern" etc. at all.

Quoted 7 lines
Quoted 1 line

End users like me definitely do not share your interpretation of "old".

Yep, old and new is relative. In the end, what matters is the validation effort, which is why I was proposing "untested platforms".

Also, remember that you are not writing these messages for Intel engineers, but instead are writing for Linux *users*.

It's drm_dbg. Users don't read this stuff, at least not users with no clue what the driver does and stuff like that.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#149 lore raw

Re: [Intel-gfx] [PATCH 47/47] drm/i915/guc: Unblock GuC submission on Gen11+

Quoted 54 lines · On Thu, 1 Jul 2021 21:28:06 +0200 Daniel Vetter <[email protected]> wrote:
Quoted 53 lines · Martin Peres
Quoted 50 lines · Pekka Paalanen
Quoted 16 lines · On Wed, 30 Jun 2021 11:58:25 -0700 John Harrison <[email protected]>…
Quoted 15 lines · Martin Peres
Quoted 14 lines · Matthew Brost

From: Daniele Ceraolo Spurio <[email protected]>

Unblock GuC submission on Gen11+ platforms.

---
   drivers/gpu/drm/i915/gt/uc/intel_guc.h            |  1 +
   drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c |  8 ++++++++
   drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h |  3 +--
   drivers/gpu/drm/i915/gt/uc/intel_uc.c             | 14 +++++++++-----
   4 files changed, 19 insertions(+), 7 deletions(-)

...

Quoted 19 lines
Quoted 19 lines
Quoted 6 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -0
index 7a69c3c027e9..61be0aa81492 100644

drivers/gpu/drm/i915/gt/uc/intel_uc.c static void uc_expand_default_options(struct · line 41

Quoted 9 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +3 -1
@@ -34,8 +34,15 @@ static void uc_expand_default_options(struct
 intel_uc *uc)
           return;
       }
   -    /* Default: enable HuC authentication only */
-    i915->params.enable_guc = ENABLE_GUC_LOAD_HUC;
+    /* Intermediate platforms are HuC authentication only */
+    if (IS_DG1(i915) || IS_ALDERLAKE_S(i915)) {
+        drm_dbg(&i915->drm, "Disabling GuC only due to old
 platform\n");  

This comment does not seem accurate, given that DG1 is barely out, and ADL is not out yet. How about:

Quoted 4 lines
Quoted 2 lines

"Disabling GuC on untested platforms"?

Just because something is not in the shops yet does not mean it is new. Technology is always obsolete by the time it goes on sale.

That is a very good reason to not use terminology like "new", "old", "current", "modern" etc. at all.

End users like me definitely do not share your interpretation of "old".

Quoted 8 lines
Quoted 5 lines

Yep, old and new is relative. In the end, what matters is the validation effort, which is why I was proposing "untested platforms".

Also, remember that you are not writing these messages for Intel engineers, but instead are writing for Linux *users*.

It's drm_dbg. Users don't read this stuff, at least not users with no clue what the driver does and stuff like that.

If I had a problem, I would read it, and I have no clue what anything of that is.

Thanks,
pq

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

#150 lore raw

Re: [Intel-gfx] [PATCH 47/47] drm/i915/guc: Unblock GuC submission on Gen11+

Quoted 60 lines · Pekka Paalanen
Quoted 57 lines · On Thu, 1 Jul 2021 21:28:06 +0200 Daniel Vetter <[email protected]> wrote:
Quoted 56 lines · Martin Peres
Quoted 43 lines · Pekka Paalanen
Quoted 16 lines · On Wed, 30 Jun 2021 11:58:25 -0700 John Harrison <[email protected]>…
Quoted 15 lines · Martin Peres
Quoted 14 lines · Matthew Brost

From: Daniele Ceraolo Spurio <[email protected]>

Unblock GuC submission on Gen11+ platforms.

---
    drivers/gpu/drm/i915/gt/uc/intel_guc.h            |  1 +
    drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c |  8 ++++++++
    drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h |  3 +--
    drivers/gpu/drm/i915/gt/uc/intel_uc.c             | 14 +++++++++-----
    4 files changed, 19 insertions(+), 7 deletions(-)

...

Quoted 21 lines
Quoted 21 lines
Quoted 6 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -0
index 7a69c3c027e9..61be0aa81492 100644

drivers/gpu/drm/i915/gt/uc/intel_uc.c static void uc_expand_default_options(struct · line 41

Quoted 9 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +3 -1
@@ -34,8 +34,15 @@ static void uc_expand_default_options(struct
 intel_uc *uc)
            return;
        }
    -    /* Default: enable HuC authentication only */
-    i915->params.enable_guc = ENABLE_GUC_LOAD_HUC;
+    /* Intermediate platforms are HuC authentication only */
+    if (IS_DG1(i915) || IS_ALDERLAKE_S(i915)) {
+        drm_dbg(&i915->drm, "Disabling GuC only due to old
 platform\n");

This comment does not seem accurate, given that DG1 is barely out, and ADL is not out yet. How about:

"Disabling GuC on untested platforms"?

Quoted 7 lines
Quoted 2 lines

Just because something is not in the shops yet does not mean it is new. Technology is always obsolete by the time it goes on sale.

That is a very good reason to not use terminology like "new", "old", "current", "modern" etc. at all.

End users like me definitely do not share your interpretation of "old".

Yep, old and new is relative. In the end, what matters is the validation effort, which is why I was proposing "untested platforms".

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Also, remember that you are not writing these messages for Intel engineers, but instead are writing for Linux *users*.

It's drm_dbg. Users don't read this stuff, at least not users with no clue what the driver does and stuff like that.

If I had a problem, I would read it, and I have no clue what anything of that is.

Exactly.

This level of defense for what is clearly a bad *debug* message (at the very least, the grammar) makes no sense at all!

I don't want to hear arguments like "Not my patch" from a developer literally sending the patch to the ML and who added his SoB to the patch, playing with words, or minimizing the problem of having such a message.

All of the above are just clear signals for the community to get off your playground, which is frankly unacceptable. Your email address does not matter.

In the spirit of collaboration, your response should have been "Good catch, how about XXXX or YYYY?". This would not have wasted everyone's time in an attempt to just have it your way.

My level of confidence in this GuC transition was already low, but you guys are working hard to shoot yourself in the foot. Trust should be earned!

Martin

Quoted 5 lines

Thanks,
pq

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

#151 lore raw

Re: [Intel-gfx] [PATCH 47/47] drm/i915/guc: Unblock GuC submission on Gen11+

Quoted 79 lines · Martin Peres
Quoted 67 lines · Pekka Paalanen
Quoted 64 lines · On Thu, 1 Jul 2021 21:28:06 +0200 Daniel Vetter <[email protected]> wrote:
Quoted 62 lines · Martin Peres
Quoted 50 lines · Pekka Paalanen

On Wed, 30 Jun 2021 11:58:25 -0700
John Harrison <[email protected]> wrote:

Quoted 6 lines · Martin Peres
Quoted 5 lines · Matthew Brost
Quoted 4 lines

From: Daniele Ceraolo Spurio <[email protected]>

Unblock GuC submission on Gen11+ platforms.

Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
Signed-off-by Daniele Ceraolo Spurio

<[email protected]>

Quoted 8 lines
Quoted 8 lines

---
    drivers/gpu/drm/i915/gt/uc/intel_guc.h            |  1 + drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c |  8 ++++++++ drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h |  3 +-- drivers/gpu/drm/i915/gt/uc/intel_uc.c             | 14
+++++++++-----

    4 files changed, 19 insertions(+), 7 deletions(-)

...

Quoted 20 lines
Quoted 20 lines
Quoted 9 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -0
index 7a69c3c027e9..61be0aa81492 100644
@@ -34,8 +34,15 @@ static void uc_expand_default_options(struct
 intel_uc *uc)
             return;
         }
Quoted 6 lines

    -    /* Default: enable HuC authentication only */ -    i915->params.enable_guc = ENABLE_GUC_LOAD_HUC; +    /* Intermediate platforms are HuC authentication only */ +    if (IS_DG1(i915) || IS_ALDERLAKE_S(i915)) {
+        drm_dbg(&i915->drm, "Disabling GuC only due to old platform\n");

This comment does not seem accurate, given that DG1 is barely out, and
ADL is not out yet. How about:

Quoted 5 lines
Quoted 2 lines

"Disabling GuC on untested platforms"?

Just because something is not in the shops yet does not mean it is new.
Technology is always obsolete by the time it goes on sale.

Quoted 5 lines

That is a very good reason to not use terminology like "new", "old", "current", "modern" etc. at all.

End users like me definitely do not share your interpretation of "old".

Yep, old and new is relative. In the end, what matters is the validation
effort, which is why I was proposing "untested platforms".

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Also, remember that you are not writing these messages for Intel engineers, but instead are writing for Linux *users*.

It's drm_dbg. Users don't read this stuff, at least not users with no clue what the driver does and stuff like that.

If I had a problem, I would read it, and I have no clue what anything of that is.

Exactly.

Quoted 7 lines

This level of defense for what is clearly a bad *debug* message (at the very least, the grammar) makes no sense at all!

I don't want to hear arguments like "Not my patch" from a developer literally sending the patch to the ML and who added his SoB to the patch, playing with words, or minimizing the problem of having such a message.

Agree that 'not my patch' is never a good excuse, but equally we can't blame original patch author as patch was updated few times since then.

Maybe to avoid confusions and simplify reviews, we could split this patch into two smaller: first one that really unblocks GuC submission on all Gen11+ (see __guc_submission_supported) and second one that updates defaults for Gen12+ (see uc_expand_default_options), as original patch (from ~2019) evolved more than what title/commit message says.

Then we can fix all messaging and make sure it's clear and understood.

Thanks,
Michal

Quoted 17 lines

All of the above are just clear signals for the community to get off your playground, which is frankly unacceptable. Your email address does not matter.

In the spirit of collaboration, your response should have been "Good catch, how about XXXX or YYYY?". This would not have wasted everyone's time in an attempt to just have it your way.

My level of confidence in this GuC transition was already low, but you guys are working hard to shoot yourself in the foot. Trust should be earned!

Martin

Quoted 2 lines
Quoted 7 lines
Quoted 3 lines

Thanks,
pq

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

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

#152 lore raw

Re: [Intel-gfx] [PATCH 47/47] drm/i915/guc: Unblock GuC submission on Gen11+

Quoted 85 lines · Michal Wajdeczko
Quoted 82 lines · Martin Peres
Quoted 67 lines · Pekka Paalanen
Quoted 64 lines · On Thu, 1 Jul 2021 21:28:06 +0200 Daniel Vetter <[email protected]> wrote:
Quoted 62 lines · Martin Peres
Quoted 50 lines · Pekka Paalanen
Quoted 18 lines · On Wed, 30 Jun 2021 11:58:25 -0700 John Harrison <[email protected]>…
Quoted 17 lines · Martin Peres
Quoted 16 lines · Matthew Brost

From: Daniele Ceraolo Spurio <[email protected]>

Unblock GuC submission on Gen11+ platforms.

Signed-off-by Daniele Ceraolo Spurio

<[email protected]>

---
     drivers/gpu/drm/i915/gt/uc/intel_guc.h            |  1 +
     drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c |  8 ++++++++
     drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h |  3 +--
     drivers/gpu/drm/i915/gt/uc/intel_uc.c             | 14
+++++++++-----
     4 files changed, 19 insertions(+), 7 deletions(-)

...

Quoted 20 lines
Quoted 20 lines
Quoted 6 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -0
index 7a69c3c027e9..61be0aa81492 100644

drivers/gpu/drm/i915/gt/uc/intel_uc.c static void uc_expand_default_options(struct · line 41

Quoted 9 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +3 -1
@@ -34,8 +34,15 @@ static void uc_expand_default_options(struct
 intel_uc *uc)
             return;
         }
     -    /* Default: enable HuC authentication only */
-    i915->params.enable_guc = ENABLE_GUC_LOAD_HUC;
+    /* Intermediate platforms are HuC authentication only */
+    if (IS_DG1(i915) || IS_ALDERLAKE_S(i915)) {
+        drm_dbg(&i915->drm, "Disabling GuC only due to old
 platform\n");

This comment does not seem accurate, given that DG1 is barely out, and
ADL is not out yet. How about:

Quoted 5 lines
Quoted 2 lines

"Disabling GuC on untested platforms"?

Just because something is not in the shops yet does not mean it is new.
Technology is always obsolete by the time it goes on sale.

Quoted 5 lines

That is a very good reason to not use terminology like "new", "old", "current", "modern" etc. at all.

End users like me definitely do not share your interpretation of "old".

Yep, old and new is relative. In the end, what matters is the validation
effort, which is why I was proposing "untested platforms".

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Also, remember that you are not writing these messages for Intel engineers, but instead are writing for Linux *users*.

It's drm_dbg. Users don't read this stuff, at least not users with no clue what the driver does and stuff like that.

If I had a problem, I would read it, and I have no clue what anything of that is.

Exactly.

This level of defense for what is clearly a bad *debug* message (at the very least, the grammar) makes no sense at all!

Quoted 7 lines
Quoted 4 lines

I don't want to hear arguments like "Not my patch" from a developer literally sending the patch to the ML and who added his SoB to the patch, playing with words, or minimizing the problem of having such a message.

Agree that 'not my patch' is never a good excuse, but equally we can't blame original patch author as patch was updated few times since then.

I never wanted to blame the author here, I was only speaking about the handling of feedback on the patch.

Quoted 6 lines

Maybe to avoid confusions and simplify reviews, we could split this patch into two smaller: first one that really unblocks GuC submission on all Gen11+ (see __guc_submission_supported) and second one that updates defaults for Gen12+ (see uc_expand_default_options), as original patch (from ~2019) evolved more than what title/commit message says.

Both work for me, as long as it is a collaborative effort.

Cheers,
Martin

Quoted 30 lines

Then we can fix all messaging and make sure it's clear and understood.

Thanks,
Michal

Quoted 24 lines

All of the above are just clear signals for the community to get off your playground, which is frankly unacceptable. Your email address does not matter.

In the spirit of collaboration, your response should have been "Good catch, how about XXXX or YYYY?". This would not have wasted everyone's time in an attempt to just have it your way.

My level of confidence in this GuC transition was already low, but you guys are working hard to shoot yourself in the foot. Trust should be earned!

Martin

Quoted 5 lines

Thanks,
pq

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

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

#153 lore raw

Re: [Intel-gfx] [PATCH 47/47] drm/i915/guc: Unblock GuC submission on Gen11+

Quoted 69 lines · Martin Peres
Quoted 68 lines · Michal Wajdeczko
Quoted 67 lines · Martin Peres
Quoted 66 lines · Pekka Paalanen
Quoted 63 lines · On Thu, 1 Jul 2021 21:28:06 +0200 Daniel Vetter <[email protected]> wrote:
Quoted 60 lines · Martin Peres
Quoted 46 lines · Pekka Paalanen
Quoted 17 lines · On Wed, 30 Jun 2021 11:58:25 -0700 John Harrison <[email protected]>…
Quoted 16 lines · Martin Peres
Quoted 15 lines · Matthew Brost

From: Daniele Ceraolo Spurio <[email protected]>

Unblock GuC submission on Gen11+ platforms.

Signed-off-by Daniele Ceraolo Spurio

<[email protected]>

---
drivers/gpu/drm/i915/gt/uc/intel_guc.h |  1 + drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c |  8 ++++++++ drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h |  3 +-- drivers/gpu/drm/i915/gt/uc/intel_uc.c | 14
+++++++++-----

     4 files changed, 19 insertions(+), 7 deletions(-)

...

Quoted 20 lines
Quoted 20 lines
Quoted 9 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -0
index 7a69c3c027e9..61be0aa81492 100644
@@ -34,8 +34,15 @@ static void uc_expand_default_options(struct
 intel_uc *uc)
              return;
          }
Quoted 6 lines

     -    /* Default: enable HuC authentication only */ -    i915->params.enable_guc = ENABLE_GUC_LOAD_HUC; +    /* Intermediate platforms are HuC authentication only */ +    if (IS_DG1(i915) || IS_ALDERLAKE_S(i915)) {
+        drm_dbg(&i915->drm, "Disabling GuC only due to old platform\n");

This comment does not seem accurate, given that DG1 is barely out, and
ADL is not out yet. How about:

Quoted 4 lines
Quoted 1 line

"Disabling GuC on untested platforms"?

Just because something is not in the shops yet does not mean it is new.
Technology is always obsolete by the time it goes on sale.

Quoted 5 lines

That is a very good reason to not use terminology like "new", "old", "current", "modern" etc. at all.

End users like me definitely do not share your interpretation of "old".

Yep, old and new is relative. In the end, what matters is the validation
effort, which is why I was proposing "untested platforms".

Also, remember that you are not writing these messages for Intel engineers, but instead are writing for Linux *users*.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

It's drm_dbg. Users don't read this stuff, at least not users with no clue what the driver does and stuff like that.

If I had a problem, I would read it, and I have no clue what anything of that is.

Exactly.

I don't see how replacing 'old' for 'untested' helps anybody to understand anything. Untested just implies we can't be bothered to test stuff before publishing it. And as previously stated, this is purely a political decision not a technical one. Sure, change the message to be 'Disabling GuC submission but enabling HuC loading via GuC on platform XXX' if that makes it clearer what is going on. Or just drop the message completely. It's simply explaining what the default option is for the current platform which you can also get by reading the code. However, I disagree that 'untested' is the correct message. Quite a lot of testing has been happening on TGL+ with GuC submission enabled.

Quoted 15 lines
Quoted 11 lines
Quoted 8 lines

This level of defense for what is clearly a bad *debug* message (at the very least, the grammar) makes no sense at all!

I don't want to hear arguments like "Not my patch" from a developer literally sending the patch to the ML and who added his SoB to the patch, playing with words, or minimizing the problem of having such a message.

Agree that 'not my patch' is never a good excuse, but equally we can't blame original patch author as patch was updated few times since then.

I never wanted to blame the author here, I was only speaking about the handling of feedback on the patch.

Quoted 1 line
Quoted 7 lines
Quoted 5 lines

Maybe to avoid confusions and simplify reviews, we could split this patch into two smaller: first one that really unblocks GuC submission on all Gen11+ (see __guc_submission_supported) and second one that updates defaults for Gen12+ (see uc_expand_default_options), as original patch (from ~2019) evolved more than what title/commit message says.

Both work for me, as long as it is a collaborative effort.

I'm not seeing how splitting the patch up fixes the complaints about the debug message.

And to be clear, no-one is actually arguing for a code change as such? The issue is just about the text of the debug message? Or did I miss something somewhere?

John.

Quoted 30 lines

Cheers,
Martin

Quoted 26 lines

Then we can fix all messaging and make sure it's clear and understood.

Thanks,
Michal

Quoted 20 lines

All of the above are just clear signals for the community to get off your playground, which is frankly unacceptable. Your email address does not matter.

In the spirit of collaboration, your response should have been "Good catch, how about XXXX or YYYY?". This would not have wasted everyone's time in an attempt to just have it your way.

My level of confidence in this GuC transition was already low, but you guys are working hard to shoot yourself in the foot. Trust should be earned!

Martin

Quoted 5 lines

Thanks,
pq

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

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

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

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

#154 lore raw

Re: [Intel-gfx] [PATCH 47/47] drm/i915/guc: Unblock GuC submission on Gen11+

Quoted 78 lines · On Tue, 6 Jul 2021 17:57:35 -0700 John Harrison <[email protected]>…
Quoted 70 lines · Martin Peres
Quoted 69 lines · Michal Wajdeczko
Quoted 68 lines · Martin Peres
Quoted 67 lines · Pekka Paalanen
Quoted 64 lines · On Thu, 1 Jul 2021 21:28:06 +0200 Daniel Vetter <[email protected]> wrote:
Quoted 61 lines · Martin Peres
Quoted 46 lines · Pekka Paalanen
Quoted 17 lines · On Wed, 30 Jun 2021 11:58:25 -0700 John Harrison <[email protected]>…
Quoted 16 lines · Martin Peres
Quoted 15 lines · Matthew Brost

From: Daniele Ceraolo Spurio <[email protected]>

Unblock GuC submission on Gen11+ platforms.

Signed-off-by Daniele Ceraolo Spurio

<[email protected]>

---
drivers/gpu/drm/i915/gt/uc/intel_guc.h |  1 + drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c |  8 ++++++++ drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h |  3 +-- drivers/gpu/drm/i915/gt/uc/intel_uc.c | 14
+++++++++-----

     4 files changed, 19 insertions(+), 7 deletions(-)  

...

Quoted 20 lines
Quoted 20 lines
Quoted 9 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -0
index 7a69c3c027e9..61be0aa81492 100644
@@ -34,8 +34,15 @@ static void uc_expand_default_options(struct
 intel_uc *uc)
              return;
          }
Quoted 6 lines

     -    /* Default: enable HuC authentication only */ -    i915->params.enable_guc = ENABLE_GUC_LOAD_HUC; +    /* Intermediate platforms are HuC authentication only */ +    if (IS_DG1(i915) || IS_ALDERLAKE_S(i915)) {
+        drm_dbg(&i915->drm, "Disabling GuC only due to old platform\n");

This comment does not seem accurate, given that DG1 is barely out, and
ADL is not out yet. How about:

Quoted 4 lines
Quoted 1 line

"Disabling GuC on untested platforms"?

Just because something is not in the shops yet does not mean it is new.
Technology is always obsolete by the time it goes on sale.

Quoted 6 lines

That is a very good reason to not use terminology like "new", "old",
"current", "modern" etc. at all.

End users like me definitely do not share your interpretation of "old".

Yep, old and new is relative. In the end, what matters is the validation
effort, which is why I was proposing "untested platforms".

Also, remember that you are not writing these messages for Intel engineers, but instead are writing for Linux *users*.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

It's drm_dbg. Users don't read this stuff, at least not users with no clue what the driver does and stuff like that.

If I had a problem, I would read it, and I have no clue what anything of that is.

Exactly.

Quoted 10 lines

I don't see how replacing 'old' for 'untested' helps anybody to understand anything. Untested just implies we can't be bothered to test stuff before publishing it. And as previously stated, this is purely a political decision not a technical one. Sure, change the message to be 'Disabling GuC submission but enabling HuC loading via GuC on platform XXX' if that makes it clearer what is going on. Or just drop the message completely. It's simply explaining what the default option is for the current platform which you can also get by reading the code. However, I disagree that 'untested' is the correct message. Quite a lot of testing has been happening on TGL+ with GuC submission enabled.

Hi,

it seems to me that "untested" was just a wrong guess, nothing more. It was presented with "how about?", not as an exact demand.

You don't have to attack that word, just use another phrasing that is both correct and not misleading to the majority of tech savvy people.

Thanks,
pq

#155 lore raw

Re: [Intel-gfx] [PATCH 47/47] drm/i915/guc: Unblock GuC submission on Gen11+

In reply to John Harrison
Quoted 111 lines · John Harrison
Quoted 70 lines · Martin Peres
Quoted 69 lines · Michal Wajdeczko
Quoted 68 lines · Martin Peres
Quoted 67 lines · Pekka Paalanen
Quoted 64 lines · On Thu, 1 Jul 2021 21:28:06 +0200 Daniel Vetter <[email protected]> wrote:
Quoted 61 lines · Martin Peres
Quoted 46 lines · Pekka Paalanen
Quoted 17 lines · On Wed, 30 Jun 2021 11:58:25 -0700 John Harrison <[email protected]>…
Quoted 16 lines · Martin Peres
Quoted 15 lines · Matthew Brost

From: Daniele Ceraolo Spurio <[email protected]>

Unblock GuC submission on Gen11+ platforms.

Signed-off-by Daniele Ceraolo Spurio

<[email protected]>

---
drivers/gpu/drm/i915/gt/uc/intel_guc.h |  1 + drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c |  8 ++++++++ drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h |  3 +-- drivers/gpu/drm/i915/gt/uc/intel_uc.c | 14
+++++++++-----

     4 files changed, 19 insertions(+), 7 deletions(-)

...

Quoted 20 lines
Quoted 20 lines
Quoted 9 lines
drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 -0
index 7a69c3c027e9..61be0aa81492 100644
@@ -34,8 +34,15 @@ static void uc_expand_default_options(struct
 intel_uc *uc)
              return;
          }
Quoted 6 lines

     -    /* Default: enable HuC authentication only */ -    i915->params.enable_guc = ENABLE_GUC_LOAD_HUC; +    /* Intermediate platforms are HuC authentication only */ +    if (IS_DG1(i915) || IS_ALDERLAKE_S(i915)) {
+        drm_dbg(&i915->drm, "Disabling GuC only due to old platform\n");

This comment does not seem accurate, given that DG1 is barely out, and
ADL is not out yet. How about:

Quoted 4 lines
Quoted 1 line

"Disabling GuC on untested platforms"?

Just because something is not in the shops yet does not mean it is new.
Technology is always obsolete by the time it goes on sale.

Quoted 6 lines

That is a very good reason to not use terminology like "new", "old",
"current", "modern" etc. at all.

End users like me definitely do not share your interpretation of "old".

Yep, old and new is relative. In the end, what matters is the validation
effort, which is why I was proposing "untested platforms".

Also, remember that you are not writing these messages for Intel engineers, but instead are writing for Linux *users*.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

It's drm_dbg. Users don't read this stuff, at least not users with no clue what the driver does and stuff like that.

If I had a problem, I would read it, and I have no clue what anything of that is.

Exactly.

I don't see how replacing 'old' for 'untested' helps anybody to understand anything. Untested just implies we can't be bothered to test stuff before publishing it. And as previously stated, this is purely a political decision not a technical one. Sure, change the message to be 'Disabling GuC submission but enabling HuC loading via GuC on platform XXX' if that makes it clearer what is going on. Or just drop the message completely. It's simply explaining what the default option is for the current platform which you can also get by reading the code. However, I disagree that 'untested' is the correct message. Quite a lot of testing has been happening on TGL+ with GuC submission enabled.

Quoted 22 lines
Quoted 11 lines
Quoted 8 lines

This level of defense for what is clearly a bad *debug* message (at the very least, the grammar) makes no sense at all!

I don't want to hear arguments like "Not my patch" from a developer literally sending the patch to the ML and who added his SoB to the patch, playing with words, or minimizing the problem of having such a message.

Agree that 'not my patch' is never a good excuse, but equally we can't blame original patch author as patch was updated few times since then.

I never wanted to blame the author here, I was only speaking about the handling of feedback on the patch.

Quoted 6 lines

Maybe to avoid confusions and simplify reviews, we could split this patch into two smaller: first one that really unblocks GuC submission on all Gen11+ (see __guc_submission_supported) and second one that updates defaults for Gen12+ (see uc_expand_default_options), as original patch (from ~2019) evolved more than what title/commit message says.

Quoted 3 lines
Quoted 1 line

Both work for me, as long as it is a collaborative effort.

I'm not seeing how splitting the patch up fixes the complaints about the debug message.

I assume it's not just about debug message (but still related)

With separate patches you can explain in commit messages:

patch1: why (from technical point of view) we unblock GuC submission only for Gen11+ (as pre-Gen11 are also using the same GuC firmware so one can assume GuC submission will work there too),

patch2: why (from "political" point of view) we want to turn on GuC submission by default only on selected Gen12+ platforms (as one could wonder why we don't enable GuC submission for Gen11+ since it should work there too).

Then it should be easy to find proper wording for any debug message we may want to add.

Quoted 4 lines

And to be clear, no-one is actually arguing for a code change as such? The issue is just about the text of the debug message? Or did I miss something somewhere?

Change is trivial is hard to complain, what is missing, IMHO, is good rationale why we are making GuC submission enabling so selective.

Michal

Quoted 43 lines

John.

Quoted 38 lines

Cheers,
Martin

Quoted 30 lines

Then we can fix all messaging and make sure it's clear and understood.

Thanks,
Michal

Quoted 24 lines

All of the above are just clear signals for the community to get off your playground, which is frankly unacceptable. Your email address does not matter.

In the spirit of collaboration, your response should have been "Good catch, how about XXXX or YYYY?". This would not have wasted everyone's time in an attempt to just have it your way.

My level of confidence in this GuC transition was already low, but you guys are working hard to shoot yourself in the foot. Trust should be earned!

Martin

Quoted 5 lines

Thanks,
pq

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

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

author Reviewed-by on v1 47/47
#156 lore raw

Re: [Intel-gfx] [PATCH 47/47] drm/i915/guc: Unblock GuC submission on Gen11+

In reply to Matthew Brost
Quoted 7 lines · Matthew Brost

From: Daniele Ceraolo Spurio <[email protected]>

Unblock GuC submission on Gen11+ platforms.

Updating debug message per feedback, with that:

Quoted 98 lines
---
 drivers/gpu/drm/i915/gt/uc/intel_guc.h            |  1 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c |  8 ++++++++
 drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h |  3 +--
 drivers/gpu/drm/i915/gt/uc/intel_uc.c             | 14 +++++++++-----
 4 files changed, 19 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc.h +1 -0
index fae01dc8e1b9..77981788204f 100644
@@ -54,6 +54,7 @@ struct intel_guc {
 	struct ida guc_ids;
 	struct list_head guc_id_list;
 
+	bool submission_supported;
 	bool submission_selected;
 
 	struct i915_vma *ads_vma;
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +8 -0
index a427336ce916..405339202280 100644
@@ -2042,6 +2042,13 @@ void intel_guc_submission_disable(struct intel_guc *guc)
 	/* Note: By the time we're here, GuC may have already been reset */
 }
 
+static bool __guc_submission_supported(struct intel_guc *guc)
+{
+	/* GuC submission is unavailable for pre-Gen11 */
+	return intel_guc_is_supported(guc) &&
+	       INTEL_GEN(guc_to_gt(guc)->i915) >= 11;
+}
+
 static bool __guc_submission_selected(struct intel_guc *guc)
 {
 	struct drm_i915_private *i915 = guc_to_gt(guc)->i915;
@@ -2054,6 +2061,7 @@ static bool __guc_submission_selected(struct intel_guc *guc)
 
 void intel_guc_submission_init_early(struct intel_guc *guc)
 {
+	guc->submission_supported = __guc_submission_supported(guc);
 	guc->submission_selected = __guc_submission_selected(guc);
 }
 
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h +1 -2
index a2a3fad72be1..be767eb6ff71 100644
@@ -37,8 +37,7 @@ int intel_guc_wait_for_pending_msg(struct intel_guc *guc,
 
 static inline bool intel_guc_submission_is_supported(struct intel_guc *guc)
 {
-	/* XXX: GuC submission is unavailable for now */
-	return false;
+	return guc->submission_supported;
 }
 
 static inline bool intel_guc_submission_is_wanted(struct intel_guc *guc)
drivers/gpu/drm/i915/gt/uc/intel_uc.c +9 -5
index 7a69c3c027e9..61be0aa81492 100644
@@ -34,8 +34,15 @@ static void uc_expand_default_options(struct intel_uc *uc)
 		return;
 	}
 
-	/* Default: enable HuC authentication only */
-	i915->params.enable_guc = ENABLE_GUC_LOAD_HUC;
+	/* Intermediate platforms are HuC authentication only */
+	if (IS_DG1(i915) || IS_ALDERLAKE_S(i915)) {
+		drm_dbg(&i915->drm, "Disabling GuC only due to old platform\n");
+		i915->params.enable_guc = ENABLE_GUC_LOAD_HUC;
+		return;
+	}
+
+	/* Default: enable HuC authentication and GuC submission */
+	i915->params.enable_guc = ENABLE_GUC_LOAD_HUC | ENABLE_GUC_SUBMISSION;
 }
 
 /* Reset GuC providing us with fresh state for both GuC and HuC.
@@ -313,9 +320,6 @@ static int __uc_init(struct intel_uc *uc)
 	if (i915_inject_probe_failure(uc_to_gt(uc)->i915))
 		return -ENOMEM;
 
-	/* XXX: GuC submission is unavailable for now */
-	GEM_BUG_ON(intel_uc_uses_guc_submission(uc));
-
 	ret = intel_guc_init(guc);
 	if (ret)
 		return ret;
Signature · 6 lines
2.28.0

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

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for GuC submission support

In reply to Matthew Brost
== Series Details ==

== Series Details ==

Series: GuC submission support
URL : https://patchwork.freedesktop.org/series/91840/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
a582e9c666ff drm/i915/guc: Relax CTB response timeout
743d703ec315 drm/i915/guc: Improve error message for unsolicited CT response
beb15fc92c92 drm/i915/guc: Increase size of CTB buffers
3d4dab7e7c81 drm/i915/guc: Add non blocking CTB send function
c0779d6fc3b7 drm/i915/guc: Add stall timer to non blocking CTB send function
2c9efd827987 drm/i915/guc: Optimize CTB writes and reads
-:112: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#112: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c:528:
+		CT_ERROR(ct, "Corrupted descriptor head=%u tail=%u size=%u\n",
+			  ctb->desc->head, ctb->desc->tail, ctb->size);

total: 0 errors, 0 warnings, 1 checks, 184 lines checked
28324246d8aa drm/i915/guc: Module load failure test for CT buffer creation
-:38: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: John Harrison <[email protected]>' != 'Signed-off-by: John Harrison <[email protected]>'

total: 0 errors, 1 warnings, 0 checks, 20 lines checked
071d7fa76a91 drm/i915/guc: Add new GuC interface defines and structures -:98: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #98: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h:275:
+ * reset. (in micro seconds). */

total: 0 errors, 1 warnings, 0 checks, 83 lines checked
9cc26b390c65 drm/i915/guc: Remove GuC stage descriptor, add lrc descriptor
-:120: WARNING:PREFER_DEFINED_ATTRIBUTE_MACRO: __always_unused or __maybe_unused is preferred over __attribute__((__unused__)) #120: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:69:
+__attribute__ ((unused))

total: 0 errors, 1 warnings, 0 checks, 208 lines checked dbd8df00f28f drm/i915/guc: Add lrc descriptor context lookup array 0478ac5fcc47 drm/i915/guc: Implement GuC submission tasklet 86db42bdbf1a drm/i915/guc: Add bypass tasklet submission path to GuC b9faec389671 drm/i915/guc: Implement GuC context operations for new inteface -:109: ERROR:POINTER_LOCATION: "foo* bar" should be "foo *bar" #109: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc.h:113:
+static inline int intel_guc_send_busy_loop(struct intel_guc* guc,

-:117: ERROR:IN_ATOMIC: do not use in_atomic in drivers #117: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc.h:121:
+ might_sleep_if(loop && (!in_atomic() && !irqs_disabled()));

-:122: ERROR:IN_ATOMIC: do not use in_atomic in drivers #122: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc.h:126:
+ if (likely(!in_atomic() && !irqs_disabled()))

-:551: WARNING:REPEATED_WORD: Possible repeated word: 'from' #551: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:784:
+ * could be regisgered either the guc_id has been stole from from

-:789: WARNING:ONE_SEMICOLON: Statements terminations use 1 semicolon #789: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:985:
+ return ret;;

total: 3 errors, 2 warnings, 0 checks, 887 lines checked 0ddf4a0e5ead drm/i915/guc: Insert fence on context when deregistering -:7: WARNING:REPEATED_WORD: Possible repeated word: 'before' #7:
registered with the GuC. In this a case deregister must be before before

total: 0 errors, 1 warnings, 0 checks, 113 lines checked 53890c0d5072 drm/i915/guc: Defer context unpin until scheduling is disabled 9e9fc047e7c1 drm/i915/guc: Disable engine barriers with GuC during unpin e7452c180185 drm/i915/guc: Extend deregistration fence to schedule disable 195129a34fbe drm/i915: Disable preempt busywait when using GuC scheduling e53180c87b60 drm/i915/guc: Ensure request ordering via completion fences -:90: WARNING:LONG_LINE: line length of 101 exceeds 100 columns #90: FILE: drivers/gpu/drm/i915/i915_request.c:1675:
+ if ((!uses_guc && is_power_of_2(READ_ONCE(prev->engine)->mask | rq->engine->mask)) ||

total: 0 errors, 1 warnings, 0 checks, 64 lines checked 59c796b965e6 drm/i915/guc: Disable semaphores when using GuC scheduling 588df5bce44c drm/i915/guc: Ensure G2H response has space in buffer -:22: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'len' - possible side-effects? #22: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc.h:100:
+#define MAKE_SEND_FLAGS(len) \
+ ({GEM_BUG_ON(!FIELD_FIT(INTEL_GUC_SEND_G2H_DW_MASK, len)); \
+ (FIELD_PREP(INTEL_GUC_SEND_G2H_DW_MASK, len) | INTEL_GUC_SEND_NB);})

-:24: ERROR:SPACING: space required after that ';' (ctx:VxV) #24: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc.h:102:
+ (FIELD_PREP(INTEL_GUC_SEND_G2H_DW_MASK, len) | INTEL_GUC_SEND_NB);})
^

-:202: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses #202: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c:597:
+#define G2H_LEN_DW(f) \
+ FIELD_GET(INTEL_GUC_SEND_G2H_DW_MASK, f) ? \
+ FIELD_GET(INTEL_GUC_SEND_G2H_DW_MASK, f) + GUC_CTB_HXG_MSG_MIN_LEN : 0

-:202: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'f' - possible side-effects? #202: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c:597:
+#define G2H_LEN_DW(f) \
+ FIELD_GET(INTEL_GUC_SEND_G2H_DW_MASK, f) ? \
+ FIELD_GET(INTEL_GUC_SEND_G2H_DW_MASK, f) + GUC_CTB_HXG_MSG_MIN_LEN : 0

total: 2 errors, 0 warnings, 2 checks, 296 lines checked a03438ead8d3 drm/i915/guc: Update intel_gt_wait_for_idle to work with GuC -:218: ERROR:POINTER_LOCATION: "foo* bar" should be "foo *bar" #218: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:257:
+static int guc_submission_busy_loop(struct intel_guc* guc,

total: 1 errors, 0 warnings, 0 checks, 333 lines checked c84dc5dbebea drm/i915/guc: Update GuC debugfs to support new GuC 4adb7ce61e5f drm/i915/guc: Add several request trace points 37ebee77b9c2 drm/i915: Add intel_context tracing
-:152: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #152: FILE: drivers/gpu/drm/i915/i915_trace.h:909:
+DECLARE_EVENT_CLASS(intel_context,
+ TP_PROTO(struct intel_context *ce),

-:155: CHECK:OPEN_ENDED_LINE: Lines should not end with a '(' #155: FILE: drivers/gpu/drm/i915/i915_trace.h:912:
+ TP_STRUCT__entry(

-:162: CHECK:OPEN_ENDED_LINE: Lines should not end with a '(' #162: FILE: drivers/gpu/drm/i915/i915_trace.h:919:
+ TP_fast_assign(

total: 0 errors, 0 warnings, 3 checks, 264 lines checked
351767d30288 drm/i915/guc: GuC virtual engines
-:122: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #122: FILE: drivers/gpu/drm/i915/gt/intel_engine.h:285:
+ return intel_guc_virtual_engine_has_heartbeat(engine);
+ else

-:847: CHECK:LINE_SPACING: Please don't use multiple blank lines #847: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:1894:
+
+

total: 0 errors, 1 warnings, 1 checks, 785 lines checked
5ca8f1a503a8 drm/i915: Track 'serial' counts for virtual engines 81e0788642e7 drm/i915: Hold reference to intel_context over life of i915_request 2fca6597dcd8 drm/i915/guc: Disable bonding extension with GuC submission 7ae740c21ec4 drm/i915/guc: Direct all breadcrumbs for a class to single breadcrumbs -:346: ERROR:CODE_INDENT: code indent should use tabs where possible #346: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:1411:
+ * In GuC submission mode we do not know which physical engine a request$

-:347: ERROR:CODE_INDENT: code indent should use tabs where possible #347: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:1412:
+ * will be scheduled on, this creates a problem because the breadcrumb$

-:348: ERROR:CODE_INDENT: code indent should use tabs where possible #348: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:1413:
+ * interrupt is per physical engine. To work around this we attach$

-:349: ERROR:CODE_INDENT: code indent should use tabs where possible #349: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:1414:
+ * requests and direct all breadcrumb interrupts to the first instance$

-:350: ERROR:CODE_INDENT: code indent should use tabs where possible #350: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:1415:
+ * of an engine per class. In addition all breadcrumb interrupts are$

-:352: ERROR:CODE_INDENT: code indent should use tabs where possible #352: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:1417:
+ */$

total: 6 errors, 0 warnings, 0 checks, 329 lines checked 3c79abc34b26 drm/i915/guc: Reset implementation for new GuC interface -:306: CHECK:LINE_SPACING: Please don't use multiple blank lines #306: FILE: drivers/gpu/drm/i915/gt/mock_engine.c:266:
+
+

-:390: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "guc->lrc_desc_pool_vaddr" #390: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:250:
+ return guc->lrc_desc_pool_vaddr != NULL;

-:545: ERROR:SPACING: spaces required around that '||' (ctx:VxW) #545: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:540:
+ if (pending_enable|| deregister)
^

-:585: WARNING:MEMORY_BARRIER: memory barrier without comment #585: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:580:
+ wmb();

-:637: ERROR:CODE_INDENT: code indent should use tabs where possible #637: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:622:
+ ^I */$

-:637: WARNING:SPACE_BEFORE_TAB: please, no space before tabs #637: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:622:
+ ^I */$

-:1294: CHECK:LINE_SPACING: Please don't use multiple blank lines #1294: FILE: drivers/gpu/drm/i915/gt/uc/intel_uc.c:568:

+

total: 2 errors, 2 warnings, 3 checks, 1301 lines checked 848ca056fc3e drm/i915: Reset GPU immediately if submission is disabled -:93: CHECK:BRACES: Blank lines aren't necessary before a close brace '}' #93: FILE: drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c:223:
+
+}

total: 0 errors, 0 warnings, 1 checks, 181 lines checked
17b20c0c8bd7 drm/i915/guc: Add disable interrupts to guc sanitize
-:11: ERROR:BAD_SIGN_OFF: Unrecognized email address: 'Daniele Ceraolo Spurio <[email protected]' #11:
Cc: Daniele Ceraolo Spurio <[email protected]

total: 1 errors, 0 warnings, 0 checks, 70 lines checked
345f1eca0a86 drm/i915/guc: Suspend/resume implementation for new interface a921fc062048 drm/i915/guc: Handle context reset notification 5560a36d3f00 drm/i915/guc: Handle engine reset failure notification ee41dea700c0 drm/i915/guc: Enable the timer expired interrupt for GuC adcd1418b513 drm/i915/guc: Provide mmio list to be saved/restored on engine reset -:355: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #355: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c:212:
+ temp_set.registers = kmalloc_array(temp_set.size,
+ sizeof(*temp_set.registers),

-:384: CHECK:SPACING: No space is necessary after a cast #384: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c:241:
+ temp_set.registers = (struct guc_mmio_reg *) (((u8 *) blob) + offset);

total: 0 errors, 0 warnings, 2 checks, 400 lines checked b7f2c290b8da drm/i915/guc: Don't complain about reset races cf156af71348 drm/i915/guc: Enable GuC engine reset
d43f902c9f69 drm/i915/guc: Capture error state on context reset c24a302b3409 drm/i915/guc: Fix for error capture after full GPU reset with GuC -:119: CHECK:BRACES: braces {} should be used on all arms of this statement #119: FILE: drivers/gpu/drm/i915/gt/intel_engine_cs.c:1701:
+ if (guc) {
[...]
+ } else
[...]

-:123: CHECK:BRACES: Unbalanced braces around else statement #123: FILE: drivers/gpu/drm/i915/gt/intel_engine_cs.c:1705:
+ } else

-:408: ERROR:OPEN_BRACE: open brace '{' following enum go on the same line #408: FILE: drivers/gpu/drm/i915/i915_request.h:655:
+enum i915_request_state
+{

-:418: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: John Harrison <[email protected]>' != 'Signed-off-by: John Harrison <[email protected]>'

total: 1 errors, 1 warnings, 2 checks, 348 lines checked 2529cfc15930 drm/i915/guc: Hook GuC scheduling policies up
-:80: WARNING:ENOTSUPP: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP #80: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c:113:
+ return -ENOTSUPP;

-:148: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: John Harrison <[email protected]>' != 'Signed-off-by: John Harrison <[email protected]>'

total: 0 errors, 2 warnings, 0 checks, 113 lines checked 055c438902ea drm/i915/guc: Connect reset modparam updates to GuC policy flags -:49: WARNING:LONG_LINE: line length of 107 exceeds 100 columns #49: FILE: drivers/gpu/drm/i915/i915_debugfs_params.c:14:
+#define MATCH_DEBUGFS_NODE_NAME(_file, _name) (strcmp((_file)->f_path.dentry->d_name.name, (_name)) == 0)

-:51: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'i915' - possible side-effects? #51: FILE: drivers/gpu/drm/i915/i915_debugfs_params.c:16:
+#define GET_I915(i915, name, ptr) \
+ do { \
+ struct i915_params *params; \
+ params = container_of(((void *) (ptr)), typeof(*params), name); \
+ (i915) = container_of(params, typeof(*(i915)), params); \
+ } while(0)

-:54: CHECK:SPACING: No space is necessary after a cast #54: FILE: drivers/gpu/drm/i915/i915_debugfs_params.c:19:
+ params = container_of(((void *) (ptr)), typeof(*params), name); \

-:56: ERROR:SPACING: space required before the open parenthesis '(' #56: FILE: drivers/gpu/drm/i915/i915_debugfs_params.c:21:
+ } while(0)

-:103: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: John Harrison <[email protected]>' != 'Signed-off-by: John Harrison <[email protected]>'

total: 1 errors, 2 warnings, 2 checks, 68 lines checked
9bedfd84c9e8 drm/i915/guc: Include scheduling policies in the debugfs state dump
-:72: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: John Harrison <[email protected]>' != 'Signed-off-by: John Harrison <[email protected]>'

total: 0 errors, 1 warnings, 0 checks, 44 lines checked b49edbcc9280 drm/i915/guc: Add golden context to GuC ADS -:254: CHECK:SPACING: No space is necessary after a cast #254: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c:453:
+ ptr = ((u8 *) blob) + offset;

-:279: WARNING:LONG_LINE: line length of 106 exceeds 100 columns #279: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c:470:
+ drm_err(&gt->i915->drm, "No engine state recorded for class %d!\n", engine_class);

total: 0 errors, 1 warnings, 1 checks, 342 lines checked 8a320e973471 drm/i915/guc: Unblock GuC submission on Gen11+

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

#158 lore raw

[Intel-gfx] ✗ Fi.CI.SPARSE: warning for GuC submission support

In reply to Matthew Brost
== Series Details ==

== Series Details ==

Series: GuC submission support
URL : https://patchwork.freedesktop.org/series/91840/
State : warning

== Summary ==

$ dim sparse --fast origin/drm-tip
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined

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

#159 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for GuC submission support

In reply to Matthew Brost
== Series Details ==

== Series Details ==

Series: GuC submission support
URL : https://patchwork.freedesktop.org/series/91840/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_10271 -> Patchwork_20449
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_20449 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_20449, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20449/index.html

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_20449:

### IGT changes ###

#### Possible regressions ####

* igt@core_auth@basic-auth:
- fi-kbl-8809g: [PASS][1] -> [DMESG-WARN][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10271/fi-kbl-8809g/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20449/fi-kbl-8809g/igt@[email protected]

* igt@i915_selftest@live@workarounds:
- fi-snb-2520m: [PASS][3] -> [DMESG-FAIL][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10271/fi-snb-2520m/igt@i915_selftest@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20449/fi-snb-2520m/igt@i915_selftest@[email protected]
- fi-snb-2600: [PASS][5] -> [DMESG-FAIL][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10271/fi-snb-2600/igt@i915_selftest@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20449/fi-snb-2600/igt@i915_selftest@[email protected]

Known issues
------------

Here are the changes found in Patchwork_20449 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@amdgpu/amd_basic@cs-gfx:
- fi-kbl-soraka: NOTRUN -> [SKIP][7] ([fdo#109271]) +15 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20449/fi-kbl-soraka/igt@amdgpu/[email protected]

* igt@kms_chamelium@dp-crc-fast:
- fi-bsw-nick: NOTRUN -> [SKIP][8] ([fdo#109271] / [fdo#111827]) +8 similar issues
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20449/fi-bsw-nick/igt@[email protected]

* igt@prime_vgem@basic-fence-flip:
- fi-bsw-nick: NOTRUN -> [SKIP][9] ([fdo#109271]) +63 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20449/fi-bsw-nick/igt@[email protected]

* igt@runner@aborted:
- fi-kbl-8809g: NOTRUN -> [FAIL][10] ([i915#3363])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20449/fi-kbl-8809g/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#3303]: https://gitlab.freedesktop.org/drm/intel/issues/3303
[i915#3363]: https://gitlab.freedesktop.org/drm/intel/issues/3363

Participating hosts (41 -> 38)
------------------------------

Missing (3): fi-ilk-m540 fi-bsw-cyan fi-bdw-samus

Build changes
-------------

* Linux: CI_DRM_10271 -> Patchwork_20449

CI-20190529: 20190529
CI_DRM_10271: 7a4a01d6716339c418394dbeb9a20d55bbb9a9ba @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6117: 3ba0a02404f243d6d8f232c6215163cc4b0fd699 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_20449: 8a320e973471dadebf185470543bfff31807af3f @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

8a320e973471 drm/i915/guc: Unblock GuC submission on Gen11+ b49edbcc9280 drm/i915/guc: Add golden context to GuC ADS
9bedfd84c9e8 drm/i915/guc: Include scheduling policies in the debugfs state dump 055c438902ea drm/i915/guc: Connect reset modparam updates to GuC policy flags 2529cfc15930 drm/i915/guc: Hook GuC scheduling policies up c24a302b3409 drm/i915/guc: Fix for error capture after full GPU reset with GuC d43f902c9f69 drm/i915/guc: Capture error state on context reset cf156af71348 drm/i915/guc: Enable GuC engine reset
b7f2c290b8da drm/i915/guc: Don't complain about reset races adcd1418b513 drm/i915/guc: Provide mmio list to be saved/restored on engine reset ee41dea700c0 drm/i915/guc: Enable the timer expired interrupt for GuC 5560a36d3f00 drm/i915/guc: Handle engine reset failure notification a921fc062048 drm/i915/guc: Handle context reset notification 345f1eca0a86 drm/i915/guc: Suspend/resume implementation for new interface 17b20c0c8bd7 drm/i915/guc: Add disable interrupts to guc sanitize 848ca056fc3e drm/i915: Reset GPU immediately if submission is disabled 3c79abc34b26 drm/i915/guc: Reset implementation for new GuC interface 7ae740c21ec4 drm/i915/guc: Direct all breadcrumbs for a class to single breadcrumbs 2fca6597dcd8 drm/i915/guc: Disable bonding extension with GuC submission 81e0788642e7 drm/i915: Hold reference to intel_context over life of i915_request 5ca8f1a503a8 drm/i915: Track 'serial' counts for virtual engines 351767d30288 drm/i915/guc: GuC virtual engines
37ebee77b9c2 drm/i915: Add intel_context tracing
4adb7ce61e5f drm/i915/guc: Add several request trace points c84dc5dbebea drm/i915/guc: Update GuC debugfs to support new GuC a03438ead8d3 drm/i915/guc: Update intel_gt_wait_for_idle to work with GuC 588df5bce44c drm/i915/guc: Ensure G2H response has space in buffer 59c796b965e6 drm/i915/guc: Disable semaphores when using GuC scheduling e53180c87b60 drm/i915/guc: Ensure request ordering via completion fences 195129a34fbe drm/i915: Disable preempt busywait when using GuC scheduling e7452c180185 drm/i915/guc: Extend deregistration fence to schedule disable 9e9fc047e7c1 drm/i915/guc: Disable engine barriers with GuC during unpin 53890c0d5072 drm/i915/guc: Defer context unpin until scheduling is disabled 0ddf4a0e5ead drm/i915/guc: Insert fence on context when deregistering b9faec389671 drm/i915/guc: Implement GuC context operations for new inteface 86db42bdbf1a drm/i915/guc: Add bypass tasklet submission path to GuC 0478ac5fcc47 drm/i915/guc: Implement GuC submission tasklet dbd8df00f28f drm/i915/guc: Add lrc descriptor context lookup array 9cc26b390c65 drm/i915/guc: Remove GuC stage descriptor, add lrc descriptor 071d7fa76a91 drm/i915/guc: Add new GuC interface defines and structures 28324246d8aa drm/i915/guc: Module load failure test for CT buffer creation 2c9efd827987 drm/i915/guc: Optimize CTB writes and reads
c0779d6fc3b7 drm/i915/guc: Add stall timer to non blocking CTB send function 3d4dab7e7c81 drm/i915/guc: Add non blocking CTB send function beb15fc92c92 drm/i915/guc: Increase size of CTB buffers
743d703ec315 drm/i915/guc: Improve error message for unsolicited CT response a582e9c666ff drm/i915/guc: Relax CTB response timeout

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20449/index.html

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

#160 lore raw

[Intel-gfx] ✗ Fi.CI.BUILD: failure for GuC submission support (rev2)

In reply to Matthew Brost
== Series Details ==

== Series Details ==

Series: GuC submission support (rev2)
URL : https://patchwork.freedesktop.org/series/91840/
State : failure

== Summary ==

Applying: drm/i915/guc: Relax CTB response timeout
Applying: drm/i915/guc: Improve error message for unsolicited CT response
Applying: drm/i915/guc: Increase size of CTB buffers
Applying: drm/i915/guc: Add non blocking CTB send function
Applying: drm/i915/guc: Add stall timer to non blocking CTB send function
Applying: drm/i915/guc: Optimize CTB writes and reads
Applying: drm/i915/guc: Module load failure test for CT buffer creation
Applying: drm/i915/guc: Add new GuC interface defines and structures
Applying: drm/i915/guc: Remove GuC stage descriptor, add lrc descriptor
Applying: drm/i915/guc: Add lrc descriptor context lookup array
Applying: drm/i915/guc: Implement GuC submission tasklet
Applying: drm/i915/guc: Add bypass tasklet submission path to GuC
Applying: drm/i915/guc: Implement GuC context operations for new inteface
Applying: drm/i915/guc: Insert fence on context when deregistering
Applying: drm/i915/guc: Defer context unpin until scheduling is disabled
Applying: drm/i915/guc: Disable engine barriers with GuC during unpin
Applying: drm/i915/guc: Extend deregistration fence to schedule disable
Applying: drm/i915: Disable preempt busywait when using GuC scheduling
Applying: drm/i915/guc: Ensure request ordering via completion fences Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/i915_request.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/gpu/drm/i915/i915_request.c
CONFLICT (content): Merge conflict in drivers/gpu/drm/i915/i915_request.c
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0019 drm/i915/guc: Ensure request ordering via completion fences When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

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

maintainer
#161 lore raw
In reply to Matthew Brost

Hi Matt & John,

Can you please queue patches with the right Fixes: references to convert all the GuC tracepoints to be protected by the LOW_LEVEL_TRACEPOINTS protection for now. Please do so before next Wednesday so we get it queued in drm-intel-next-fixes.

There's the orthogonal track to discuss what would be the stable set of tracepoints we could expose. However, before that discussion is closed, let's keep a rather strict line to avoid potential maintenance burned.

We can then relax in the future as needed.

Regards, Joonas

Quoting Matthew Brost (2021-06-24 10:04:29)

Quoted 133 lines

As discussed in [1], [2] we are enabling GuC submission support in the i915. This is a subset of the patches in step 5 described in [1], basically it is absolute to enable CI with GuC submission on gen11+ platforms.

This series itself will likely be broken down into smaller patch sets to merge. Likely into CTBs changes, basic submission, virtual engines, and resets.

A following series will address the missing patches remaining from [1].

Locally tested on TGL machine and basic tests seem to be passing.

[1] https://patchwork.freedesktop.org/series/89844/
[2] https://patchwork.freedesktop.org/series/91417/

Daniele Ceraolo Spurio (1):
drm/i915/guc: Unblock GuC submission on Gen11+

John Harrison (10):
drm/i915/guc: Module load failure test for CT buffer creation drm/i915: Track 'serial' counts for virtual engines drm/i915/guc: Provide mmio list to be saved/restored on engine reset drm/i915/guc: Don't complain about reset races drm/i915/guc: Enable GuC engine reset
drm/i915/guc: Fix for error capture after full GPU reset with GuC drm/i915/guc: Hook GuC scheduling policies up drm/i915/guc: Connect reset modparam updates to GuC policy flags drm/i915/guc: Include scheduling policies in the debugfs state dump drm/i915/guc: Add golden context to GuC ADS

Matthew Brost (36):
drm/i915/guc: Relax CTB response timeout
drm/i915/guc: Improve error message for unsolicited CT response drm/i915/guc: Increase size of CTB buffers
drm/i915/guc: Add non blocking CTB send function drm/i915/guc: Add stall timer to non blocking CTB send function drm/i915/guc: Optimize CTB writes and reads
drm/i915/guc: Add new GuC interface defines and structures drm/i915/guc: Remove GuC stage descriptor, add lrc descriptor drm/i915/guc: Add lrc descriptor context lookup array drm/i915/guc: Implement GuC submission tasklet drm/i915/guc: Add bypass tasklet submission path to GuC drm/i915/guc: Implement GuC context operations for new inteface drm/i915/guc: Insert fence on context when deregistering drm/i915/guc: Defer context unpin until scheduling is disabled drm/i915/guc: Disable engine barriers with GuC during unpin drm/i915/guc: Extend deregistration fence to schedule disable drm/i915: Disable preempt busywait when using GuC scheduling drm/i915/guc: Ensure request ordering via completion fences drm/i915/guc: Disable semaphores when using GuC scheduling drm/i915/guc: Ensure G2H response has space in buffer drm/i915/guc: Update intel_gt_wait_for_idle to work with GuC drm/i915/guc: Update GuC debugfs to support new GuC drm/i915/guc: Add several request trace points
drm/i915: Add intel_context tracing
drm/i915/guc: GuC virtual engines
drm/i915: Hold reference to intel_context over life of i915_request drm/i915/guc: Disable bonding extension with GuC submission drm/i915/guc: Direct all breadcrumbs for a class to single breadcrumbs drm/i915/guc: Reset implementation for new GuC interface drm/i915: Reset GPU immediately if submission is disabled drm/i915/guc: Add disable interrupts to guc sanitize drm/i915/guc: Suspend/resume implementation for new interface drm/i915/guc: Handle context reset notification drm/i915/guc: Handle engine reset failure notification drm/i915/guc: Enable the timer expired interrupt for GuC drm/i915/guc: Capture error state on context reset

 drivers/gpu/drm/i915/gem/i915_gem_context.c   |   30 +-
 drivers/gpu/drm/i915/gem/i915_gem_context.h   |    1 +
 drivers/gpu/drm/i915/gem/i915_gem_mman.c      |    3 +-
 drivers/gpu/drm/i915/gt/gen8_engine_cs.c      |    6 +-
 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c   |   41 +-
 drivers/gpu/drm/i915/gt/intel_breadcrumbs.h   |   14 +-
 .../gpu/drm/i915/gt/intel_breadcrumbs_types.h |    7 +
 drivers/gpu/drm/i915/gt/intel_context.c       |   41 +-
 drivers/gpu/drm/i915/gt/intel_context.h       |   31 +-
 drivers/gpu/drm/i915/gt/intel_context_types.h |   49 +
 drivers/gpu/drm/i915/gt/intel_engine.h        |   72 +-
 drivers/gpu/drm/i915/gt/intel_engine_cs.c     |  182 +-
 .../gpu/drm/i915/gt/intel_engine_heartbeat.c  |   71 +-
 .../gpu/drm/i915/gt/intel_engine_heartbeat.h  |    4 +
 drivers/gpu/drm/i915/gt/intel_engine_types.h  |   12 +-
 .../drm/i915/gt/intel_execlists_submission.c  |  234 +-
 .../drm/i915/gt/intel_execlists_submission.h  |   11 -
 drivers/gpu/drm/i915/gt/intel_gt.c            |   21 +
 drivers/gpu/drm/i915/gt/intel_gt.h            |    2 +
 drivers/gpu/drm/i915/gt/intel_gt_pm.c         |    6 +-
 drivers/gpu/drm/i915/gt/intel_gt_requests.c   |   22 +-
 drivers/gpu/drm/i915/gt/intel_gt_requests.h   |    9 +-
 drivers/gpu/drm/i915/gt/intel_lrc_reg.h       |    1 -
 drivers/gpu/drm/i915/gt/intel_reset.c         |   20 +-
 .../gpu/drm/i915/gt/intel_ring_submission.c   |   28 +
 drivers/gpu/drm/i915/gt/intel_rps.c           |    4 +
 drivers/gpu/drm/i915/gt/intel_workarounds.c   |   46 +-
 .../gpu/drm/i915/gt/intel_workarounds_types.h |    1 +
 drivers/gpu/drm/i915/gt/mock_engine.c         |   41 +-
 drivers/gpu/drm/i915/gt/selftest_context.c    |   10 +
 drivers/gpu/drm/i915/gt/selftest_execlists.c  |   20 +-
 .../gpu/drm/i915/gt/uc/abi/guc_actions_abi.h  |   15 +
 drivers/gpu/drm/i915/gt/uc/intel_guc.c        |   82 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  106 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c    |  460 +++-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h    |    3 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |  318 ++-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h     |   22 +-
 .../gpu/drm/i915/gt/uc/intel_guc_debugfs.c    |   25 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h   |   88 +-
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 2197 +++++++++++++++--
 .../gpu/drm/i915/gt/uc/intel_guc_submission.h |   17 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc.c         |  102 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc.h         |   11 +
 drivers/gpu/drm/i915/i915_debugfs.c           |    2 +
 drivers/gpu/drm/i915/i915_debugfs_params.c    |   31 +
 drivers/gpu/drm/i915/i915_gem_evict.c         |    1 +
 drivers/gpu/drm/i915/i915_gpu_error.c         |   25 +-
 drivers/gpu/drm/i915/i915_reg.h               |    2 +
 drivers/gpu/drm/i915/i915_request.c           |  159 +-
 drivers/gpu/drm/i915/i915_request.h           |   21 +
 drivers/gpu/drm/i915/i915_scheduler.c         |    6 +
 drivers/gpu/drm/i915/i915_scheduler.h         |    6 +
 drivers/gpu/drm/i915/i915_scheduler_types.h   |    5 +
 drivers/gpu/drm/i915/i915_trace.h             |  197 +-
 .../gpu/drm/i915/selftests/igt_live_test.c    |    2 +-
 .../gpu/drm/i915/selftests/mock_gem_device.c  |    3 +-
 57 files changed, 4159 insertions(+), 787 deletions(-)
Signature · 1 line
2.28.0
#162 lore raw
Quoted 7 lines · Joonas Lahtinen

Hi Matt & John,

Can you please queue patches with the right Fixes: references to convert all the GuC tracepoints to be protected by the LOW_LEVEL_TRACEPOINTS protection for now. Please do so before next Wednesday so we get it queued in drm-intel-next-fixes.

Don't we already do that? I checked i915_trace.h and every tracepoint I added (intel_context class, i915_request_guc_submit) is protected by LOW_LEVEL_TRACEPOINTS.

The only thing I changed outside of that protection is adding the guc_id field to existing i915_request class tracepoints. Without the guc_id in those tracepoints these are basically useless with GuC submission. We could revert that if it is a huge deal but as I said then they are useless...

Matt

Quoted 142 lines

There's the orthogonal track to discuss what would be the stable set of tracepoints we could expose. However, before that discussion is closed, let's keep a rather strict line to avoid potential maintenance burned.

We can then relax in the future as needed.

Regards, Joonas

Quoting Matthew Brost (2021-06-24 10:04:29)

Quoted 133 lines

As discussed in [1], [2] we are enabling GuC submission support in the i915. This is a subset of the patches in step 5 described in [1], basically it is absolute to enable CI with GuC submission on gen11+ platforms.

This series itself will likely be broken down into smaller patch sets to merge. Likely into CTBs changes, basic submission, virtual engines, and resets.

A following series will address the missing patches remaining from [1].

Locally tested on TGL machine and basic tests seem to be passing.

[1] https://patchwork.freedesktop.org/series/89844/
[2] https://patchwork.freedesktop.org/series/91417/

Daniele Ceraolo Spurio (1):
drm/i915/guc: Unblock GuC submission on Gen11+

John Harrison (10):
drm/i915/guc: Module load failure test for CT buffer creation drm/i915: Track 'serial' counts for virtual engines drm/i915/guc: Provide mmio list to be saved/restored on engine reset drm/i915/guc: Don't complain about reset races drm/i915/guc: Enable GuC engine reset
drm/i915/guc: Fix for error capture after full GPU reset with GuC drm/i915/guc: Hook GuC scheduling policies up drm/i915/guc: Connect reset modparam updates to GuC policy flags drm/i915/guc: Include scheduling policies in the debugfs state dump drm/i915/guc: Add golden context to GuC ADS

Matthew Brost (36):
drm/i915/guc: Relax CTB response timeout
drm/i915/guc: Improve error message for unsolicited CT response drm/i915/guc: Increase size of CTB buffers
drm/i915/guc: Add non blocking CTB send function drm/i915/guc: Add stall timer to non blocking CTB send function drm/i915/guc: Optimize CTB writes and reads
drm/i915/guc: Add new GuC interface defines and structures drm/i915/guc: Remove GuC stage descriptor, add lrc descriptor drm/i915/guc: Add lrc descriptor context lookup array drm/i915/guc: Implement GuC submission tasklet drm/i915/guc: Add bypass tasklet submission path to GuC drm/i915/guc: Implement GuC context operations for new inteface drm/i915/guc: Insert fence on context when deregistering drm/i915/guc: Defer context unpin until scheduling is disabled drm/i915/guc: Disable engine barriers with GuC during unpin drm/i915/guc: Extend deregistration fence to schedule disable drm/i915: Disable preempt busywait when using GuC scheduling drm/i915/guc: Ensure request ordering via completion fences drm/i915/guc: Disable semaphores when using GuC scheduling drm/i915/guc: Ensure G2H response has space in buffer drm/i915/guc: Update intel_gt_wait_for_idle to work with GuC drm/i915/guc: Update GuC debugfs to support new GuC drm/i915/guc: Add several request trace points
drm/i915: Add intel_context tracing
drm/i915/guc: GuC virtual engines
drm/i915: Hold reference to intel_context over life of i915_request drm/i915/guc: Disable bonding extension with GuC submission drm/i915/guc: Direct all breadcrumbs for a class to single breadcrumbs drm/i915/guc: Reset implementation for new GuC interface drm/i915: Reset GPU immediately if submission is disabled drm/i915/guc: Add disable interrupts to guc sanitize drm/i915/guc: Suspend/resume implementation for new interface drm/i915/guc: Handle context reset notification drm/i915/guc: Handle engine reset failure notification drm/i915/guc: Enable the timer expired interrupt for GuC drm/i915/guc: Capture error state on context reset

 drivers/gpu/drm/i915/gem/i915_gem_context.c   |   30 +-
 drivers/gpu/drm/i915/gem/i915_gem_context.h   |    1 +
 drivers/gpu/drm/i915/gem/i915_gem_mman.c      |    3 +-
 drivers/gpu/drm/i915/gt/gen8_engine_cs.c      |    6 +-
 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c   |   41 +-
 drivers/gpu/drm/i915/gt/intel_breadcrumbs.h   |   14 +-
 .../gpu/drm/i915/gt/intel_breadcrumbs_types.h |    7 +
 drivers/gpu/drm/i915/gt/intel_context.c       |   41 +-
 drivers/gpu/drm/i915/gt/intel_context.h       |   31 +-
 drivers/gpu/drm/i915/gt/intel_context_types.h |   49 +
 drivers/gpu/drm/i915/gt/intel_engine.h        |   72 +-
 drivers/gpu/drm/i915/gt/intel_engine_cs.c     |  182 +-
 .../gpu/drm/i915/gt/intel_engine_heartbeat.c  |   71 +-
 .../gpu/drm/i915/gt/intel_engine_heartbeat.h  |    4 +
 drivers/gpu/drm/i915/gt/intel_engine_types.h  |   12 +-
 .../drm/i915/gt/intel_execlists_submission.c  |  234 +-
 .../drm/i915/gt/intel_execlists_submission.h  |   11 -
 drivers/gpu/drm/i915/gt/intel_gt.c            |   21 +
 drivers/gpu/drm/i915/gt/intel_gt.h            |    2 +
 drivers/gpu/drm/i915/gt/intel_gt_pm.c         |    6 +-
 drivers/gpu/drm/i915/gt/intel_gt_requests.c   |   22 +-
 drivers/gpu/drm/i915/gt/intel_gt_requests.h   |    9 +-
 drivers/gpu/drm/i915/gt/intel_lrc_reg.h       |    1 -
 drivers/gpu/drm/i915/gt/intel_reset.c         |   20 +-
 .../gpu/drm/i915/gt/intel_ring_submission.c   |   28 +
 drivers/gpu/drm/i915/gt/intel_rps.c           |    4 +
 drivers/gpu/drm/i915/gt/intel_workarounds.c   |   46 +-
 .../gpu/drm/i915/gt/intel_workarounds_types.h |    1 +
 drivers/gpu/drm/i915/gt/mock_engine.c         |   41 +-
 drivers/gpu/drm/i915/gt/selftest_context.c    |   10 +
 drivers/gpu/drm/i915/gt/selftest_execlists.c  |   20 +-
 .../gpu/drm/i915/gt/uc/abi/guc_actions_abi.h  |   15 +
 drivers/gpu/drm/i915/gt/uc/intel_guc.c        |   82 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  106 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c    |  460 +++-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h    |    3 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |  318 ++-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h     |   22 +-
 .../gpu/drm/i915/gt/uc/intel_guc_debugfs.c    |   25 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h   |   88 +-
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 2197 +++++++++++++++--
 .../gpu/drm/i915/gt/uc/intel_guc_submission.h |   17 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc.c         |  102 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc.h         |   11 +
 drivers/gpu/drm/i915/i915_debugfs.c           |    2 +
 drivers/gpu/drm/i915/i915_debugfs_params.c    |   31 +
 drivers/gpu/drm/i915/i915_gem_evict.c         |    1 +
 drivers/gpu/drm/i915/i915_gpu_error.c         |   25 +-
 drivers/gpu/drm/i915/i915_reg.h               |    2 +
 drivers/gpu/drm/i915/i915_request.c           |  159 +-
 drivers/gpu/drm/i915/i915_request.h           |   21 +
 drivers/gpu/drm/i915/i915_scheduler.c         |    6 +
 drivers/gpu/drm/i915/i915_scheduler.h         |    6 +
 drivers/gpu/drm/i915/i915_scheduler_types.h   |    5 +
 drivers/gpu/drm/i915/i915_trace.h             |  197 +-
 .../gpu/drm/i915/selftests/igt_live_test.c    |    2 +-
 .../gpu/drm/i915/selftests/mock_gem_device.c  |    3 +-
 57 files changed, 4159 insertions(+), 787 deletions(-)
Signature · 1 line
2.28.0
maintainer
#163 lore raw

Quoting Matthew Brost (2021-10-22 19:42:19)

Quoted 9 lines · Joonas Lahtinen
Quoted 7 lines

Hi Matt & John,

Can you please queue patches with the right Fixes: references to convert all the GuC tracepoints to be protected by the LOW_LEVEL_TRACEPOINTS protection for now. Please do so before next Wednesday so we get it queued in drm-intel-next-fixes.

Quoted 6 lines

Don't we already do that? I checked i915_trace.h and every tracepoint I added (intel_context class, i915_request_guc_submit) is protected by LOW_LEVEL_TRACEPOINTS.

The only thing I changed outside of that protection is adding the guc_id field to existing i915_request class tracepoints.

It's the first search hit for "guc" inside the i915_trace.h file :)

Quoted 4 lines

Without the guc_id in
those tracepoints these are basically useless with GuC submission. We could revert that if it is a huge deal but as I said then they are useless...

Let's eliminate it for now and restore the tracepoint exactly as it was.

If there is an immediate need, we should instead have an auxilary tracepoint which is enabled only through LOW_LEVEL_TRACEPOINTS and that amends the information of the basic tracepoint.

For the longer term solution we should align towards the dma fence tracepoints. When those are combined with the OA information, one should be able to get a good understanding of both the software and hardware scheduling decisions.

Regards, Joonas

Quoted 145 lines

Matt

Quoted 142 lines

There's the orthogonal track to discuss what would be the stable set of tracepoints we could expose. However, before that discussion is closed, let's keep a rather strict line to avoid potential maintenance burned.

We can then relax in the future as needed.

Regards, Joonas

Quoting Matthew Brost (2021-06-24 10:04:29)

Quoted 133 lines

As discussed in [1], [2] we are enabling GuC submission support in the i915. This is a subset of the patches in step 5 described in [1], basically it is absolute to enable CI with GuC submission on gen11+ platforms.

This series itself will likely be broken down into smaller patch sets to merge. Likely into CTBs changes, basic submission, virtual engines, and resets.

A following series will address the missing patches remaining from [1].

Locally tested on TGL machine and basic tests seem to be passing.

[1] https://patchwork.freedesktop.org/series/89844/
[2] https://patchwork.freedesktop.org/series/91417/

Daniele Ceraolo Spurio (1):
drm/i915/guc: Unblock GuC submission on Gen11+

John Harrison (10):
drm/i915/guc: Module load failure test for CT buffer creation drm/i915: Track 'serial' counts for virtual engines drm/i915/guc: Provide mmio list to be saved/restored on engine reset drm/i915/guc: Don't complain about reset races drm/i915/guc: Enable GuC engine reset
drm/i915/guc: Fix for error capture after full GPU reset with GuC drm/i915/guc: Hook GuC scheduling policies up drm/i915/guc: Connect reset modparam updates to GuC policy flags drm/i915/guc: Include scheduling policies in the debugfs state dump drm/i915/guc: Add golden context to GuC ADS

Matthew Brost (36):
drm/i915/guc: Relax CTB response timeout
drm/i915/guc: Improve error message for unsolicited CT response drm/i915/guc: Increase size of CTB buffers
drm/i915/guc: Add non blocking CTB send function drm/i915/guc: Add stall timer to non blocking CTB send function drm/i915/guc: Optimize CTB writes and reads
drm/i915/guc: Add new GuC interface defines and structures drm/i915/guc: Remove GuC stage descriptor, add lrc descriptor drm/i915/guc: Add lrc descriptor context lookup array drm/i915/guc: Implement GuC submission tasklet drm/i915/guc: Add bypass tasklet submission path to GuC drm/i915/guc: Implement GuC context operations for new inteface drm/i915/guc: Insert fence on context when deregistering drm/i915/guc: Defer context unpin until scheduling is disabled drm/i915/guc: Disable engine barriers with GuC during unpin drm/i915/guc: Extend deregistration fence to schedule disable drm/i915: Disable preempt busywait when using GuC scheduling drm/i915/guc: Ensure request ordering via completion fences drm/i915/guc: Disable semaphores when using GuC scheduling drm/i915/guc: Ensure G2H response has space in buffer drm/i915/guc: Update intel_gt_wait_for_idle to work with GuC drm/i915/guc: Update GuC debugfs to support new GuC drm/i915/guc: Add several request trace points
drm/i915: Add intel_context tracing
drm/i915/guc: GuC virtual engines
drm/i915: Hold reference to intel_context over life of i915_request drm/i915/guc: Disable bonding extension with GuC submission drm/i915/guc: Direct all breadcrumbs for a class to single breadcrumbs drm/i915/guc: Reset implementation for new GuC interface drm/i915: Reset GPU immediately if submission is disabled drm/i915/guc: Add disable interrupts to guc sanitize drm/i915/guc: Suspend/resume implementation for new interface drm/i915/guc: Handle context reset notification drm/i915/guc: Handle engine reset failure notification drm/i915/guc: Enable the timer expired interrupt for GuC drm/i915/guc: Capture error state on context reset

 drivers/gpu/drm/i915/gem/i915_gem_context.c   |   30 +-
 drivers/gpu/drm/i915/gem/i915_gem_context.h   |    1 +
 drivers/gpu/drm/i915/gem/i915_gem_mman.c      |    3 +-
 drivers/gpu/drm/i915/gt/gen8_engine_cs.c      |    6 +-
 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c   |   41 +-
 drivers/gpu/drm/i915/gt/intel_breadcrumbs.h   |   14 +-
 .../gpu/drm/i915/gt/intel_breadcrumbs_types.h |    7 +
 drivers/gpu/drm/i915/gt/intel_context.c       |   41 +-
 drivers/gpu/drm/i915/gt/intel_context.h       |   31 +-
 drivers/gpu/drm/i915/gt/intel_context_types.h |   49 +
 drivers/gpu/drm/i915/gt/intel_engine.h        |   72 +-
 drivers/gpu/drm/i915/gt/intel_engine_cs.c     |  182 +-
 .../gpu/drm/i915/gt/intel_engine_heartbeat.c  |   71 +-
 .../gpu/drm/i915/gt/intel_engine_heartbeat.h  |    4 +
 drivers/gpu/drm/i915/gt/intel_engine_types.h  |   12 +-
 .../drm/i915/gt/intel_execlists_submission.c  |  234 +-
 .../drm/i915/gt/intel_execlists_submission.h  |   11 -
 drivers/gpu/drm/i915/gt/intel_gt.c            |   21 +
 drivers/gpu/drm/i915/gt/intel_gt.h            |    2 +
 drivers/gpu/drm/i915/gt/intel_gt_pm.c         |    6 +-
 drivers/gpu/drm/i915/gt/intel_gt_requests.c   |   22 +-
 drivers/gpu/drm/i915/gt/intel_gt_requests.h   |    9 +-
 drivers/gpu/drm/i915/gt/intel_lrc_reg.h       |    1 -
 drivers/gpu/drm/i915/gt/intel_reset.c         |   20 +-
 .../gpu/drm/i915/gt/intel_ring_submission.c   |   28 +
 drivers/gpu/drm/i915/gt/intel_rps.c           |    4 +
 drivers/gpu/drm/i915/gt/intel_workarounds.c   |   46 +-
 .../gpu/drm/i915/gt/intel_workarounds_types.h |    1 +
 drivers/gpu/drm/i915/gt/mock_engine.c         |   41 +-
 drivers/gpu/drm/i915/gt/selftest_context.c    |   10 +
 drivers/gpu/drm/i915/gt/selftest_execlists.c  |   20 +-
 .../gpu/drm/i915/gt/uc/abi/guc_actions_abi.h  |   15 +
 drivers/gpu/drm/i915/gt/uc/intel_guc.c        |   82 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  106 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c    |  460 +++-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h    |    3 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |  318 ++-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h     |   22 +-
 .../gpu/drm/i915/gt/uc/intel_guc_debugfs.c    |   25 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h   |   88 +-
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 2197 +++++++++++++++--
 .../gpu/drm/i915/gt/uc/intel_guc_submission.h |   17 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc.c         |  102 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc.h         |   11 +
 drivers/gpu/drm/i915/i915_debugfs.c           |    2 +
 drivers/gpu/drm/i915/i915_debugfs_params.c    |   31 +
 drivers/gpu/drm/i915/i915_gem_evict.c         |    1 +
 drivers/gpu/drm/i915/i915_gpu_error.c         |   25 +-
 drivers/gpu/drm/i915/i915_reg.h               |    2 +
 drivers/gpu/drm/i915/i915_request.c           |  159 +-
 drivers/gpu/drm/i915/i915_request.h           |   21 +
 drivers/gpu/drm/i915/i915_scheduler.c         |    6 +
 drivers/gpu/drm/i915/i915_scheduler.h         |    6 +
 drivers/gpu/drm/i915/i915_scheduler_types.h   |    5 +
 drivers/gpu/drm/i915/i915_trace.h             |  197 +-
 .../gpu/drm/i915/selftests/igt_live_test.c    |    2 +-
 .../gpu/drm/i915/selftests/mock_gem_device.c  |    3 +-
 57 files changed, 4159 insertions(+), 787 deletions(-)
Signature · 1 line
2.28.0
#164 lore raw
Quoted 17 lines · Joonas Lahtinen

Quoting Matthew Brost (2021-10-22 19:42:19)

Quoted 9 lines · Joonas Lahtinen
Quoted 7 lines

Hi Matt & John,

Can you please queue patches with the right Fixes: references to convert all the GuC tracepoints to be protected by the LOW_LEVEL_TRACEPOINTS protection for now. Please do so before next Wednesday so we get it queued in drm-intel-next-fixes.

Quoted 6 lines

Don't we already do that? I checked i915_trace.h and every tracepoint I added (intel_context class, i915_request_guc_submit) is protected by LOW_LEVEL_TRACEPOINTS.

The only thing I changed outside of that protection is adding the guc_id field to existing i915_request class tracepoints.

Quoted 9 lines

It's the first search hit for "guc" inside the i915_trace.h file :)

Quoted 4 lines

Without the guc_id in
those tracepoints these are basically useless with GuC submission. We could revert that if it is a huge deal but as I said then they are useless...

Let's eliminate it for now and restore the tracepoint exactly as it was.

Don't really agree - let's render tracepoints to be useless? Are tracepoints ABI? I googled this and couldn't really find a definie answer. If tracepoints are ABI, then OK I can revert this change but still this is a poor technical decision (tracepoints should not be ABI).

Quoted 4 lines

If there is an immediate need, we should instead have an auxilary tracepoint which is enabled only through LOW_LEVEL_TRACEPOINTS and that amends the information of the basic tracepoint.

Regardless of what I said above, I'll post 2 patches. The 1st just remove the GuC, the 2nd modify the tracepoint to include guc_id if LOW_LEVEL_TRACEPOINTS is defined.

Quoted 5 lines

For the longer term solution we should align towards the dma fence tracepoints. When those are combined with the OA information, one should be able to get a good understanding of both the software and hardware scheduling decisions.

Not sure about this either. I use these tracepoins to correlate things to the GuC log. Between the 2, if you know what you are doing you basically can figure out everything that is happening. Fields in the trace translate directly to fields in the GuC log. Some of these fields are backend specific, not sure how these could be pushed the dma fence tracepoints. For what it is worth, without these tracepoints we'd likely still have a bunch of bugs in the GuC firmware. I understand these points, several other i915 developers do, and several of the GuC firmware developers do too.

Matt

Quoted 147 lines

Regards, Joonas

Quoted 145 lines

Matt

Quoted 142 lines

There's the orthogonal track to discuss what would be the stable set of tracepoints we could expose. However, before that discussion is closed, let's keep a rather strict line to avoid potential maintenance burned.

We can then relax in the future as needed.

Regards, Joonas

Quoting Matthew Brost (2021-06-24 10:04:29)

Quoted 133 lines

As discussed in [1], [2] we are enabling GuC submission support in the i915. This is a subset of the patches in step 5 described in [1], basically it is absolute to enable CI with GuC submission on gen11+ platforms.

This series itself will likely be broken down into smaller patch sets to merge. Likely into CTBs changes, basic submission, virtual engines, and resets.

A following series will address the missing patches remaining from [1].

Locally tested on TGL machine and basic tests seem to be passing.

[1] https://patchwork.freedesktop.org/series/89844/
[2] https://patchwork.freedesktop.org/series/91417/

Daniele Ceraolo Spurio (1):
drm/i915/guc: Unblock GuC submission on Gen11+

John Harrison (10):
drm/i915/guc: Module load failure test for CT buffer creation drm/i915: Track 'serial' counts for virtual engines drm/i915/guc: Provide mmio list to be saved/restored on engine reset drm/i915/guc: Don't complain about reset races drm/i915/guc: Enable GuC engine reset
drm/i915/guc: Fix for error capture after full GPU reset with GuC drm/i915/guc: Hook GuC scheduling policies up drm/i915/guc: Connect reset modparam updates to GuC policy flags drm/i915/guc: Include scheduling policies in the debugfs state dump drm/i915/guc: Add golden context to GuC ADS

Matthew Brost (36):
drm/i915/guc: Relax CTB response timeout
drm/i915/guc: Improve error message for unsolicited CT response drm/i915/guc: Increase size of CTB buffers
drm/i915/guc: Add non blocking CTB send function drm/i915/guc: Add stall timer to non blocking CTB send function drm/i915/guc: Optimize CTB writes and reads
drm/i915/guc: Add new GuC interface defines and structures drm/i915/guc: Remove GuC stage descriptor, add lrc descriptor drm/i915/guc: Add lrc descriptor context lookup array drm/i915/guc: Implement GuC submission tasklet drm/i915/guc: Add bypass tasklet submission path to GuC drm/i915/guc: Implement GuC context operations for new inteface drm/i915/guc: Insert fence on context when deregistering drm/i915/guc: Defer context unpin until scheduling is disabled drm/i915/guc: Disable engine barriers with GuC during unpin drm/i915/guc: Extend deregistration fence to schedule disable drm/i915: Disable preempt busywait when using GuC scheduling drm/i915/guc: Ensure request ordering via completion fences drm/i915/guc: Disable semaphores when using GuC scheduling drm/i915/guc: Ensure G2H response has space in buffer drm/i915/guc: Update intel_gt_wait_for_idle to work with GuC drm/i915/guc: Update GuC debugfs to support new GuC drm/i915/guc: Add several request trace points
drm/i915: Add intel_context tracing
drm/i915/guc: GuC virtual engines
drm/i915: Hold reference to intel_context over life of i915_request drm/i915/guc: Disable bonding extension with GuC submission drm/i915/guc: Direct all breadcrumbs for a class to single breadcrumbs drm/i915/guc: Reset implementation for new GuC interface drm/i915: Reset GPU immediately if submission is disabled drm/i915/guc: Add disable interrupts to guc sanitize drm/i915/guc: Suspend/resume implementation for new interface drm/i915/guc: Handle context reset notification drm/i915/guc: Handle engine reset failure notification drm/i915/guc: Enable the timer expired interrupt for GuC drm/i915/guc: Capture error state on context reset

 drivers/gpu/drm/i915/gem/i915_gem_context.c   |   30 +-
 drivers/gpu/drm/i915/gem/i915_gem_context.h   |    1 +
 drivers/gpu/drm/i915/gem/i915_gem_mman.c      |    3 +-
 drivers/gpu/drm/i915/gt/gen8_engine_cs.c      |    6 +-
 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c   |   41 +-
 drivers/gpu/drm/i915/gt/intel_breadcrumbs.h   |   14 +-
 .../gpu/drm/i915/gt/intel_breadcrumbs_types.h |    7 +
 drivers/gpu/drm/i915/gt/intel_context.c       |   41 +-
 drivers/gpu/drm/i915/gt/intel_context.h       |   31 +-
 drivers/gpu/drm/i915/gt/intel_context_types.h |   49 +
 drivers/gpu/drm/i915/gt/intel_engine.h        |   72 +-
 drivers/gpu/drm/i915/gt/intel_engine_cs.c     |  182 +-
 .../gpu/drm/i915/gt/intel_engine_heartbeat.c  |   71 +-
 .../gpu/drm/i915/gt/intel_engine_heartbeat.h  |    4 +
 drivers/gpu/drm/i915/gt/intel_engine_types.h  |   12 +-
 .../drm/i915/gt/intel_execlists_submission.c  |  234 +-
 .../drm/i915/gt/intel_execlists_submission.h  |   11 -
 drivers/gpu/drm/i915/gt/intel_gt.c            |   21 +
 drivers/gpu/drm/i915/gt/intel_gt.h            |    2 +
 drivers/gpu/drm/i915/gt/intel_gt_pm.c         |    6 +-
 drivers/gpu/drm/i915/gt/intel_gt_requests.c   |   22 +-
 drivers/gpu/drm/i915/gt/intel_gt_requests.h   |    9 +-
 drivers/gpu/drm/i915/gt/intel_lrc_reg.h       |    1 -
 drivers/gpu/drm/i915/gt/intel_reset.c         |   20 +-
 .../gpu/drm/i915/gt/intel_ring_submission.c   |   28 +
 drivers/gpu/drm/i915/gt/intel_rps.c           |    4 +
 drivers/gpu/drm/i915/gt/intel_workarounds.c   |   46 +-
 .../gpu/drm/i915/gt/intel_workarounds_types.h |    1 +
 drivers/gpu/drm/i915/gt/mock_engine.c         |   41 +-
 drivers/gpu/drm/i915/gt/selftest_context.c    |   10 +
 drivers/gpu/drm/i915/gt/selftest_execlists.c  |   20 +-
 .../gpu/drm/i915/gt/uc/abi/guc_actions_abi.h  |   15 +
 drivers/gpu/drm/i915/gt/uc/intel_guc.c        |   82 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  106 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c    |  460 +++-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h    |    3 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |  318 ++-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h     |   22 +-
 .../gpu/drm/i915/gt/uc/intel_guc_debugfs.c    |   25 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h   |   88 +-
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 2197 +++++++++++++++--
 .../gpu/drm/i915/gt/uc/intel_guc_submission.h |   17 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc.c         |  102 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc.h         |   11 +
 drivers/gpu/drm/i915/i915_debugfs.c           |    2 +
 drivers/gpu/drm/i915/i915_debugfs_params.c    |   31 +
 drivers/gpu/drm/i915/i915_gem_evict.c         |    1 +
 drivers/gpu/drm/i915/i915_gpu_error.c         |   25 +-
 drivers/gpu/drm/i915/i915_reg.h               |    2 +
 drivers/gpu/drm/i915/i915_request.c           |  159 +-
 drivers/gpu/drm/i915/i915_request.h           |   21 +
 drivers/gpu/drm/i915/i915_scheduler.c         |    6 +
 drivers/gpu/drm/i915/i915_scheduler.h         |    6 +
 drivers/gpu/drm/i915/i915_scheduler_types.h   |    5 +
 drivers/gpu/drm/i915/i915_trace.h             |  197 +-
 .../gpu/drm/i915/selftests/igt_live_test.c    |    2 +-
 .../gpu/drm/i915/selftests/mock_gem_device.c  |    3 +-
 57 files changed, 4159 insertions(+), 787 deletions(-)
Signature · 1 line
2.28.0
maintainer
#165 lore raw

Quoting Matthew Brost (2021-10-25 18:15:09)

Quoted 25 lines · Joonas Lahtinen
Quoted 24 lines

Quoting Matthew Brost (2021-10-22 19:42:19)

Quoted 9 lines · Joonas Lahtinen
Quoted 7 lines

Hi Matt & John,

Can you please queue patches with the right Fixes: references to convert all the GuC tracepoints to be protected by the LOW_LEVEL_TRACEPOINTS protection for now. Please do so before next Wednesday so we get it queued in drm-intel-next-fixes.

Quoted 6 lines

Don't we already do that? I checked i915_trace.h and every tracepoint I added (intel_context class, i915_request_guc_submit) is protected by LOW_LEVEL_TRACEPOINTS.

The only thing I changed outside of that protection is adding the guc_id field to existing i915_request class tracepoints.

It's the first search hit for "guc" inside the i915_trace.h file :)

Quoted 4 lines

Without the guc_id in
those tracepoints these are basically useless with GuC submission. We could revert that if it is a huge deal but as I said then they are useless...

Quoted 7 lines
Quoted 2 lines

Let's eliminate it for now and restore the tracepoint exactly as it was.

Don't really agree - let's render tracepoints to be useless? Are tracepoints ABI? I googled this and couldn't really find a definie answer. If tracepoints are ABI, then OK I can revert this change but still this is a poor technical decision (tracepoints should not be ABI).

Thats a very heated discussion in general. But the fact is that if tracepoint changes have caused regressions to applications, they have been forced to be remain untouched. You are free to raise the discussion with Linus/LKML if you feel that should not be the case. So the end result is that tracepoints are effectively in limbo, not ABI unless some application uses them like ABI.

Feel free to search the intel-gfx/lkml for "tracepoints" keyword and look for threads with many replies. It's not that I would not agree, it's more that I'm not in the mood for repeating that discussion over and over again and always land in the same spot.

So for now, we don't add anything new to tracepoints we can't guarantee to always be there untouched. Similarly, we don't guarantee any of them to remain stable. So we try to be compatible with the limbo.

I'm long overdue waiting for some stable consumer to step up for the tracepoints, so we can then start discussion what would actually be the best way of getting that information out for them. In ~5 years that has not happened.

Quoted 8 lines
Quoted 4 lines

If there is an immediate need, we should instead have an auxilary tracepoint which is enabled only through LOW_LEVEL_TRACEPOINTS and that amends the information of the basic tracepoint.

Regardless of what I said above, I'll post 2 patches. The 1st just remove the GuC, the 2nd modify the tracepoint to include guc_id if LOW_LEVEL_TRACEPOINTS is defined.

Thanks. Let's get a patch merged which simply drops the guc_id for now to unblock things.

For the second, an auxilary tracepoint will be preferred instead of mutating the existing one (regardless of the LOW_LEVEL_TRACEPOINTS).

I only noticed a patch that mutates the tracepoints, can you double-check sending the first patch?

Regards, Joonas

Quoted 166 lines
Quoted 6 lines

For the longer term solution we should align towards the dma fence tracepoints. When those are combined with the OA information, one should be able to get a good understanding of both the software and hardware scheduling decisions.

Not sure about this either. I use these tracepoins to correlate things to the GuC log. Between the 2, if you know what you are doing you basically can figure out everything that is happening. Fields in the trace translate directly to fields in the GuC log. Some of these fields are backend specific, not sure how these could be pushed the dma fence tracepoints. For what it is worth, without these tracepoints we'd likely still have a bunch of bugs in the GuC firmware. I understand these points, several other i915 developers do, and several of the GuC firmware developers do too.

Matt

Quoted 147 lines

Regards, Joonas

Quoted 145 lines

Matt

Quoted 142 lines

There's the orthogonal track to discuss what would be the stable set of tracepoints we could expose. However, before that discussion is closed, let's keep a rather strict line to avoid potential maintenance burned.

We can then relax in the future as needed.

Regards, Joonas

Quoting Matthew Brost (2021-06-24 10:04:29)

Quoted 133 lines

As discussed in [1], [2] we are enabling GuC submission support in the i915. This is a subset of the patches in step 5 described in [1], basically it is absolute to enable CI with GuC submission on gen11+ platforms.

This series itself will likely be broken down into smaller patch sets to merge. Likely into CTBs changes, basic submission, virtual engines, and resets.

A following series will address the missing patches remaining from [1].

Locally tested on TGL machine and basic tests seem to be passing.

[1] https://patchwork.freedesktop.org/series/89844/
[2] https://patchwork.freedesktop.org/series/91417/

Daniele Ceraolo Spurio (1):
drm/i915/guc: Unblock GuC submission on Gen11+

John Harrison (10):
drm/i915/guc: Module load failure test for CT buffer creation drm/i915: Track 'serial' counts for virtual engines drm/i915/guc: Provide mmio list to be saved/restored on engine reset drm/i915/guc: Don't complain about reset races drm/i915/guc: Enable GuC engine reset
drm/i915/guc: Fix for error capture after full GPU reset with GuC drm/i915/guc: Hook GuC scheduling policies up drm/i915/guc: Connect reset modparam updates to GuC policy flags drm/i915/guc: Include scheduling policies in the debugfs state dump drm/i915/guc: Add golden context to GuC ADS

Matthew Brost (36):
drm/i915/guc: Relax CTB response timeout
drm/i915/guc: Improve error message for unsolicited CT response drm/i915/guc: Increase size of CTB buffers
drm/i915/guc: Add non blocking CTB send function drm/i915/guc: Add stall timer to non blocking CTB send function drm/i915/guc: Optimize CTB writes and reads
drm/i915/guc: Add new GuC interface defines and structures drm/i915/guc: Remove GuC stage descriptor, add lrc descriptor drm/i915/guc: Add lrc descriptor context lookup array drm/i915/guc: Implement GuC submission tasklet drm/i915/guc: Add bypass tasklet submission path to GuC drm/i915/guc: Implement GuC context operations for new inteface drm/i915/guc: Insert fence on context when deregistering drm/i915/guc: Defer context unpin until scheduling is disabled drm/i915/guc: Disable engine barriers with GuC during unpin drm/i915/guc: Extend deregistration fence to schedule disable drm/i915: Disable preempt busywait when using GuC scheduling drm/i915/guc: Ensure request ordering via completion fences drm/i915/guc: Disable semaphores when using GuC scheduling drm/i915/guc: Ensure G2H response has space in buffer drm/i915/guc: Update intel_gt_wait_for_idle to work with GuC drm/i915/guc: Update GuC debugfs to support new GuC drm/i915/guc: Add several request trace points
drm/i915: Add intel_context tracing
drm/i915/guc: GuC virtual engines
drm/i915: Hold reference to intel_context over life of i915_request drm/i915/guc: Disable bonding extension with GuC submission drm/i915/guc: Direct all breadcrumbs for a class to single breadcrumbs drm/i915/guc: Reset implementation for new GuC interface drm/i915: Reset GPU immediately if submission is disabled drm/i915/guc: Add disable interrupts to guc sanitize drm/i915/guc: Suspend/resume implementation for new interface drm/i915/guc: Handle context reset notification drm/i915/guc: Handle engine reset failure notification drm/i915/guc: Enable the timer expired interrupt for GuC drm/i915/guc: Capture error state on context reset

 drivers/gpu/drm/i915/gem/i915_gem_context.c   |   30 +-
 drivers/gpu/drm/i915/gem/i915_gem_context.h   |    1 +
 drivers/gpu/drm/i915/gem/i915_gem_mman.c      |    3 +-
 drivers/gpu/drm/i915/gt/gen8_engine_cs.c      |    6 +-
 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c   |   41 +-
 drivers/gpu/drm/i915/gt/intel_breadcrumbs.h   |   14 +-
 .../gpu/drm/i915/gt/intel_breadcrumbs_types.h |    7 +
 drivers/gpu/drm/i915/gt/intel_context.c       |   41 +-
 drivers/gpu/drm/i915/gt/intel_context.h       |   31 +-
 drivers/gpu/drm/i915/gt/intel_context_types.h |   49 +
 drivers/gpu/drm/i915/gt/intel_engine.h        |   72 +-
 drivers/gpu/drm/i915/gt/intel_engine_cs.c     |  182 +-
 .../gpu/drm/i915/gt/intel_engine_heartbeat.c  |   71 +-
 .../gpu/drm/i915/gt/intel_engine_heartbeat.h  |    4 +
 drivers/gpu/drm/i915/gt/intel_engine_types.h  |   12 +-
 .../drm/i915/gt/intel_execlists_submission.c  |  234 +-
 .../drm/i915/gt/intel_execlists_submission.h  |   11 -
 drivers/gpu/drm/i915/gt/intel_gt.c            |   21 +
 drivers/gpu/drm/i915/gt/intel_gt.h            |    2 +
 drivers/gpu/drm/i915/gt/intel_gt_pm.c         |    6 +-
 drivers/gpu/drm/i915/gt/intel_gt_requests.c   |   22 +-
 drivers/gpu/drm/i915/gt/intel_gt_requests.h   |    9 +-
 drivers/gpu/drm/i915/gt/intel_lrc_reg.h       |    1 -
 drivers/gpu/drm/i915/gt/intel_reset.c         |   20 +-
 .../gpu/drm/i915/gt/intel_ring_submission.c   |   28 +
 drivers/gpu/drm/i915/gt/intel_rps.c           |    4 +
 drivers/gpu/drm/i915/gt/intel_workarounds.c   |   46 +-
 .../gpu/drm/i915/gt/intel_workarounds_types.h |    1 +
 drivers/gpu/drm/i915/gt/mock_engine.c         |   41 +-
 drivers/gpu/drm/i915/gt/selftest_context.c    |   10 +
 drivers/gpu/drm/i915/gt/selftest_execlists.c  |   20 +-
 .../gpu/drm/i915/gt/uc/abi/guc_actions_abi.h  |   15 +
 drivers/gpu/drm/i915/gt/uc/intel_guc.c        |   82 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  106 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c    |  460 +++-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h    |    3 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |  318 ++-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h     |   22 +-
 .../gpu/drm/i915/gt/uc/intel_guc_debugfs.c    |   25 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h   |   88 +-
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 2197 +++++++++++++++--
 .../gpu/drm/i915/gt/uc/intel_guc_submission.h |   17 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc.c         |  102 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc.h         |   11 +
 drivers/gpu/drm/i915/i915_debugfs.c           |    2 +
 drivers/gpu/drm/i915/i915_debugfs_params.c    |   31 +
 drivers/gpu/drm/i915/i915_gem_evict.c         |    1 +
 drivers/gpu/drm/i915/i915_gpu_error.c         |   25 +-
 drivers/gpu/drm/i915/i915_reg.h               |    2 +
 drivers/gpu/drm/i915/i915_request.c           |  159 +-
 drivers/gpu/drm/i915/i915_request.h           |   21 +
 drivers/gpu/drm/i915/i915_scheduler.c         |    6 +
 drivers/gpu/drm/i915/i915_scheduler.h         |    6 +
 drivers/gpu/drm/i915/i915_scheduler_types.h   |    5 +
 drivers/gpu/drm/i915/i915_trace.h             |  197 +-
 .../gpu/drm/i915/selftests/igt_live_test.c    |    2 +-
 .../gpu/drm/i915/selftests/mock_gem_device.c  |    3 +-
 57 files changed, 4159 insertions(+), 787 deletions(-)
Signature · 1 line
2.28.0
#166 lore raw
Quoted 34 lines · Joonas Lahtinen

Quoting Matthew Brost (2021-10-25 18:15:09)

Quoted 25 lines · Joonas Lahtinen
Quoted 24 lines

Quoting Matthew Brost (2021-10-22 19:42:19)

Quoted 9 lines · Joonas Lahtinen
Quoted 7 lines

Hi Matt & John,

Can you please queue patches with the right Fixes: references to convert all the GuC tracepoints to be protected by the LOW_LEVEL_TRACEPOINTS protection for now. Please do so before next Wednesday so we get it queued in drm-intel-next-fixes.

Quoted 6 lines

Don't we already do that? I checked i915_trace.h and every tracepoint I added (intel_context class, i915_request_guc_submit) is protected by LOW_LEVEL_TRACEPOINTS.

The only thing I changed outside of that protection is adding the guc_id field to existing i915_request class tracepoints.

It's the first search hit for "guc" inside the i915_trace.h file :)

Quoted 4 lines

Without the guc_id in
those tracepoints these are basically useless with GuC submission. We could revert that if it is a huge deal but as I said then they are useless...

Quoted 7 lines
Quoted 2 lines

Let's eliminate it for now and restore the tracepoint exactly as it was.

Don't really agree - let's render tracepoints to be useless? Are tracepoints ABI? I googled this and couldn't really find a definie answer. If tracepoints are ABI, then OK I can revert this change but still this is a poor technical decision (tracepoints should not be ABI).

Quoted 7 lines

Thats a very heated discussion in general. But the fact is that if tracepoint changes have caused regressions to applications, they have been forced to be remain untouched. You are free to raise the discussion with Linus/LKML if you feel that should not be the case. So the end result is that tracepoints are effectively in limbo, not ABI unless some application uses them like ABI.

Not trying to start or fight a holy war. If the current rules are don't change tracepoints, we won't. Patch posted, let's stay focused, get an RB, and move on.

Matt

Quoted 200 lines

Feel free to search the intel-gfx/lkml for "tracepoints" keyword and look for threads with many replies. It's not that I would not agree, it's more that I'm not in the mood for repeating that discussion over and over again and always land in the same spot.

So for now, we don't add anything new to tracepoints we can't guarantee to always be there untouched. Similarly, we don't guarantee any of them to remain stable. So we try to be compatible with the limbo.

I'm long overdue waiting for some stable consumer to step up for the tracepoints, so we can then start discussion what would actually be the best way of getting that information out for them. In ~5 years that has not happened.

Quoted 8 lines
Quoted 4 lines

If there is an immediate need, we should instead have an auxilary tracepoint which is enabled only through LOW_LEVEL_TRACEPOINTS and that amends the information of the basic tracepoint.

Regardless of what I said above, I'll post 2 patches. The 1st just remove the GuC, the 2nd modify the tracepoint to include guc_id if LOW_LEVEL_TRACEPOINTS is defined.

Thanks. Let's get a patch merged which simply drops the guc_id for now to unblock things.

For the second, an auxilary tracepoint will be preferred instead of mutating the existing one (regardless of the LOW_LEVEL_TRACEPOINTS).

I only noticed a patch that mutates the tracepoints, can you double-check sending the first patch?

Regards, Joonas

Quoted 166 lines
Quoted 6 lines

For the longer term solution we should align towards the dma fence tracepoints. When those are combined with the OA information, one should be able to get a good understanding of both the software and hardware scheduling decisions.

Not sure about this either. I use these tracepoins to correlate things to the GuC log. Between the 2, if you know what you are doing you basically can figure out everything that is happening. Fields in the trace translate directly to fields in the GuC log. Some of these fields are backend specific, not sure how these could be pushed the dma fence tracepoints. For what it is worth, without these tracepoints we'd likely still have a bunch of bugs in the GuC firmware. I understand these points, several other i915 developers do, and several of the GuC firmware developers do too.

Matt

Quoted 147 lines

Regards, Joonas

Quoted 145 lines

Matt

Quoted 142 lines

There's the orthogonal track to discuss what would be the stable set of tracepoints we could expose. However, before that discussion is closed, let's keep a rather strict line to avoid potential maintenance burned.

We can then relax in the future as needed.

Regards, Joonas

Quoting Matthew Brost (2021-06-24 10:04:29)

Quoted 133 lines

As discussed in [1], [2] we are enabling GuC submission support in the i915. This is a subset of the patches in step 5 described in [1], basically it is absolute to enable CI with GuC submission on gen11+ platforms.

This series itself will likely be broken down into smaller patch sets to merge. Likely into CTBs changes, basic submission, virtual engines, and resets.

A following series will address the missing patches remaining from [1].

Locally tested on TGL machine and basic tests seem to be passing.

[1] https://patchwork.freedesktop.org/series/89844/
[2] https://patchwork.freedesktop.org/series/91417/

Daniele Ceraolo Spurio (1):
drm/i915/guc: Unblock GuC submission on Gen11+

John Harrison (10):
drm/i915/guc: Module load failure test for CT buffer creation drm/i915: Track 'serial' counts for virtual engines drm/i915/guc: Provide mmio list to be saved/restored on engine reset drm/i915/guc: Don't complain about reset races drm/i915/guc: Enable GuC engine reset
drm/i915/guc: Fix for error capture after full GPU reset with GuC drm/i915/guc: Hook GuC scheduling policies up drm/i915/guc: Connect reset modparam updates to GuC policy flags drm/i915/guc: Include scheduling policies in the debugfs state dump drm/i915/guc: Add golden context to GuC ADS

Matthew Brost (36):
drm/i915/guc: Relax CTB response timeout
drm/i915/guc: Improve error message for unsolicited CT response drm/i915/guc: Increase size of CTB buffers
drm/i915/guc: Add non blocking CTB send function drm/i915/guc: Add stall timer to non blocking CTB send function drm/i915/guc: Optimize CTB writes and reads
drm/i915/guc: Add new GuC interface defines and structures drm/i915/guc: Remove GuC stage descriptor, add lrc descriptor drm/i915/guc: Add lrc descriptor context lookup array drm/i915/guc: Implement GuC submission tasklet drm/i915/guc: Add bypass tasklet submission path to GuC drm/i915/guc: Implement GuC context operations for new inteface drm/i915/guc: Insert fence on context when deregistering drm/i915/guc: Defer context unpin until scheduling is disabled drm/i915/guc: Disable engine barriers with GuC during unpin drm/i915/guc: Extend deregistration fence to schedule disable drm/i915: Disable preempt busywait when using GuC scheduling drm/i915/guc: Ensure request ordering via completion fences drm/i915/guc: Disable semaphores when using GuC scheduling drm/i915/guc: Ensure G2H response has space in buffer drm/i915/guc: Update intel_gt_wait_for_idle to work with GuC drm/i915/guc: Update GuC debugfs to support new GuC drm/i915/guc: Add several request trace points
drm/i915: Add intel_context tracing
drm/i915/guc: GuC virtual engines
drm/i915: Hold reference to intel_context over life of i915_request drm/i915/guc: Disable bonding extension with GuC submission drm/i915/guc: Direct all breadcrumbs for a class to single breadcrumbs drm/i915/guc: Reset implementation for new GuC interface drm/i915: Reset GPU immediately if submission is disabled drm/i915/guc: Add disable interrupts to guc sanitize drm/i915/guc: Suspend/resume implementation for new interface drm/i915/guc: Handle context reset notification drm/i915/guc: Handle engine reset failure notification drm/i915/guc: Enable the timer expired interrupt for GuC drm/i915/guc: Capture error state on context reset

 drivers/gpu/drm/i915/gem/i915_gem_context.c   |   30 +-
 drivers/gpu/drm/i915/gem/i915_gem_context.h   |    1 +
 drivers/gpu/drm/i915/gem/i915_gem_mman.c      |    3 +-
 drivers/gpu/drm/i915/gt/gen8_engine_cs.c      |    6 +-
 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c   |   41 +-
 drivers/gpu/drm/i915/gt/intel_breadcrumbs.h   |   14 +-
 .../gpu/drm/i915/gt/intel_breadcrumbs_types.h |    7 +
 drivers/gpu/drm/i915/gt/intel_context.c       |   41 +-
 drivers/gpu/drm/i915/gt/intel_context.h       |   31 +-
 drivers/gpu/drm/i915/gt/intel_context_types.h |   49 +
 drivers/gpu/drm/i915/gt/intel_engine.h        |   72 +-
 drivers/gpu/drm/i915/gt/intel_engine_cs.c     |  182 +-
 .../gpu/drm/i915/gt/intel_engine_heartbeat.c  |   71 +-
 .../gpu/drm/i915/gt/intel_engine_heartbeat.h  |    4 +
 drivers/gpu/drm/i915/gt/intel_engine_types.h  |   12 +-
 .../drm/i915/gt/intel_execlists_submission.c  |  234 +-
 .../drm/i915/gt/intel_execlists_submission.h  |   11 -
 drivers/gpu/drm/i915/gt/intel_gt.c            |   21 +
 drivers/gpu/drm/i915/gt/intel_gt.h            |    2 +
 drivers/gpu/drm/i915/gt/intel_gt_pm.c         |    6 +-
 drivers/gpu/drm/i915/gt/intel_gt_requests.c   |   22 +-
 drivers/gpu/drm/i915/gt/intel_gt_requests.h   |    9 +-
 drivers/gpu/drm/i915/gt/intel_lrc_reg.h       |    1 -
 drivers/gpu/drm/i915/gt/intel_reset.c         |   20 +-
 .../gpu/drm/i915/gt/intel_ring_submission.c   |   28 +
 drivers/gpu/drm/i915/gt/intel_rps.c           |    4 +
 drivers/gpu/drm/i915/gt/intel_workarounds.c   |   46 +-
 .../gpu/drm/i915/gt/intel_workarounds_types.h |    1 +
 drivers/gpu/drm/i915/gt/mock_engine.c         |   41 +-
 drivers/gpu/drm/i915/gt/selftest_context.c    |   10 +
 drivers/gpu/drm/i915/gt/selftest_execlists.c  |   20 +-
 .../gpu/drm/i915/gt/uc/abi/guc_actions_abi.h  |   15 +
 drivers/gpu/drm/i915/gt/uc/intel_guc.c        |   82 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  106 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c    |  460 +++-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h    |    3 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |  318 ++-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h     |   22 +-
 .../gpu/drm/i915/gt/uc/intel_guc_debugfs.c    |   25 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h   |   88 +-
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 2197 +++++++++++++++--
 .../gpu/drm/i915/gt/uc/intel_guc_submission.h |   17 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc.c         |  102 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc.h         |   11 +
 drivers/gpu/drm/i915/i915_debugfs.c           |    2 +
 drivers/gpu/drm/i915/i915_debugfs_params.c    |   31 +
 drivers/gpu/drm/i915/i915_gem_evict.c         |    1 +
 drivers/gpu/drm/i915/i915_gpu_error.c         |   25 +-
 drivers/gpu/drm/i915/i915_reg.h               |    2 +
 drivers/gpu/drm/i915/i915_request.c           |  159 +-
 drivers/gpu/drm/i915/i915_request.h           |   21 +
 drivers/gpu/drm/i915/i915_scheduler.c         |    6 +
 drivers/gpu/drm/i915/i915_scheduler.h         |    6 +
 drivers/gpu/drm/i915/i915_scheduler_types.h   |    5 +
 drivers/gpu/drm/i915/i915_trace.h             |  197 +-
 .../gpu/drm/i915/selftests/igt_live_test.c    |    2 +-
 .../gpu/drm/i915/selftests/mock_gem_device.c  |    3 +-
 57 files changed, 4159 insertions(+), 787 deletions(-)
Signature · 1 line
2.28.0
#167 lore raw
In reply to Joonas Lahtinen
Quoted 64 lines · Joonas Lahtinen

Quoting Matthew Brost (2021-10-25 18:15:09)

Quoted 25 lines · Joonas Lahtinen
Quoted 24 lines

Quoting Matthew Brost (2021-10-22 19:42:19)

Quoted 9 lines · Joonas Lahtinen
Quoted 7 lines

Hi Matt & John,

Can you please queue patches with the right Fixes: references to convert all the GuC tracepoints to be protected by the LOW_LEVEL_TRACEPOINTS protection for now. Please do so before next Wednesday so we get it queued in drm-intel-next-fixes.

Quoted 6 lines

Don't we already do that? I checked i915_trace.h and every tracepoint I added (intel_context class, i915_request_guc_submit) is protected by LOW_LEVEL_TRACEPOINTS.

The only thing I changed outside of that protection is adding the guc_id field to existing i915_request class tracepoints.

It's the first search hit for "guc" inside the i915_trace.h file :)

Quoted 4 lines

Without the guc_id in
those tracepoints these are basically useless with GuC submission. We could revert that if it is a huge deal but as I said then they are useless...

Quoted 7 lines
Quoted 2 lines

Let's eliminate it for now and restore the tracepoint exactly as it was.

Don't really agree - let's render tracepoints to be useless? Are tracepoints ABI? I googled this and couldn't really find a definie answer. If tracepoints are ABI, then OK I can revert this change but still this is a poor technical decision (tracepoints should not be ABI).

Thats a very heated discussion in general. But the fact is that if tracepoint changes have caused regressions to applications, they have been forced to be remain untouched. You are free to raise the discussion with Linus/LKML if you feel that should not be the case. So the end result is that tracepoints are effectively in limbo, not ABI unless some application uses them like ABI.

Feel free to search the intel-gfx/lkml for "tracepoints" keyword and look for threads with many replies. It's not that I would not agree, it's more that I'm not in the mood for repeating that discussion over and over again and always land in the same spot.

So for now, we don't add anything new to tracepoints we can't guarantee to always be there untouched. Similarly, we don't guarantee any of them to remain stable. So we try to be compatible with the limbo.

I'm long overdue waiting for some stable consumer to step up for the tracepoints, so we can then start discussion what would actually be the best way of getting that information out for them. In ~5 years that has not happened.

Quoted 8 lines
Quoted 4 lines

If there is an immediate need, we should instead have an auxilary tracepoint which is enabled only through LOW_LEVEL_TRACEPOINTS and that amends the information of the basic tracepoint.

Regardless of what I said above, I'll post 2 patches. The 1st just remove the GuC, the 2nd modify the tracepoint to include guc_id if LOW_LEVEL_TRACEPOINTS is defined.

Quoted 8 lines

Thanks. Let's get a patch merged which simply drops the guc_id for now to unblock things.

For the second, an auxilary tracepoint will be preferred instead of mutating the existing one (regardless of the LOW_LEVEL_TRACEPOINTS).

I only noticed a patch that mutates the tracepoints, can you double-check sending the first patch?

Sorry for the double reply - missed this one in the first.

I changed my plans / mind after I send the original email. I only sent a patch which includes guc_id when LOW_LEVEL_TRACEPOINTS is enabled. That is the bear minimum I live with. Without it any time there is a problem results in hacking the kernel. I can't do that. This is a good compromise.

Matt

Quoted 169 lines

Regards, Joonas

Quoted 166 lines
Quoted 6 lines

For the longer term solution we should align towards the dma fence tracepoints. When those are combined with the OA information, one should be able to get a good understanding of both the software and hardware scheduling decisions.

Not sure about this either. I use these tracepoins to correlate things to the GuC log. Between the 2, if you know what you are doing you basically can figure out everything that is happening. Fields in the trace translate directly to fields in the GuC log. Some of these fields are backend specific, not sure how these could be pushed the dma fence tracepoints. For what it is worth, without these tracepoints we'd likely still have a bunch of bugs in the GuC firmware. I understand these points, several other i915 developers do, and several of the GuC firmware developers do too.

Matt

Quoted 147 lines

Regards, Joonas

Quoted 145 lines

Matt

Quoted 142 lines

There's the orthogonal track to discuss what would be the stable set of tracepoints we could expose. However, before that discussion is closed, let's keep a rather strict line to avoid potential maintenance burned.

We can then relax in the future as needed.

Regards, Joonas

Quoting Matthew Brost (2021-06-24 10:04:29)

Quoted 133 lines

As discussed in [1], [2] we are enabling GuC submission support in the i915. This is a subset of the patches in step 5 described in [1], basically it is absolute to enable CI with GuC submission on gen11+ platforms.

This series itself will likely be broken down into smaller patch sets to merge. Likely into CTBs changes, basic submission, virtual engines, and resets.

A following series will address the missing patches remaining from [1].

Locally tested on TGL machine and basic tests seem to be passing.

[1] https://patchwork.freedesktop.org/series/89844/
[2] https://patchwork.freedesktop.org/series/91417/

Daniele Ceraolo Spurio (1):
drm/i915/guc: Unblock GuC submission on Gen11+

John Harrison (10):
drm/i915/guc: Module load failure test for CT buffer creation drm/i915: Track 'serial' counts for virtual engines drm/i915/guc: Provide mmio list to be saved/restored on engine reset drm/i915/guc: Don't complain about reset races drm/i915/guc: Enable GuC engine reset
drm/i915/guc: Fix for error capture after full GPU reset with GuC drm/i915/guc: Hook GuC scheduling policies up drm/i915/guc: Connect reset modparam updates to GuC policy flags drm/i915/guc: Include scheduling policies in the debugfs state dump drm/i915/guc: Add golden context to GuC ADS

Matthew Brost (36):
drm/i915/guc: Relax CTB response timeout
drm/i915/guc: Improve error message for unsolicited CT response drm/i915/guc: Increase size of CTB buffers
drm/i915/guc: Add non blocking CTB send function drm/i915/guc: Add stall timer to non blocking CTB send function drm/i915/guc: Optimize CTB writes and reads
drm/i915/guc: Add new GuC interface defines and structures drm/i915/guc: Remove GuC stage descriptor, add lrc descriptor drm/i915/guc: Add lrc descriptor context lookup array drm/i915/guc: Implement GuC submission tasklet drm/i915/guc: Add bypass tasklet submission path to GuC drm/i915/guc: Implement GuC context operations for new inteface drm/i915/guc: Insert fence on context when deregistering drm/i915/guc: Defer context unpin until scheduling is disabled drm/i915/guc: Disable engine barriers with GuC during unpin drm/i915/guc: Extend deregistration fence to schedule disable drm/i915: Disable preempt busywait when using GuC scheduling drm/i915/guc: Ensure request ordering via completion fences drm/i915/guc: Disable semaphores when using GuC scheduling drm/i915/guc: Ensure G2H response has space in buffer drm/i915/guc: Update intel_gt_wait_for_idle to work with GuC drm/i915/guc: Update GuC debugfs to support new GuC drm/i915/guc: Add several request trace points
drm/i915: Add intel_context tracing
drm/i915/guc: GuC virtual engines
drm/i915: Hold reference to intel_context over life of i915_request drm/i915/guc: Disable bonding extension with GuC submission drm/i915/guc: Direct all breadcrumbs for a class to single breadcrumbs drm/i915/guc: Reset implementation for new GuC interface drm/i915: Reset GPU immediately if submission is disabled drm/i915/guc: Add disable interrupts to guc sanitize drm/i915/guc: Suspend/resume implementation for new interface drm/i915/guc: Handle context reset notification drm/i915/guc: Handle engine reset failure notification drm/i915/guc: Enable the timer expired interrupt for GuC drm/i915/guc: Capture error state on context reset

 drivers/gpu/drm/i915/gem/i915_gem_context.c   |   30 +-
 drivers/gpu/drm/i915/gem/i915_gem_context.h   |    1 +
 drivers/gpu/drm/i915/gem/i915_gem_mman.c      |    3 +-
 drivers/gpu/drm/i915/gt/gen8_engine_cs.c      |    6 +-
 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c   |   41 +-
 drivers/gpu/drm/i915/gt/intel_breadcrumbs.h   |   14 +-
 .../gpu/drm/i915/gt/intel_breadcrumbs_types.h |    7 +
 drivers/gpu/drm/i915/gt/intel_context.c       |   41 +-
 drivers/gpu/drm/i915/gt/intel_context.h       |   31 +-
 drivers/gpu/drm/i915/gt/intel_context_types.h |   49 +
 drivers/gpu/drm/i915/gt/intel_engine.h        |   72 +-
 drivers/gpu/drm/i915/gt/intel_engine_cs.c     |  182 +-
 .../gpu/drm/i915/gt/intel_engine_heartbeat.c  |   71 +-
 .../gpu/drm/i915/gt/intel_engine_heartbeat.h  |    4 +
 drivers/gpu/drm/i915/gt/intel_engine_types.h  |   12 +-
 .../drm/i915/gt/intel_execlists_submission.c  |  234 +-
 .../drm/i915/gt/intel_execlists_submission.h  |   11 -
 drivers/gpu/drm/i915/gt/intel_gt.c            |   21 +
 drivers/gpu/drm/i915/gt/intel_gt.h            |    2 +
 drivers/gpu/drm/i915/gt/intel_gt_pm.c         |    6 +-
 drivers/gpu/drm/i915/gt/intel_gt_requests.c   |   22 +-
 drivers/gpu/drm/i915/gt/intel_gt_requests.h   |    9 +-
 drivers/gpu/drm/i915/gt/intel_lrc_reg.h       |    1 -
 drivers/gpu/drm/i915/gt/intel_reset.c         |   20 +-
 .../gpu/drm/i915/gt/intel_ring_submission.c   |   28 +
 drivers/gpu/drm/i915/gt/intel_rps.c           |    4 +
 drivers/gpu/drm/i915/gt/intel_workarounds.c   |   46 +-
 .../gpu/drm/i915/gt/intel_workarounds_types.h |    1 +
 drivers/gpu/drm/i915/gt/mock_engine.c         |   41 +-
 drivers/gpu/drm/i915/gt/selftest_context.c    |   10 +
 drivers/gpu/drm/i915/gt/selftest_execlists.c  |   20 +-
 .../gpu/drm/i915/gt/uc/abi/guc_actions_abi.h  |   15 +
 drivers/gpu/drm/i915/gt/uc/intel_guc.c        |   82 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  106 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c    |  460 +++-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h    |    3 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |  318 ++-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h     |   22 +-
 .../gpu/drm/i915/gt/uc/intel_guc_debugfs.c    |   25 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h   |   88 +-
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 2197 +++++++++++++++--
 .../gpu/drm/i915/gt/uc/intel_guc_submission.h |   17 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc.c         |  102 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc.h         |   11 +
 drivers/gpu/drm/i915/i915_debugfs.c           |    2 +
 drivers/gpu/drm/i915/i915_debugfs_params.c    |   31 +
 drivers/gpu/drm/i915/i915_gem_evict.c         |    1 +
 drivers/gpu/drm/i915/i915_gpu_error.c         |   25 +-
 drivers/gpu/drm/i915/i915_reg.h               |    2 +
 drivers/gpu/drm/i915/i915_request.c           |  159 +-
 drivers/gpu/drm/i915/i915_request.h           |   21 +
 drivers/gpu/drm/i915/i915_scheduler.c         |    6 +
 drivers/gpu/drm/i915/i915_scheduler.h         |    6 +
 drivers/gpu/drm/i915/i915_scheduler_types.h   |    5 +
 drivers/gpu/drm/i915/i915_trace.h             |  197 +-
 .../gpu/drm/i915/selftests/igt_live_test.c    |    2 +-
 .../gpu/drm/i915/selftests/mock_gem_device.c  |    3 +-
 57 files changed, 4159 insertions(+), 787 deletions(-)
Signature · 1 line
2.28.0
maintainer
#168 lore raw

Quoting Matthew Brost (2021-10-26 18:51:17)

Quoted 74 lines · Joonas Lahtinen
Quoted 64 lines

Quoting Matthew Brost (2021-10-25 18:15:09)

Quoted 25 lines · Joonas Lahtinen
Quoted 24 lines

Quoting Matthew Brost (2021-10-22 19:42:19)

Quoted 9 lines · Joonas Lahtinen
Quoted 7 lines

Hi Matt & John,

Can you please queue patches with the right Fixes: references to convert all the GuC tracepoints to be protected by the LOW_LEVEL_TRACEPOINTS protection for now. Please do so before next Wednesday so we get it queued in drm-intel-next-fixes.

Quoted 6 lines

Don't we already do that? I checked i915_trace.h and every tracepoint I added (intel_context class, i915_request_guc_submit) is protected by LOW_LEVEL_TRACEPOINTS.

The only thing I changed outside of that protection is adding the guc_id field to existing i915_request class tracepoints.

It's the first search hit for "guc" inside the i915_trace.h file :)

Quoted 4 lines

Without the guc_id in
those tracepoints these are basically useless with GuC submission. We could revert that if it is a huge deal but as I said then they are useless...

Quoted 7 lines
Quoted 2 lines

Let's eliminate it for now and restore the tracepoint exactly as it was.

Don't really agree - let's render tracepoints to be useless? Are tracepoints ABI? I googled this and couldn't really find a definie answer. If tracepoints are ABI, then OK I can revert this change but still this is a poor technical decision (tracepoints should not be ABI).

Thats a very heated discussion in general. But the fact is that if tracepoint changes have caused regressions to applications, they have been forced to be remain untouched. You are free to raise the discussion with Linus/LKML if you feel that should not be the case. So the end result is that tracepoints are effectively in limbo, not ABI unless some application uses them like ABI.

Feel free to search the intel-gfx/lkml for "tracepoints" keyword and look for threads with many replies. It's not that I would not agree, it's more that I'm not in the mood for repeating that discussion over and over again and always land in the same spot.

So for now, we don't add anything new to tracepoints we can't guarantee to always be there untouched. Similarly, we don't guarantee any of them to remain stable. So we try to be compatible with the limbo.

I'm long overdue waiting for some stable consumer to step up for the tracepoints, so we can then start discussion what would actually be the best way of getting that information out for them. In ~5 years that has not happened.

Quoted 8 lines
Quoted 4 lines

If there is an immediate need, we should instead have an auxilary tracepoint which is enabled only through LOW_LEVEL_TRACEPOINTS and that amends the information of the basic tracepoint.

Regardless of what I said above, I'll post 2 patches. The 1st just remove the GuC, the 2nd modify the tracepoint to include guc_id if LOW_LEVEL_TRACEPOINTS is defined.

Quoted 8 lines

Thanks. Let's get a patch merged which simply drops the guc_id for now to unblock things.

For the second, an auxilary tracepoint will be preferred instead of mutating the existing one (regardless of the LOW_LEVEL_TRACEPOINTS).

I only noticed a patch that mutates the tracepoints, can you double-check sending the first patch?

Quoted 7 lines

Sorry for the double reply - missed this one in the first.

I changed my plans / mind after I send the original email. I only sent a patch which includes guc_id when LOW_LEVEL_TRACEPOINTS is enabled. That is the bear minimum I live with. Without it any time there is a problem results in hacking the kernel. I can't do that. This is a good compromise.

When it comes to fixing a regression, it should be done with the minimal revert/change with "Fixes:" as suggested originally.

Then we can leave the discussion for how to best cover the gap you pointed out, to be resolved in the second patch. There are clearly at least two ways to approach it, either mutate the original tracepoint or add an auxilary tracepoint to amend the information. So we should have a quick discussion between the involved parties which is a better approach.

We should not fix the regression in a patch where we also initiate a change in behavior. That'll make bisecting and backporting patches a pain.

So even if the patches would be merged back-to-back to the tree at the same time, they should be different patches. And in this case it seems that the latter patch should have some discussion to reach a rough consensus and that should not delay the delivery of the fix itself.

I will queue a patch to do the fix. We should continue the discussion about auxilary tracepoint vs. mutating an existing tracepoint based on the kernel config option in an another thread.

Regards, Joonas

Quoted 172 lines

Matt

Quoted 169 lines

Regards, Joonas

Quoted 166 lines
Quoted 6 lines

For the longer term solution we should align towards the dma fence tracepoints. When those are combined with the OA information, one should be able to get a good understanding of both the software and hardware scheduling decisions.

Not sure about this either. I use these tracepoins to correlate things to the GuC log. Between the 2, if you know what you are doing you basically can figure out everything that is happening. Fields in the trace translate directly to fields in the GuC log. Some of these fields are backend specific, not sure how these could be pushed the dma fence tracepoints. For what it is worth, without these tracepoints we'd likely still have a bunch of bugs in the GuC firmware. I understand these points, several other i915 developers do, and several of the GuC firmware developers do too.

Matt

Quoted 147 lines

Regards, Joonas

Quoted 145 lines

Matt

Quoted 142 lines

There's the orthogonal track to discuss what would be the stable set of tracepoints we could expose. However, before that discussion is closed, let's keep a rather strict line to avoid potential maintenance burned.

We can then relax in the future as needed.

Regards, Joonas

Quoting Matthew Brost (2021-06-24 10:04:29)

Quoted 133 lines

As discussed in [1], [2] we are enabling GuC submission support in the i915. This is a subset of the patches in step 5 described in [1], basically it is absolute to enable CI with GuC submission on gen11+ platforms.

This series itself will likely be broken down into smaller patch sets to merge. Likely into CTBs changes, basic submission, virtual engines, and resets.

A following series will address the missing patches remaining from [1].

Locally tested on TGL machine and basic tests seem to be passing.

[1] https://patchwork.freedesktop.org/series/89844/
[2] https://patchwork.freedesktop.org/series/91417/

Daniele Ceraolo Spurio (1):
drm/i915/guc: Unblock GuC submission on Gen11+

John Harrison (10):
drm/i915/guc: Module load failure test for CT buffer creation drm/i915: Track 'serial' counts for virtual engines drm/i915/guc: Provide mmio list to be saved/restored on engine reset drm/i915/guc: Don't complain about reset races drm/i915/guc: Enable GuC engine reset
drm/i915/guc: Fix for error capture after full GPU reset with GuC drm/i915/guc: Hook GuC scheduling policies up drm/i915/guc: Connect reset modparam updates to GuC policy flags drm/i915/guc: Include scheduling policies in the debugfs state dump drm/i915/guc: Add golden context to GuC ADS

Matthew Brost (36):
drm/i915/guc: Relax CTB response timeout
drm/i915/guc: Improve error message for unsolicited CT response drm/i915/guc: Increase size of CTB buffers
drm/i915/guc: Add non blocking CTB send function drm/i915/guc: Add stall timer to non blocking CTB send function drm/i915/guc: Optimize CTB writes and reads
drm/i915/guc: Add new GuC interface defines and structures drm/i915/guc: Remove GuC stage descriptor, add lrc descriptor drm/i915/guc: Add lrc descriptor context lookup array drm/i915/guc: Implement GuC submission tasklet drm/i915/guc: Add bypass tasklet submission path to GuC drm/i915/guc: Implement GuC context operations for new inteface drm/i915/guc: Insert fence on context when deregistering drm/i915/guc: Defer context unpin until scheduling is disabled drm/i915/guc: Disable engine barriers with GuC during unpin drm/i915/guc: Extend deregistration fence to schedule disable drm/i915: Disable preempt busywait when using GuC scheduling drm/i915/guc: Ensure request ordering via completion fences drm/i915/guc: Disable semaphores when using GuC scheduling drm/i915/guc: Ensure G2H response has space in buffer drm/i915/guc: Update intel_gt_wait_for_idle to work with GuC drm/i915/guc: Update GuC debugfs to support new GuC drm/i915/guc: Add several request trace points
drm/i915: Add intel_context tracing
drm/i915/guc: GuC virtual engines
drm/i915: Hold reference to intel_context over life of i915_request drm/i915/guc: Disable bonding extension with GuC submission drm/i915/guc: Direct all breadcrumbs for a class to single breadcrumbs drm/i915/guc: Reset implementation for new GuC interface drm/i915: Reset GPU immediately if submission is disabled drm/i915/guc: Add disable interrupts to guc sanitize drm/i915/guc: Suspend/resume implementation for new interface drm/i915/guc: Handle context reset notification drm/i915/guc: Handle engine reset failure notification drm/i915/guc: Enable the timer expired interrupt for GuC drm/i915/guc: Capture error state on context reset

 drivers/gpu/drm/i915/gem/i915_gem_context.c   |   30 +-
 drivers/gpu/drm/i915/gem/i915_gem_context.h   |    1 +
 drivers/gpu/drm/i915/gem/i915_gem_mman.c      |    3 +-
 drivers/gpu/drm/i915/gt/gen8_engine_cs.c      |    6 +-
 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c   |   41 +-
 drivers/gpu/drm/i915/gt/intel_breadcrumbs.h   |   14 +-
 .../gpu/drm/i915/gt/intel_breadcrumbs_types.h |    7 +
 drivers/gpu/drm/i915/gt/intel_context.c       |   41 +-
 drivers/gpu/drm/i915/gt/intel_context.h       |   31 +-
 drivers/gpu/drm/i915/gt/intel_context_types.h |   49 +
 drivers/gpu/drm/i915/gt/intel_engine.h        |   72 +-
 drivers/gpu/drm/i915/gt/intel_engine_cs.c     |  182 +-
 .../gpu/drm/i915/gt/intel_engine_heartbeat.c  |   71 +-
 .../gpu/drm/i915/gt/intel_engine_heartbeat.h  |    4 +
 drivers/gpu/drm/i915/gt/intel_engine_types.h  |   12 +-
 .../drm/i915/gt/intel_execlists_submission.c  |  234 +-
 .../drm/i915/gt/intel_execlists_submission.h  |   11 -
 drivers/gpu/drm/i915/gt/intel_gt.c            |   21 +
 drivers/gpu/drm/i915/gt/intel_gt.h            |    2 +
 drivers/gpu/drm/i915/gt/intel_gt_pm.c         |    6 +-
 drivers/gpu/drm/i915/gt/intel_gt_requests.c   |   22 +-
 drivers/gpu/drm/i915/gt/intel_gt_requests.h   |    9 +-
 drivers/gpu/drm/i915/gt/intel_lrc_reg.h       |    1 -
 drivers/gpu/drm/i915/gt/intel_reset.c         |   20 +-
 .../gpu/drm/i915/gt/intel_ring_submission.c   |   28 +
 drivers/gpu/drm/i915/gt/intel_rps.c           |    4 +
 drivers/gpu/drm/i915/gt/intel_workarounds.c   |   46 +-
 .../gpu/drm/i915/gt/intel_workarounds_types.h |    1 +
 drivers/gpu/drm/i915/gt/mock_engine.c         |   41 +-
 drivers/gpu/drm/i915/gt/selftest_context.c    |   10 +
 drivers/gpu/drm/i915/gt/selftest_execlists.c  |   20 +-
 .../gpu/drm/i915/gt/uc/abi/guc_actions_abi.h  |   15 +
 drivers/gpu/drm/i915/gt/uc/intel_guc.c        |   82 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  106 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c    |  460 +++-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h    |    3 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |  318 ++-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h     |   22 +-
 .../gpu/drm/i915/gt/uc/intel_guc_debugfs.c    |   25 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h   |   88 +-
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 2197 +++++++++++++++--
 .../gpu/drm/i915/gt/uc/intel_guc_submission.h |   17 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc.c         |  102 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc.h         |   11 +
 drivers/gpu/drm/i915/i915_debugfs.c           |    2 +
 drivers/gpu/drm/i915/i915_debugfs_params.c    |   31 +
 drivers/gpu/drm/i915/i915_gem_evict.c         |    1 +
 drivers/gpu/drm/i915/i915_gpu_error.c         |   25 +-
 drivers/gpu/drm/i915/i915_reg.h               |    2 +
 drivers/gpu/drm/i915/i915_request.c           |  159 +-
 drivers/gpu/drm/i915/i915_request.h           |   21 +
 drivers/gpu/drm/i915/i915_scheduler.c         |    6 +
 drivers/gpu/drm/i915/i915_scheduler.h         |    6 +
 drivers/gpu/drm/i915/i915_scheduler_types.h   |    5 +
 drivers/gpu/drm/i915/i915_trace.h             |  197 +-
 .../gpu/drm/i915/selftests/igt_live_test.c    |    2 +-
 .../gpu/drm/i915/selftests/mock_gem_device.c  |    3 +-
 57 files changed, 4159 insertions(+), 787 deletions(-)
Signature · 1 line
2.28.0
#169 lore raw
In reply to Joonas Lahtinen
Quoted 15 lines · Joonas Lahtinen

Quoting Matthew Brost (2021-10-22 19:42:19)

Quoted 8 lines · Joonas Lahtinen
Quoted 7 lines

Hi Matt & John,

Can you please queue patches with the right Fixes: references to convert all the GuC tracepoints to be protected by the LOW_LEVEL_TRACEPOINTS protection for now. Please do so before next Wednesday so we get it queued in drm-intel-next-fixes.

Quoted 6 lines

Don't we already do that? I checked i915_trace.h and every tracepoint I added (intel_context class, i915_request_guc_submit) is protected by LOW_LEVEL_TRACEPOINTS.

The only thing I changed outside of that protection is adding the guc_id field to existing i915_request class tracepoints.

Quoted 7 lines

It's the first search hit for "guc" inside the i915_trace.h file :)

Quoted 4 lines

Without the guc_id in
those tracepoints these are basically useless with GuC submission. We could revert that if it is a huge deal but as I said then they are useless...

Let's eliminate it for now and restore the tracepoint exactly as it was.

For what purpose?

Your request above was about not adding new tracepoints outside of a low level CONFIG setting. I can understand that on the grounds of not swamping high level tracing with low level details that are not important to the general developer.

But this is not about adding extra tracepoints, this is about making the existing tracepoints usable. With GuC submission, the GuC id is a vital piece of information. Without that, you cannot correlate anything that is happening between i915, GuC and the hardware. Which basically means that for a GuC submission based platform, those tracepoints are useless without this information. And GuC submission is POR for all platforms from ADL-P/DG1 onwards. So by not allowing this update, you are preventing any kind of meaningful debug of any scheduling/execution type issues.

Again, if you are wanting to reduce spam in higher level debug then sure, make the entire set of scheduling tracepoints LOW_LEVEL only. But keeping them around in a censored manner is pointless. They are not ABI, they are allowed to change as and when necessary. And now, it is necessary to update them to match the new POR submission model for current and all future platforms.

Quoted 9 lines

If there is an immediate need, we should instead have an auxilary tracepoint which is enabled only through LOW_LEVEL_TRACEPOINTS and that amends the information of the basic tracepoint.

For the longer term solution we should align towards the dma fence tracepoints. When those are combined with the OA information, one should be able to get a good understanding of both the software and hardware scheduling decisions.

I don't follow this. OA information does not tell you any details of what the GuC is doing. DRM/DMA generic tracepoints certainly won't tell you any hardware/firmware or even i915 specific information.

And that is a much longer term goal than being able to debug current platforms with the current driver.

John.

Quoted 147 lines

Regards, Joonas

Quoted 144 lines

Matt

Quoted 142 lines

There's the orthogonal track to discuss what would be the stable set of tracepoints we could expose. However, before that discussion is closed, let's keep a rather strict line to avoid potential maintenance burned.

We can then relax in the future as needed.

Regards, Joonas

Quoting Matthew Brost (2021-06-24 10:04:29)

Quoted 133 lines

As discussed in [1], [2] we are enabling GuC submission support in the i915. This is a subset of the patches in step 5 described in [1], basically it is absolute to enable CI with GuC submission on gen11+ platforms.

This series itself will likely be broken down into smaller patch sets to merge. Likely into CTBs changes, basic submission, virtual engines, and resets.

A following series will address the missing patches remaining from [1].

Locally tested on TGL machine and basic tests seem to be passing.

[1] https://patchwork.freedesktop.org/series/89844/
[2] https://patchwork.freedesktop.org/series/91417/

Daniele Ceraolo Spurio (1):
drm/i915/guc: Unblock GuC submission on Gen11+

John Harrison (10):
drm/i915/guc: Module load failure test for CT buffer creation drm/i915: Track 'serial' counts for virtual engines drm/i915/guc: Provide mmio list to be saved/restored on engine reset drm/i915/guc: Don't complain about reset races drm/i915/guc: Enable GuC engine reset
drm/i915/guc: Fix for error capture after full GPU reset with GuC drm/i915/guc: Hook GuC scheduling policies up drm/i915/guc: Connect reset modparam updates to GuC policy flags drm/i915/guc: Include scheduling policies in the debugfs state dump drm/i915/guc: Add golden context to GuC ADS

Matthew Brost (36):
drm/i915/guc: Relax CTB response timeout
drm/i915/guc: Improve error message for unsolicited CT response drm/i915/guc: Increase size of CTB buffers
drm/i915/guc: Add non blocking CTB send function drm/i915/guc: Add stall timer to non blocking CTB send function drm/i915/guc: Optimize CTB writes and reads
drm/i915/guc: Add new GuC interface defines and structures drm/i915/guc: Remove GuC stage descriptor, add lrc descriptor drm/i915/guc: Add lrc descriptor context lookup array drm/i915/guc: Implement GuC submission tasklet drm/i915/guc: Add bypass tasklet submission path to GuC drm/i915/guc: Implement GuC context operations for new inteface drm/i915/guc: Insert fence on context when deregistering drm/i915/guc: Defer context unpin until scheduling is disabled drm/i915/guc: Disable engine barriers with GuC during unpin drm/i915/guc: Extend deregistration fence to schedule disable drm/i915: Disable preempt busywait when using GuC scheduling drm/i915/guc: Ensure request ordering via completion fences drm/i915/guc: Disable semaphores when using GuC scheduling drm/i915/guc: Ensure G2H response has space in buffer drm/i915/guc: Update intel_gt_wait_for_idle to work with GuC drm/i915/guc: Update GuC debugfs to support new GuC drm/i915/guc: Add several request trace points
drm/i915: Add intel_context tracing
drm/i915/guc: GuC virtual engines
drm/i915: Hold reference to intel_context over life of i915_request drm/i915/guc: Disable bonding extension with GuC submission drm/i915/guc: Direct all breadcrumbs for a class to single breadcrumbs drm/i915/guc: Reset implementation for new GuC interface drm/i915: Reset GPU immediately if submission is disabled drm/i915/guc: Add disable interrupts to guc sanitize drm/i915/guc: Suspend/resume implementation for new interface drm/i915/guc: Handle context reset notification drm/i915/guc: Handle engine reset failure notification drm/i915/guc: Enable the timer expired interrupt for GuC drm/i915/guc: Capture error state on context reset

  drivers/gpu/drm/i915/gem/i915_gem_context.c   |   30 +-
  drivers/gpu/drm/i915/gem/i915_gem_context.h   |    1 +
  drivers/gpu/drm/i915/gem/i915_gem_mman.c      |    3 +-
  drivers/gpu/drm/i915/gt/gen8_engine_cs.c      |    6 +-
  drivers/gpu/drm/i915/gt/intel_breadcrumbs.c   |   41 +-
  drivers/gpu/drm/i915/gt/intel_breadcrumbs.h   |   14 +-
  .../gpu/drm/i915/gt/intel_breadcrumbs_types.h |    7 +
  drivers/gpu/drm/i915/gt/intel_context.c       |   41 +-
  drivers/gpu/drm/i915/gt/intel_context.h       |   31 +-
  drivers/gpu/drm/i915/gt/intel_context_types.h |   49 +
  drivers/gpu/drm/i915/gt/intel_engine.h        |   72 +-
  drivers/gpu/drm/i915/gt/intel_engine_cs.c     |  182 +-
  .../gpu/drm/i915/gt/intel_engine_heartbeat.c  |   71 +-
  .../gpu/drm/i915/gt/intel_engine_heartbeat.h  |    4 +
  drivers/gpu/drm/i915/gt/intel_engine_types.h  |   12 +-
  .../drm/i915/gt/intel_execlists_submission.c  |  234 +-
  .../drm/i915/gt/intel_execlists_submission.h  |   11 -
  drivers/gpu/drm/i915/gt/intel_gt.c            |   21 +
  drivers/gpu/drm/i915/gt/intel_gt.h            |    2 +
  drivers/gpu/drm/i915/gt/intel_gt_pm.c         |    6 +-
  drivers/gpu/drm/i915/gt/intel_gt_requests.c   |   22 +-
  drivers/gpu/drm/i915/gt/intel_gt_requests.h   |    9 +-
  drivers/gpu/drm/i915/gt/intel_lrc_reg.h       |    1 -
  drivers/gpu/drm/i915/gt/intel_reset.c         |   20 +-
  .../gpu/drm/i915/gt/intel_ring_submission.c   |   28 +
  drivers/gpu/drm/i915/gt/intel_rps.c           |    4 +
  drivers/gpu/drm/i915/gt/intel_workarounds.c   |   46 +-
  .../gpu/drm/i915/gt/intel_workarounds_types.h |    1 +
  drivers/gpu/drm/i915/gt/mock_engine.c         |   41 +-
  drivers/gpu/drm/i915/gt/selftest_context.c    |   10 +
  drivers/gpu/drm/i915/gt/selftest_execlists.c  |   20 +-
  .../gpu/drm/i915/gt/uc/abi/guc_actions_abi.h  |   15 +
  drivers/gpu/drm/i915/gt/uc/intel_guc.c        |   82 +-
  drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  106 +-
  drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c    |  460 +++-
  drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h    |    3 +
  drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |  318 ++-
  drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h     |   22 +-
  .../gpu/drm/i915/gt/uc/intel_guc_debugfs.c    |   25 +-
  drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h   |   88 +-
  .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 2197 +++++++++++++++--
  .../gpu/drm/i915/gt/uc/intel_guc_submission.h |   17 +-
  drivers/gpu/drm/i915/gt/uc/intel_uc.c         |  102 +-
  drivers/gpu/drm/i915/gt/uc/intel_uc.h         |   11 +
  drivers/gpu/drm/i915/i915_debugfs.c           |    2 +
  drivers/gpu/drm/i915/i915_debugfs_params.c    |   31 +
  drivers/gpu/drm/i915/i915_gem_evict.c         |    1 +
  drivers/gpu/drm/i915/i915_gpu_error.c         |   25 +-
  drivers/gpu/drm/i915/i915_reg.h               |    2 +
  drivers/gpu/drm/i915/i915_request.c           |  159 +-
  drivers/gpu/drm/i915/i915_request.h           |   21 +
  drivers/gpu/drm/i915/i915_scheduler.c         |    6 +
  drivers/gpu/drm/i915/i915_scheduler.h         |    6 +
  drivers/gpu/drm/i915/i915_scheduler_types.h   |    5 +
  drivers/gpu/drm/i915/i915_trace.h             |  197 +-
  .../gpu/drm/i915/selftests/igt_live_test.c    |    2 +-
  .../gpu/drm/i915/selftests/mock_gem_device.c  |    3 +-
  57 files changed, 4159 insertions(+), 787 deletions(-)
Signature · 1 line
2.28.0