]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/mert: Move MERT initialization to xe_mert.c
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Fri, 9 Jan 2026 15:12:19 +0000 (16:12 +0100)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Mon, 12 Jan 2026 13:38:44 +0000 (14:38 +0100)
Most of the MERT code is already in dedicated file, no reason to
keep internal MERT data structure initialization elsewhere.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Lukasz Laguna <lukasz.laguna@intel.com>
Reviewed-by: Lukasz Laguna <lukasz.laguna@intel.com>
Link: https://patch.msgid.link/20260109151219.26206-6-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/xe_mert.c
drivers/gpu/drm/xe/xe_mert.h
drivers/gpu/drm/xe/xe_sriov_pf.c

index ad832e89256c2f6e2c9fd5aef0fb9a3a6dcb76d5..fc027d2d7a5eb4499fb13ccb0485ba3c382b6602 100644 (file)
 #include "xe_mmio.h"
 #include "xe_tile.h"
 
+/**
+ * xe_mert_init_early() - Initialize MERT data
+ * @xe: the &xe_device with MERT to init
+ */
+void xe_mert_init_early(struct xe_device *xe)
+{
+       struct xe_tile *tile = xe_device_get_root_tile(xe);
+       struct xe_mert *mert = &tile->mert;
+
+       spin_lock_init(&mert->lock);
+       init_completion(&mert->tlb_inv_done);
+}
+
 /**
  * xe_mert_invalidate_lmtt() - Invalidate MERT LMTT
  * @xe: the &xe_device with MERT
index 44daeca094bddc172cbdc7e3440a9411356510b5..fc977203692d7b746f5d3ee635d26ff4587dc6d8 100644 (file)
@@ -25,6 +25,7 @@ struct xe_mert {
 };
 
 #ifdef CONFIG_PCI_IOV
+void xe_mert_init_early(struct xe_device *xe);
 int xe_mert_invalidate_lmtt(struct xe_device *xe);
 void xe_mert_irq_handler(struct xe_device *xe, u32 master_ctl);
 #else
index 72423bb17e6fd6818cff51116f134667451824ef..6ce3c58e003c79c0727da0c8ae774275d6a3637f 100644 (file)
@@ -90,7 +90,6 @@ bool xe_sriov_pf_readiness(struct xe_device *xe)
  */
 int xe_sriov_pf_init_early(struct xe_device *xe)
 {
-       struct xe_mert *mert = &xe_device_get_root_tile(xe)->mert;
        int err;
 
        xe_assert(xe, IS_SRIOV_PF(xe));
@@ -112,8 +111,7 @@ int xe_sriov_pf_init_early(struct xe_device *xe)
 
        xe_sriov_pf_service_init(xe);
 
-       spin_lock_init(&mert->lock);
-       init_completion(&mert->tlb_inv_done);
+       xe_mert_init_early(xe);
 
        return 0;
 }