Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XDMA driver update for Linux 6.5 #262

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions XDMA/linux-kernel/xdma/cdev_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,12 @@ int bridge_mmap(struct file *file, struct vm_area_struct *vma)
* prevent touching the pages (byte access) for swap-in,
* and prevent the pages from being swapped out
*/
#if KERNEL_VERSION(6, 3, 0) <= LINUX_VERSION_CODE
vm_flags_set(vma, VMEM_FLAGS);
#else
vma->vm_flags |= VMEM_FLAGS;
#endif

/* make MMIO accessible to user space */
rv = io_remap_pfn_range(vma, vma->vm_start, phys >> PAGE_SHIFT,
vsize, vma->vm_page_prot);
Expand Down
8 changes: 8 additions & 0 deletions XDMA/linux-kernel/xdma/cdev_sgdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,12 +566,20 @@ static ssize_t cdev_aio_read(struct kiocb *iocb, const struct iovec *io,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
static ssize_t cdev_write_iter(struct kiocb *iocb, struct iov_iter *io)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
return cdev_aio_write(iocb, io->iov, io->nr_segs, io->iov_offset);
#else
return cdev_aio_write(iocb, io->__iov, io->nr_segs, io->iov_offset);
#endif
}

static ssize_t cdev_read_iter(struct kiocb *iocb, struct iov_iter *io)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
return cdev_aio_read(iocb, io->iov, io->nr_segs, io->iov_offset);
#else
return cdev_aio_read(iocb, io->__iov, io->nr_segs, io->iov_offset);
#endif
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion XDMA/linux-kernel/xdma/xdma_cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ int xpdev_create_interfaces(struct xdma_pci_dev *xpdev)

int xdma_cdev_init(void)
{
g_xdma_class = class_create(THIS_MODULE, XDMA_NODE_NAME);
g_xdma_class = class_create(XDMA_NODE_NAME);
if (IS_ERR(g_xdma_class)) {
dbg_init(XDMA_NODE_NAME ": failed to create class");
return -EINVAL;
Expand Down