Skip to content

Commit da9eee7

Browse files
committed
generic: 6.18: hack: io_uring: zcrx: Use IS_REACHABLE() instead of IS_ENABLED()
We patch DMA_BUF to make it tristate, so once ALL_KMODS is selected it will be built as a module even if previously disabled in the config. So, since IO_URING_ZCRX does not depend on DMA_BUF linking will fail with: aarch64-openwrt-linux-musl-ld: Unexpected GOT/PLT entries detected! aarch64-openwrt-linux-musl-ld: Unexpected run-time procedure linkages detected! aarch64-openwrt-linux-musl-ld: io_uring/zcrx.o: in function `io_release_dmabuf': io_uring/zcrx.c:94:(.text+0x20): undefined reference to `dma_buf_unmap_attachment_unlocked' aarch64-openwrt-linux-musl-ld: io_uring/zcrx.c:97:(.text+0x30): undefined reference to `dma_buf_detach' aarch64-openwrt-linux-musl-ld: io_uring/zcrx.c:99:(.text+0x3c): undefined reference to `dma_buf_put' aarch64-openwrt-linux-musl-ld: io_uring/zcrx.o: in function `io_import_dmabuf': io_uring/zcrx.c:125:(.text+0x1b20): undefined reference to `dma_buf_get' aarch64-openwrt-linux-musl-ld: io_uring/zcrx.c:132:(.text+0x1b34): undefined reference to `dma_buf_attach' aarch64-openwrt-linux-musl-ld: io_uring/zcrx.c:139:(.text+0x1b48): undefined reference to `dma_buf_map_attachment_unlocked' make[6]: *** [scripts/Makefile.vmlinux:72: vmlinux.unstripped] Error 1 So, lets use IS_REACHABLE() to check for CONFIG_DMA_SHARED_BUFFER instead to avoid adding a dependency to CONFIG_DMA_SHARED_BUFFER. Signed-off-by: Robert Marko <robert.marko@sartura.hr>
1 parent 776a926 commit da9eee7

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
From 6f6357583c491b451fb510071e39b6c56a521f95 Mon Sep 17 00:00:00 2001
2+
From: Robert Marko <robert.marko@sartura.hr>
3+
Date: Tue, 31 Mar 2026 18:37:02 +0200
4+
Subject: [PATCH] io_uring: zcrx: Use IS_REACHABLE() instead of IS_ENABLED()
5+
6+
We patch DMA_BUF to make it tristate, so once ALL_KMODS is selected it will
7+
be built as a module even if previously disabled in the config.
8+
9+
So, since IO_URING_ZCRX does not depend on DMA_BUF linking will fail with:
10+
aarch64-openwrt-linux-musl-ld: Unexpected GOT/PLT entries detected!
11+
aarch64-openwrt-linux-musl-ld: Unexpected run-time procedure linkages detected!
12+
aarch64-openwrt-linux-musl-ld: io_uring/zcrx.o: in function `io_release_dmabuf':
13+
io_uring/zcrx.c:94:(.text+0x20): undefined reference to `dma_buf_unmap_attachment_unlocked'
14+
aarch64-openwrt-linux-musl-ld: io_uring/zcrx.c:97:(.text+0x30): undefined reference to `dma_buf_detach'
15+
aarch64-openwrt-linux-musl-ld: io_uring/zcrx.c:99:(.text+0x3c): undefined reference to `dma_buf_put'
16+
aarch64-openwrt-linux-musl-ld: io_uring/zcrx.o: in function `io_import_dmabuf':
17+
io_uring/zcrx.c:125:(.text+0x1b20): undefined reference to `dma_buf_get'
18+
aarch64-openwrt-linux-musl-ld: io_uring/zcrx.c:132:(.text+0x1b34): undefined reference to `dma_buf_attach'
19+
aarch64-openwrt-linux-musl-ld: io_uring/zcrx.c:139:(.text+0x1b48): undefined reference to `dma_buf_map_attachment_unlocked'
20+
make[6]: *** [scripts/Makefile.vmlinux:72: vmlinux.unstripped] Error 1
21+
22+
So, lets use IS_REACHABLE() to check for CONFIG_DMA_SHARED_BUFFER instead
23+
to avoid adding a dependency to CONFIG_DMA_SHARED_BUFFER.
24+
25+
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
26+
---
27+
io_uring/zcrx.c | 4 ++--
28+
1 file changed, 2 insertions(+), 2 deletions(-)
29+
30+
--- a/io_uring/zcrx.c
31+
+++ b/io_uring/zcrx.c
32+
@@ -87,7 +87,7 @@ static int io_populate_area_dma(struct i
33+
34+
static void io_release_dmabuf(struct io_zcrx_mem *mem)
35+
{
36+
- if (!IS_ENABLED(CONFIG_DMA_SHARED_BUFFER))
37+
+ if (!IS_REACHABLE(CONFIG_DMA_SHARED_BUFFER))
38+
return;
39+
40+
if (mem->sgt)
41+
@@ -118,7 +118,7 @@ static int io_import_dmabuf(struct io_zc
42+
return -EINVAL;
43+
if (WARN_ON_ONCE(!ifq->dev))
44+
return -EFAULT;
45+
- if (!IS_ENABLED(CONFIG_DMA_SHARED_BUFFER))
46+
+ if (!IS_REACHABLE(CONFIG_DMA_SHARED_BUFFER))
47+
return -EINVAL;
48+
49+
mem->is_dmabuf = true;

0 commit comments

Comments
 (0)