]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpu: Fix uninitialized buddy for built-in drivers
authorKoen Koning <koen.koning@linux.intel.com>
Fri, 13 Feb 2026 15:20:47 +0000 (16:20 +0100)
committerDave Airlie <airlied@redhat.com>
Tue, 24 Feb 2026 03:40:59 +0000 (13:40 +1000)
Move buddy to the start of the link order, so its __init runs before any
other built-in drivers that may depend on it. Otherwise, a built-in
driver that tries to use the buddy allocator will run into a kernel NULL
pointer dereference because slab_blocks is uninitialized.

Specifically, this fixes drm/xe (as built-in) running into a kernel
panic during boot, because it uses buddy during device probe.

Fixes: ba110db8e1bc ("gpu: Move DRM buddy allocator one level up (part two)")
Cc: Joel Fernandes <joelagnelf@nvidia.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: intel-xe@lists.freedesktop.org
Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Peter Senna Tschudin <peter.senna@linux.intel.com>
Signed-off-by: Koen Koning <koen.koning@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patch.msgid.link/20260213152047.179628-1-koen.koning@linux.intel.com
drivers/gpu/Makefile

index 5cd54d06e26270847c2acbd82957736d31d0984e..b4e5e338efa23959947f3f9bfcb1845f93314e8c 100644 (file)
@@ -2,8 +2,9 @@
 # drm/tegra depends on host1x, so if both drivers are built-in care must be
 # taken to initialize them in the correct order. Link order is the only way
 # to ensure this currently.
+# Similarly, buddy must come first since it is used by other drivers.
+obj-$(CONFIG_GPU_BUDDY)        += buddy.o
 obj-y                  += host1x/ drm/ vga/ tests/
 obj-$(CONFIG_IMX_IPUV3_CORE)   += ipu-v3/
 obj-$(CONFIG_TRACE_GPU_MEM)            += trace/
 obj-$(CONFIG_NOVA_CORE)                += nova-core/
-obj-$(CONFIG_GPU_BUDDY)                += buddy.o