Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe: Move xe_ttm_sys_mgr_init() downwards.

Now that all previous allocations are gone, ensure no new allocations
will ever be done before xe_display_init_early(), by moving the call
that allows allocations downwards.

Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20250619104858.418440-21-dev@lankhorst.se
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>

+8 -4
+8 -4
drivers/gpu/drm/xe/xe_device.c
··· 784 784 if (err) 785 785 return err; 786 786 787 - err = xe_ttm_sys_mgr_init(xe); 788 - if (err) 789 - return err; 790 - 791 787 for_each_gt(gt, xe, id) { 792 788 err = xe_gt_init_early(gt); 793 789 if (err) ··· 820 824 if (err) 821 825 return err; 822 826 } 827 + 828 + /* 829 + * Allow allocations only now to ensure xe_display_init_early() 830 + * is the first to allocate, always. 831 + */ 832 + err = xe_ttm_sys_mgr_init(xe); 833 + if (err) 834 + return err; 823 835 824 836 /* Allocate and map stolen after potential VRAM resize */ 825 837 err = xe_ttm_stolen_mgr_init(xe);