mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
rust: dma_fence: gate abstractions on CONFIG_DMA_SHARED_BUFFER
The dma_fence abstractions added by commit3282d59160("rust: Add dma_fence abstractions") are compiled unconditionally, but the C `dma_fence_*` symbols they reference live in drivers/dma-buf/dma-fence.c, which is only built when CONFIG_DMA_SHARED_BUFFER=y. Kernels with CONFIG_RUST=y and CONFIG_RUST_KERNEL_DOCTESTS=y but CONFIG_DMA_SHARED_BUFFER=n fail to link: ld.lld: error: undefined symbol: dma_fence_release >>> referenced by usercopy_64.c >>> vmlinux.o:(rust_helper_dma_fence_put) ... dma_fence_signal{,_locked}, dma_fence_context_alloc, dma_fence_init, dma_fence_{add,remove}_callback ... Wrap the dma_fence.c helper include in the same `pub mod dma_buf;` in rust/kernel/lib.rs with a matching #[cfg]. Fixes:3282d59160("rust: Add dma_fence abstractions") Signed-off-by: Edwin Peer <epeer@nvidia.com> Reviewed-by: John Hubbard <jhubbard@nvidia.com> Reviewed-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260909202327.33285-1-epeer@nvidia.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
This commit is contained in:
parent
10186439b8
commit
73e5616f3d
|
|
@ -57,8 +57,8 @@
|
|||
#include "cred.c"
|
||||
#include "device.c"
|
||||
#include "dma.c"
|
||||
#include "dma_fence.c"
|
||||
#ifdef CONFIG_DMA_SHARED_BUFFER
|
||||
#include "dma_fence.c"
|
||||
#include "dma-resv.c"
|
||||
#endif
|
||||
#include "drm.c"
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@
|
|||
pub mod device_id;
|
||||
pub mod devres;
|
||||
pub mod dma;
|
||||
#[cfg(CONFIG_DMA_SHARED_BUFFER)]
|
||||
pub mod dma_buf;
|
||||
pub mod driver;
|
||||
#[cfg(CONFIG_DRM = "y")]
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user