drm/xe/vf: Don't use register based TLB invalidation if VF
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Wed, 19 Jun 2024 21:45:55 +0000 (23:45 +0200)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Thu, 20 Jun 2024 17:49:41 +0000 (19:49 +0200)
VF drivers can only use GuC-based TLB invalidation, as they don't
have access to the related registers. However, VFs shouldn't need
any explicit TLB invalidation before enabling CTB communication,
as there will be an implicit GGTT TLB invalidation issued by the
GuC itself as part of MMIO-based action handling.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240619214557.905-8-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c

index 23d397a246a8b4f82fdf0e0b8a0a644efc9401ca..e1f1ccb0114349733c8e835758244459ec2635b6 100644 (file)
@@ -13,6 +13,7 @@
 #include "xe_guc.h"
 #include "xe_guc_ct.h"
 #include "xe_mmio.h"
+#include "xe_sriov.h"
 #include "xe_trace.h"
 #include "regs/xe_guc_regs.h"
 
@@ -249,6 +250,9 @@ 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_device_wedged(xe)) {
+               if (IS_SRIOV_VF(xe))
+                       return 0;
+
                xe_gt_WARN_ON(gt, 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,