From 054718358f45ec8f65fdc8ec152e89a18f6b889c Mon Sep 17 00:00:00 2001 From: hades DAQ on depc418/hadeswrp01 Date: Thu, 4 Apr 2019 14:59:23 +0200 Subject: [PATCH] JAM: fixed pexor kernel module for kernel 5.0.3 --- pexor/kernel-module/Makefile | 2 ++ pexor/kernel-module/pexor_trb.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pexor/kernel-module/Makefile b/pexor/kernel-module/Makefile index 21012e2..026836e 100644 --- a/pexor/kernel-module/Makefile +++ b/pexor/kernel-module/Makefile @@ -16,6 +16,8 @@ PWD := $(shell pwd) TARGETS = pexor.ko +ccflags-y +=-Wno-date-time + all: $(TARGETS) .PHONY: distclean diff --git a/pexor/kernel-module/pexor_trb.c b/pexor/kernel-module/pexor_trb.c index 65fbc56..4be0b38 100644 --- a/pexor/kernel-module/pexor_trb.c +++ b/pexor/kernel-module/pexor_trb.c @@ -45,6 +45,10 @@ static struct class* pexor_class; static dev_t pexor_devt; static int my_major_nr = 0; +//#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) +static u64 pexor_dma_mask = DMA_BIT_MASK(32); +//#endif + struct dev_pexor { u32* irq_control; /* irq control register */ @@ -629,7 +633,6 @@ int probe(struct pci_dev* dev, /* TODO: export special things to class in sysfs ? */ - if (!IS_ERR(pexor_class)) { /* driver init had successfully created class, now we create device: */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) @@ -654,6 +657,9 @@ int probe(struct pci_dev* dev, support here: */ pexor_msg(KERN_ERR "Could not add PEXOR device node to /dev !"); } + + /** JAM 4-APR-2019: try this for kernel 5.0.3*/ + priv->class_dev->dma_mask = &pexor_dma_mask; /* init pexor_dma buffer */ if (pexor_alloc_dma_buffer(priv, DMA_BUFFER_NUM_PAGES * PAGE_SIZE) != 0) { -- 2.43.0