Skip to content

Commit 78cc55e

Browse files
mattroperodrigovivi
authored andcommitted
drm/i915/mcr: Hold GT forcewake during steering operations
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. v2: - Move the forcewake inside the Xe_LPG-specific IP version check. This should only be necessary on platforms that have a steering semaphore. Fixes: 3100240 ("drm/i915/mtl: Add hardware-level lock for steering") Cc: Radhakrishna Sripada <[email protected]> Cc: Jonathan Cavitt <[email protected]> Signed-off-by: Matt Roper <[email protected]> Reviewed-by: Radhakrishna Sripada <[email protected]> Reviewed-by: Jonathan Cavitt <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 8fa1c7c) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent cba94bb commit 78cc55e

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

drivers/gpu/drm/i915/gt/intel_gt_mcr.c

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,26 @@ void intel_gt_mcr_lock(struct intel_gt *gt, unsigned long *flags)
376376
* driver threads, but also with hardware/firmware agents. A dedicated
377377
* locking register is used.
378378
*/
379-
if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 70))
379+
if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 70)) {
380+
/*
381+
* The steering control and semaphore registers are inside an
382+
* "always on" power domain with respect to RC6. However there
383+
* are some issues if higher-level platform sleep states are
384+
* entering/exiting at the same time these registers are
385+
* accessed. Grabbing GT forcewake and holding it over the
386+
* entire lock/steer/unlock cycle ensures that those sleep
387+
* states have been fully exited before we access these
388+
* registers. This wakeref will be released in the unlock
389+
* routine.
390+
*
391+
* This is expected to become a formally documented/numbered
392+
* workaround soon.
393+
*/
394+
intel_uncore_forcewake_get(gt->uncore, FORCEWAKE_GT);
395+
380396
err = wait_for(intel_uncore_read_fw(gt->uncore,
381397
MTL_STEER_SEMAPHORE) == 0x1, 100);
398+
}
382399

383400
/*
384401
* Even on platforms with a hardware lock, we'll continue to grab
@@ -415,8 +432,11 @@ void intel_gt_mcr_unlock(struct intel_gt *gt, unsigned long flags)
415432
{
416433
spin_unlock_irqrestore(&gt->mcr_lock, flags);
417434

418-
if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 70))
435+
if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 70)) {
419436
intel_uncore_write_fw(gt->uncore, MTL_STEER_SEMAPHORE, 0x1);
437+
438+
intel_uncore_forcewake_put(gt->uncore, FORCEWAKE_GT);
439+
}
420440
}
421441

422442
/**

0 commit comments

Comments
 (0)