From 03fc9fc3b986d617c808bdb2687d4e3280e73ca3 Mon Sep 17 00:00:00 2001 From: Vlad-Gabriel Serbu Date: Thu, 16 Apr 2026 17:45:59 +0100 Subject: [PATCH 1/3] Fix vm_flags setting for kernel >=6.3.0 Signed-off-by: Vlad-Gabriel Serbu --- driver/slash_dmabuf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/driver/slash_dmabuf.c b/driver/slash_dmabuf.c index d8197526..a8f9439c 100644 --- a/driver/slash_dmabuf.c +++ b/driver/slash_dmabuf.c @@ -45,6 +45,7 @@ #include #include #include +#include /** * struct slash_bar_dmabuf_data - Private data attached to each BAR dma-buf. @@ -180,8 +181,13 @@ static int slash_bar_dmabuf_mmap(struct dma_buf *dmabuf, struct vm_area_struct * * VM_DONTCOPY — do not inherit across fork(); BAR register * mappings should not be silently shared with children. */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) + vm_flags_set(vma, VM_PFNMAP | VM_IO | VM_DONTDUMP | + VM_DONTEXPAND | VM_DONTCOPY); +#else vma->vm_flags |= VM_PFNMAP | VM_IO | VM_DONTDUMP | VM_DONTEXPAND | VM_DONTCOPY; +#endif wc = !!(pci_resource_flags(priv->pdev, priv->bar_number) & IORESOURCE_PREFETCH); vma->vm_page_prot = wc ? pgprot_writecombine(vma->vm_page_prot) From a96d296a56caa4972ba9212544f4948cb1e90bc9 Mon Sep 17 00:00:00 2001 From: Vlad-Gabriel Serbu Date: Thu, 16 Apr 2026 17:47:01 +0100 Subject: [PATCH 2/3] Remove incorrect __exit for slash_qdma_exit (called from __init code) Signed-off-by: Vlad-Gabriel Serbu --- driver/slash_qdma.c | 2 +- driver/slash_qdma.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/driver/slash_qdma.c b/driver/slash_qdma.c index c4c9ca5e..3e09061b 100644 --- a/driver/slash_qdma.c +++ b/driver/slash_qdma.c @@ -819,7 +819,7 @@ int __init slash_qdma_init(unsigned int num_threads, char *debugfs) * (which triggers slash_qdma_remove() for each probed device) and then * shuts down the libqdma library. */ -void __exit slash_qdma_exit(void) +void slash_qdma_exit(void) { SLASH_QDMA_OP_LOG("exit start\n"); diff --git a/driver/slash_qdma.h b/driver/slash_qdma.h index d478ab15..1c873939 100644 --- a/driver/slash_qdma.h +++ b/driver/slash_qdma.h @@ -59,6 +59,6 @@ int __init slash_qdma_init(unsigned int num_threads, char *debugfs); * Must be called after slash_pcie_exit() to ensure the control * function is cleaned up before the QDMA function. */ -void __exit slash_qdma_exit(void); +void slash_qdma_exit(void); #endif /* SLASH_QDMA_H */ From 185ec627dc1949137219e669fba439dc895d1314 Mon Sep 17 00:00:00 2001 From: Vlad-Gabriel Serbu Date: Thu, 16 Apr 2026 17:58:25 +0100 Subject: [PATCH 3/3] Updated MODULE_IMPORT_NS usage for kernel >=6.13 Signed-off-by: Vlad-Gabriel Serbu --- driver/slash_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/driver/slash_main.c b/driver/slash_main.c index 8089159b..7be77b54 100644 --- a/driver/slash_main.c +++ b/driver/slash_main.c @@ -49,6 +49,7 @@ #include #include #include +#include #include "slash_pcie.h" #include "slash_hotplug_driver.h" @@ -126,4 +127,8 @@ MODULE_LICENSE("GPL"); MODULE_AUTHOR("AMD Inc."); MODULE_DESCRIPTION("SLASH/VRT module"); MODULE_VERSION("1.0"); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0) +MODULE_IMPORT_NS("DMA_BUF"); +#else MODULE_IMPORT_NS(DMA_BUF); +#endif