[PATCH v2 4/9] drm/xe: Introduce xe_device_assert_lmem_ready()

Raag Jadav
2026-02-27T17:03:28Z

In preparation of usecases which require verifying LMEM readiness after
PCIe FLR, introduce xe_device_assert_lmem_ready() helper.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
v2: Add kernel doc (Matthew Brost)
---
drivers/gpu/drm/xe/xe_device.c | 10 ++++++++--
drivers/gpu/drm/xe/xe_device.h | 1 +
2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index eee183732950..ce79b7cdafeb 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -650,7 +650,13 @@ static int xe_set_dma_info(struct xe_device *xe)
return err;
}

-static void assert_lmem_ready(struct xe_device *xe)
+/**
+ * xe_device_assert_lmem_ready() - Verify LMEM readiness
+ * @xe: xe device instance
+ *
+ * Verify LMEM readiness and assert on failure.
+ */
+void xe_device_assert_lmem_ready(struct xe_device *xe)
{
if (!IS_DGFX(xe) || IS_SRIOV_VF(xe))
return;
@@ -738,7 +744,7 @@ int xe_device_probe_early(struct xe_device *xe)
* is flagged after full initialization is complete. Assert if lmem is
* not initialized.
*/
- assert_lmem_ready(xe);
+ xe_device_assert_lmem_ready(xe);

xe->wedged.mode = xe_device_validate_wedged_mode(xe, xe_modparam.wedged_mode) ?
XE_DEFAULT_WEDGED_MODE : xe_modparam.wedged_mode;
diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
index 39464650533b..44db00d0ad55 100644
--- a/drivers/gpu/drm/xe/xe_device.h
+++ b/drivers/gpu/drm/xe/xe_device.h
@@ -140,6 +140,7 @@ static inline struct xe_force_wake *gt_to_fw(struct xe_gt *gt)
return &gt->pm.fw;
}

+void xe_device_assert_lmem_ready(struct xe_device *xe);
void xe_device_assert_mem_access(struct xe_device *xe);

static inline bool xe_device_has_flat_ccs(struct xe_device *xe)
--
2.43.0