Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions driver/slash_dmabuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <linux/pci.h>
#include <linux/printk.h>
#include <linux/slab.h>
#include <linux/version.h>

/**
* struct slash_bar_dmabuf_data - Private data attached to each BAR dma-buf.
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions driver/slash_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/printk.h>
#include <linux/version.h>

#include "slash_pcie.h"
#include "slash_hotplug_driver.h"
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion driver/slash_qdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
2 changes: 1 addition & 1 deletion driver/slash_qdma.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Loading