Git Product home page Git Product logo

Comments (10)

Arnoud-Bleeker avatar Arnoud-Bleeker commented on August 17, 2024 2

I had a similar issue changing make -C $(KDIR) SUBDIRS=pwd modules to make -C $(KDIR) M=$(shell pwd) modules in the makefile solved it.

from riffa.

marzoul avatar marzoul commented on August 17, 2024

Hi,
I have never tried the make debug target, this compilation recipe may lack maintenance.
It is probably not what you want to compile the driver, just use make, no sudo should be needed.
Then proceed to installation with sudo.
Or, maybe you have not installed the Linux kernel headers package ?

from riffa.

marzoul avatar marzoul commented on August 17, 2024

I've just realized that the proposed fix is nearly exactly the patch I did 2 years ago for the Archlinux user package 😅
At that time I had no visibility about whether or not this change would be appropriate for other distros too.
https://aur.archlinux.org/packages/riffa-git
@Arnoud-Bleeker if you want to author a PR you would be welcome. Or I can do it in a few days.

from riffa.

bartokon avatar bartokon commented on August 17, 2024

Ubuntu 22.04.1
`
Compiling driver for kernel: 6.2.0-39-generic with the following values
NAME: 'riffa'
MAJNUM: '100'
VENDOR_ID0: '10EE'
VENDOR_ID1: '1172'

sed -i 's/#define MAJOR_NUM [^\n]/#define MAJOR_NUM 100/g' riffa_driver.h
sed -i 's/#define DEVICE_NAME [^\n]
/#define DEVICE_NAME "riffa"/g' riffa_driver.h
sed -i 's/#define VENDOR_ID0 [^\n]/#define VENDOR_ID0 0x10EE/g' riffa_driver.h
sed -i 's/#define VENDOR_ID1 [^\n]
/#define VENDOR_ID1 0x1172/g' riffa_driver.h
sed -i 's/#define DEBUG [^\n]/#define DBUG 1/g' riffa_driver.h
sed -i 's/#define DBUG [^\n]
/#define DBUG 1/g' riffa_driver.h
echo "make -C /lib/modules/uname -r/build SUBDIRS=pwd modules"
make -C /lib/modules/6.2.0-39-generic/build SUBDIRS=/home/bartek/riffa/driver/linux modules
make -C /lib/modules/uname -r/build M=/home/bartek/riffa/driver/linux modules
make[1]: Entering directory '/usr/src/linux-headers-6.2.0-39-generic'
CC [M] /home/bartek/riffa/driver/linux/riffa_driver.o
/home/bartek/riffa/driver/linux/riffa_driver.c: In function ‘fill_sg_buf’:
/home/bartek/riffa/driver/linux/riffa_driver.c:469:29: error: too few arguments to function ‘get_user_pages’
469 | num_pages = get_user_pages(udata, num_pages_reqd, FOLL_WRITE, pages);
| ^~~~~~~~~~~~~~
In file included from ./include/linux/scatterlist.h:8,
from ./include/linux/dmapool.h:14,
from ./include/linux/pci.h:1555,
from /home/bartek/riffa/driver/linux/riffa_driver.c:52:
./include/linux/mm.h:2129:6: note: declared here
2129 | long get_user_pages(unsigned long start, unsigned long nr_pages,
| ^~~~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:260: /home/bartek/riffa/driver/linux/riffa_driver.o] Error 1
make[1]: *** [Makefile:2026: /home/bartek/riffa/driver/linux] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.2.0-39-generic'
make: *** [Makefile:102: riffa.ko] Error 2
makefile change:
echo "make -C $(KDIR) SUBDIRS=pwd modules"
make -C $(KDIR) M=$(shell pwd) modules
`
what can be the cause?

from riffa.

marzoul avatar marzoul commented on August 17, 2024

Hi, I prepared fixes some time ago to compile with linux 6.5.
Your issue with get_user_pages seems part of what I fixed on my side.
I am not sure exactly what versions of linux introduced the changes.
master...marzoul:riffa:linux-65

from riffa.

bartokon avatar bartokon commented on August 17, 2024

Yea but I'm already using code from "master" branch so it already includes your fix. Idk why but it seems like #define if else doesn't detect kernel version correctly. Linux version code.... how to get that number?

bartek@bartek-MS-7D25:~/riffa/driver/linux$ uname -a
Linux bartek-MS-7D25 6.2.0-39-generic #40~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 16 10:53:04 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

and shall I change it in version.h?

bartek@bartek-MS-7D25:~/riffa/driver/linux$ uname -r
6.2.0-39-generic

from riffa.

marzoul avatar marzoul commented on August 17, 2024

You are compiling for linux 6.2 so it is worth trying to lower the version "threshold" in the code of riffa_driver.c near line 466 probably. Change this :
#elsif LINUX_VERSION_CODE < KERNEL_VERSION(6,5,0)
into this :
#elsif LINUX_VERSION_CODE < KERNEL_VERSION(6,2,0)

from riffa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.