Skip to content
Closed
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
2 changes: 1 addition & 1 deletion core_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ static int mxdma_bar_mmap_v1(struct mx_pci_dev *mx_pdev,
}

vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) || RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 6)
vm_flags_set(vma, VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP);
#else
vma->vm_flags |= (VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP);
Expand Down
6 changes: 3 additions & 3 deletions init.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ static const struct pci_device_id pci_ids[] = {
MODULE_DEVICE_TABLE(pci, pci_ids);

#ifndef CONFIG_WO_CXL
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0) && RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(9, 6)
static int match_mem_prefix(struct device *dev, void *data)
#else
static int match_mem_prefix(struct device *dev, const void *data)
Expand Down Expand Up @@ -659,7 +659,7 @@ static struct pci_driver pci_driver = {
};
#endif

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 6)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 6) && RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(9, 6)
static char *mxdma_devnode(struct device *dev, umode_t *mode)
#else
static char *mxdma_devnode(const struct device *dev, umode_t *mode)
Expand Down Expand Up @@ -715,7 +715,7 @@ static struct notifier_block mxdma_pci_notifier = {

static int mxdma_init(void)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 3)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 3) && RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(9, 6)
mxdma_class = class_create(THIS_MODULE, MXDMA_NODE_NAME);
#else
mxdma_class = class_create(MXDMA_NODE_NAME);
Expand Down
8 changes: 8 additions & 0 deletions mx_dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
#include <linux/cdev.h>
#include <linux/delay.h>
#include <linux/version.h>

/* RHEL ships a 5.14 kernel but backports later mainline APIs, so a bare
* LINUX_VERSION_CODE test picks the wrong branch; guards below also gate on
* RHEL_RELEASE_CODE, stubbed here to lose every comparison off RHEL. */
#ifndef RHEL_RELEASE_CODE
#define RHEL_RELEASE_CODE 0
#define RHEL_RELEASE_VERSION(a, b) 1
#endif
#include <linux/errno.h>
#include <linux/pci.h>
#include <linux/aer.h>
Expand Down