[PATCH] drm/xe/gt: Abort GT init on LMTT initialization failure

From: yaolu

Date: Wed Nov 18 2026 - 03:55:18 EST


From: Lu Yao <yaolu@xxxxxxxxxx>

xe_lmtt_init() can fail, but gt_init_with_gt_forcewake() ignores its
return value. On a PF the probe then continues with a half-initialized
LMTT: lmtt->pd is never set (and lmtt->ops is cleared), so
xe_lmtt_init_hw() returns early and the VF local memory is left without
a translation directory while the driver still reports success.

Return the xe_lmtt_init() error and abort GT init instead, as required
by the documented LMTT contract ("Any LMTT initialization failure
should block VFs enabling").

Fixes: b1d204058218 ("drm/xe/pf: Introduce Local Memory Translation Table")
Signed-off-by: Lu Yao <yaolu@xxxxxxxxxx>
---
drivers/gpu/drm/xe/xe_gt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
index 286aee5775c0..1239cbb7c84c 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -582,10 +582,10 @@ static int gt_init_with_gt_forcewake(struct xe_gt *gt)

if (xe_gt_is_main_type(gt)) {
err = xe_ggtt_init(gt_to_tile(gt)->mem.ggtt);
+ if (!err && IS_SRIOV_PF(gt_to_xe(gt)))
+ err = xe_lmtt_init(&gt_to_tile(gt)->sriov.pf.lmtt);
if (err)
return err;
- if (IS_SRIOV_PF(gt_to_xe(gt)))
- xe_lmtt_init(&gt_to_tile(gt)->sriov.pf.lmtt);
}

/* Enable per hw engine IRQs */
--
2.25.1