]> www.infradead.org Git - users/hch/configfs.git/commitdiff
drm/xe: Do not grab forcewakes when issuing GGTT TLB invalidation via GuC
authorMatthew Brost <matthew.brost@intel.com>
Thu, 29 Feb 2024 19:45:20 +0000 (11:45 -0800)
committerMatthew Brost <matthew.brost@intel.com>
Wed, 6 Mar 2024 00:48:55 +0000 (16:48 -0800)
Forcewakes are not required for communication with the GuC via CTB
as it is a memory based interfaced. Acquring forcewakes takes
considerable time. With that, do not grab a forcewake when issuing a
GGTT TLB invalidation via the GuC.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240229194520.200642-1-matthew.brost@intel.com
drivers/gpu/drm/xe/xe_ggtt.c
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c

index 717d0e76277a1a2bed4ac5ae8b9017544893e1fc..5e739513ab0aa557094ef40837158e195e133ab0 100644 (file)
@@ -257,16 +257,9 @@ static void ggtt_invalidate_gt_tlb(struct xe_gt *gt)
        if (!gt)
                return;
 
-       /*
-        * Invalidation can happen when there's no in-flight work keeping the
-        * GT awake.  We need to explicitly grab forcewake to ensure the GT
-        * and GuC are accessible.
-        */
-       xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
        err = xe_gt_tlb_invalidation_ggtt(gt);
        if (err)
                drm_warn(&xe->drm, "xe_gt_tlb_invalidation_ggtt error=%d", err);
-       xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
 }
 
 void xe_ggtt_invalidate(struct xe_ggtt *ggtt)
index f29ee1ccfa71e2ca4ca2fa428f5b95c4f6e1ca17..a3c4ffba679d5c9a6c1b5a5573a6196e1e5da3d7 100644 (file)
@@ -247,6 +247,7 @@ int xe_gt_tlb_invalidation_ggtt(struct xe_gt *gt)
 
                xe_gt_tlb_invalidation_wait(gt, seqno);
        } else if (xe_device_uc_enabled(xe)) {
+               xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
                if (xe->info.platform == XE_PVC || GRAPHICS_VER(xe) >= 20) {
                        xe_mmio_write32(gt, PVC_GUC_TLB_INV_DESC1,
                                        PVC_GUC_TLB_INV_DESC1_INVALIDATE);
@@ -256,6 +257,7 @@ int xe_gt_tlb_invalidation_ggtt(struct xe_gt *gt)
                        xe_mmio_write32(gt, GUC_TLB_INV_CR,
                                        GUC_TLB_INV_CR_INVALIDATE);
                }
+               xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
        }
 
        return 0;