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) 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 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 */