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

Configure Feed

Select the types of activity you want to include in your feed.

gpu: Fix uninitialized buddy for built-in drivers

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

authored by

Koen Koning and committed by
Dave Airlie
cc27314c 8c5f9645

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