* [PATCH] drm/xe/gt: Abort GT init on LMTT initialization failure
@ 2026-11-18 8:54 yaolu
2026-11-18 20:03 ` Summers, Stuart
0 siblings, 1 reply; 2+ messages in thread
From: yaolu @ 2026-11-18 8:54 UTC (permalink / raw)
To: matthew.brost, thomas.hellstrom, rodrigo.vivi
Cc: michal.wajdeczko, intel-xe, dri-devel, linux-kernel, Lu Yao
From: Lu Yao <yaolu@kylinos.cn>
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@kylinos.cn>
---
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(>_to_tile(gt)->sriov.pf.lmtt);
if (err)
return err;
- if (IS_SRIOV_PF(gt_to_xe(gt)))
- xe_lmtt_init(>_to_tile(gt)->sriov.pf.lmtt);
}
/* Enable per hw engine IRQs */
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] drm/xe/gt: Abort GT init on LMTT initialization failure
2026-11-18 8:54 [PATCH] drm/xe/gt: Abort GT init on LMTT initialization failure yaolu
@ 2026-11-18 20:03 ` Summers, Stuart
0 siblings, 0 replies; 2+ messages in thread
From: Summers, Stuart @ 2026-11-18 20:03 UTC (permalink / raw)
To: Brost, Matthew, yaolu, K V P, Satyanarayana, Vivi, Rodrigo,
Piorkowski, Piotr, thomas.hellstrom
Cc: intel-xe, dri-devel, linux-kernel, michal.wajdeczko
On Wed, 2026-11-18 at 16:54 +0800, yaolu@kylinos.cn wrote:
> From: Lu Yao <yaolu@kylinos.cn>
>
> 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@kylinos.cn>
I'm not an expert in this code, but it does look like if we tried to
allocate memory here and that failed for some reason, causing the LMTT
init to fail, it would cause downstream issues later in the PF's LMTT
management. But the change as-is doesn't seem like the right approach
here IMO. I don't think we want to kill the whole driver load because
of this, it seems better to just log the error and not enumerate the
VFs.
But it would be good to get feedback from Piotr/Satya here.
Thanks,
Stuart
> ---
> 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(>_to_tile(gt)-
> >sriov.pf.lmtt);
> if (err)
> return err;
> - if (IS_SRIOV_PF(gt_to_xe(gt)))
> - xe_lmtt_init(>_to_tile(gt)->sriov.pf.lmtt);
> }
>
> /* Enable per hw engine IRQs */
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-18 20:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18 8:54 [PATCH] drm/xe/gt: Abort GT init on LMTT initialization failure yaolu
2026-11-18 20:03 ` Summers, Stuart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®