On Wed, Jul 8, 2026 at 1:53 PM Andreas Hindborg <[email protected]> wrote: > > Commit 9b836641d3bf ("rust: helpers: Add bindings/wrappers for > dma_resv_lock") added rust_helper_dma_resv_lock() and > rust_helper_dma_resv_unlock() unconditionally. However, the dma-resv > functionality is only available when CONFIG_DMA_SHARED_BUFFER is > enabled, resulting in the following link error when it is not: > > LD .tmp_vmlinux1 > ld.lld: error: undefined symbol: dma_resv_reset_max_fences > >>> referenced by dma-resv.h:463 > >>> rust/helpers/helpers.o:(rust_helper_dma_resv_unlock) in > archive vmlinux.a > > The dma_resv_unlock() inline in <linux/dma-resv.h> calls > dma_resv_reset_max_fences(), which is only compiled into > drivers/dma-buf/dma-resv.c when CONFIG_DMA_SHARED_BUFFER is set. With > the option disabled the symbol is never defined, so the helper fails > to link. > > Fix this by guarding the helper definitions with `#ifdef > CONFIG_DMA_SHARED_BUFFER`. > > The only user of this helper is the DRM shmem abstractions, which already > depend on `CONFIG_DMA_SHARED_BUFFER`. > > Cc: [email protected] > Fixes: 9b836641d3bf ("rust: helpers: Add bindings/wrappers for dma_resv_lock") > Signed-off-by: Andreas Hindborg <[email protected]>
Please see: https://lore.kernel.org/rust-for-linux/[email protected]/ Cheers, Miguel
