Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915/mcr: Hold GT forcewake during steering operations
@ 2023-10-19 16:39 Matt Roper
  2023-10-19 17:02 ` [Intel-gfx] [PATCH v2] " Matt Roper
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Matt Roper @ 2023-10-19 16:39 UTC (permalink / raw)
  To: intel-gfx; +Cc: Jonathan Cavitt, matthew.d.roper

The steering control and semaphore registers are inside an "always on"
power domain with respect to RC6.  However there are some issues if
higher-level platform sleep states are entering/exiting at the same time
these registers are accessed.  Grabbing GT forcewake and holding it over
the entire lock/steer/unlock cycle ensures that those sleep states have
been fully exited before we access these registers.

This is expected to become a formally documented/numbered workaround
soon.

Note that this patch alone isn't expected to have an immediately
noticeable impact on MCR (mis)behavior; an upcoming pcode firmware
update will also be necessary to provide the other half of this
workaround.

Fixes: 4186e2185b4f ("drm/i915/gt: Add dedicated MCR lock")
Cc: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
Cc: Jonathan Cavitt <jonathan.cavitt@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt_mcr.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
index 326c2ed1d99b..83bb0575b426 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
@@ -371,6 +371,21 @@ void intel_gt_mcr_lock(struct intel_gt *gt, unsigned long *flags)
 
 	lockdep_assert_not_held(&gt->uncore->lock);
 
+	/*
+	 * The steering control and semaphore registers are inside an
+	 * "always on" power domain with respect to RC6.  However there are
+	 * some issues if higher-level platform sleep states are
+	 * entering/exiting at the same time these registers are accessed.
+	 * Grabbing GT forcewake and holding it over the entire
+	 * lock/steer/unlock cycle ensures that those sleep states have been
+	 * fully exited before we access these registers.  This
+	 * wakeref will be released in the unlock routine.
+	 *
+	 * This is expected to become a formally documented/numbered workaround
+	 * soon.
+	 */
+	intel_uncore_forcewake_get(gt->uncore, FORCEWAKE_GT);
+
 	/*
 	 * Starting with MTL, we need to coordinate not only with other
 	 * driver threads, but also with hardware/firmware agents.  A dedicated
@@ -417,6 +432,8 @@ void intel_gt_mcr_unlock(struct intel_gt *gt, unsigned long flags)
 
 	if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 70))
 		intel_uncore_write_fw(gt->uncore, MTL_STEER_SEMAPHORE, 0x1);
+
+	intel_uncore_forcewake_put(gt->uncore, FORCEWAKE_GT);
 }
 
 /**
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-10-24 19:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-19 16:39 [Intel-gfx] [PATCH] drm/i915/mcr: Hold GT forcewake during steering operations Matt Roper
2023-10-19 17:02 ` [Intel-gfx] [PATCH v2] " Matt Roper
2023-10-20 21:32   ` Sripada, Radhakrishna
2023-10-20 22:02     ` Cavitt, Jonathan
2023-10-24 12:02   ` Andi Shyti
2023-10-24 15:21     ` Matt Roper
2023-10-24 15:29       ` Andi Shyti
2023-10-24  8:26 ` [Intel-gfx] [PATCH] " Nirmoy Das
2023-10-24 11:42 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/mcr: Hold GT forcewake during steering operations (rev2) Patchwork
2023-10-24 19:15 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-10-24 19:57   ` Matt Roper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox