I'm running Debian 8 with kernel 4.6.3 (from jessie-backports) and gcc 4.9.2. I was trying to compile the crystalhd driver, when I got the following compile errors:
nticompass@adventuretime linux % make -j2
make -C /lib/modules/4.6.0-0.bpo.1-686-pae/build SUBDIRS=/home/nticompass/src/crystalhd/driver/linux modules
make[1]: Entering directory '/usr/src/linux-headers-4.6.0-0.bpo.1-686-pae'
CC [M] /home/nticompass/src/crystalhd/driver/linux/crystalhd_lnx.o
CC [M] /home/nticompass/src/crystalhd/driver/linux/crystalhd_misc.o
In file included from /usr/src/linux-headers-4.6.0-0.bpo.1-common/include/linux/mutex.h:13:0,
from /usr/src/linux-headers-4.6.0-0.bpo.1-common/include/linux/kernfs.h:13,
from /usr/src/linux-headers-4.6.0-0.bpo.1-common/include/linux/sysfs.h:15,
from /usr/src/linux-headers-4.6.0-0.bpo.1-common/include/linux/kobject.h:21,
from /usr/src/linux-headers-4.6.0-0.bpo.1-common/include/linux/device.h:17,
from /home/nticompass/src/crystalhd/driver/linux/crystalhd_misc.c:27:
/home/nticompass/src/crystalhd/driver/linux/crystalhd_misc.c: In function ‘crystalhd_map_dio’:
/usr/src/linux-headers-4.6.0-0.bpo.1-common/arch/x86/include/asm/current.h:17:17: error: passing argument 1 of ‘get_user_pages’ makes integer from pointer without a cast [-Werror]
#define current get_current()
^
/home/nticompass/src/crystalhd/driver/linux/crystalhd_misc.c:655:23: note: in expansion of macro ‘current’
res = get_user_pages(current, current->mm, uaddr, nr_pages, rw == READ,
^
In file included from /home/nticompass/src/crystalhd/driver/linux/crystalhd_lnx.h:34:0,
from /home/nticompass/src/crystalhd/driver/linux/crystalhd_misc.c:30:
/usr/src/linux-headers-4.6.0-0.bpo.1-common/include/linux/mm.h:1288:6: note: expected ‘long unsigned int’ but argument is of type ‘struct task_struct *’
long get_user_pages(unsigned long start, unsigned long nr_pages,
^
In file included from /usr/src/linux-headers-4.6.0-0.bpo.1-common/include/linux/mutex.h:13:0,
from /usr/src/linux-headers-4.6.0-0.bpo.1-common/include/linux/kernfs.h:13,
from /usr/src/linux-headers-4.6.0-0.bpo.1-common/include/linux/sysfs.h:15,
from /usr/src/linux-headers-4.6.0-0.bpo.1-common/include/linux/kobject.h:21,
from /usr/src/linux-headers-4.6.0-0.bpo.1-common/include/linux/device.h:17,
from /home/nticompass/src/crystalhd/driver/linux/crystalhd_misc.c:27:
/usr/src/linux-headers-4.6.0-0.bpo.1-common/arch/x86/include/asm/current.h:17:17: error: passing argument 2 of ‘get_user_pages’ makes integer from pointer without a cast [-Werror]
#define current get_current()
^
/home/nticompass/src/crystalhd/driver/linux/crystalhd_misc.c:655:32: note: in expansion of macro ‘current’
res = get_user_pages(current, current->mm, uaddr, nr_pages, rw == READ,
^
In file included from /home/nticompass/src/crystalhd/driver/linux/crystalhd_lnx.h:34:0,
from /home/nticompass/src/crystalhd/driver/linux/crystalhd_misc.c:30:
/usr/src/linux-headers-4.6.0-0.bpo.1-common/include/linux/mm.h:1288:6: note: expected ‘long unsigned int’ but argument is of type ‘struct mm_struct *’
long get_user_pages(unsigned long start, unsigned long nr_pages,
^
/home/nticompass/src/crystalhd/driver/linux/crystalhd_misc.c:655:62: error: passing argument 5 of ‘get_user_pages’ makes pointer from integer without a cast [-Werror]
res = get_user_pages(current, current->mm, uaddr, nr_pages, rw == READ,
^
In file included from /home/nticompass/src/crystalhd/driver/linux/crystalhd_lnx.h:34:0,
from /home/nticompass/src/crystalhd/driver/linux/crystalhd_misc.c:30:
/usr/src/linux-headers-4.6.0-0.bpo.1-common/include/linux/mm.h:1288:6: note: expected ‘struct page **’ but argument is of type ‘int’
long get_user_pages(unsigned long start, unsigned long nr_pages,
^
/home/nticompass/src/crystalhd/driver/linux/crystalhd_misc.c:655:8: error: too many arguments to function ‘get_user_pages’
res = get_user_pages(current, current->mm, uaddr, nr_pages, rw == READ,
^
In file included from /home/nticompass/src/crystalhd/driver/linux/crystalhd_lnx.h:34:0,
from /home/nticompass/src/crystalhd/driver/linux/crystalhd_misc.c:30:
/usr/src/linux-headers-4.6.0-0.bpo.1-common/include/linux/mm.h:1288:6: note: declared here
long get_user_pages(unsigned long start, unsigned long nr_pages,
^
/home/nticompass/src/crystalhd/driver/linux/crystalhd_misc.c: In function ‘crystalhd_unmap_dio’:
/home/nticompass/src/crystalhd/driver/linux/crystalhd_misc.c:754:5: error: implicit declaration of function ‘page_cache_release’ [-Werror=implicit-function-declaration]
page_cache_release(page);
^
cc1: all warnings being treated as errors
/usr/src/linux-headers-4.6.0-0.bpo.1-common/scripts/Makefile.build:296: recipe for target '/home/nticompass/src/crystalhd/driver/linux/crystalhd_misc.o' failed
make[4]: *** [/home/nticompass/src/crystalhd/driver/linux/crystalhd_misc.o] Error 1
make[4]: *** Waiting for unfinished jobs....
/usr/src/linux-headers-4.6.0-0.bpo.1-common/Makefile:1446: recipe for target '_module_/home/nticompass/src/crystalhd/driver/linux' failed
make[3]: *** [_module_/home/nticompass/src/crystalhd/driver/linux] Error 2
Makefile:146: recipe for target 'sub-make' failed
make[2]: *** [sub-make] Error 2
Makefile:8: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.6.0-0.bpo.1-686-pae'
Makefile:33: recipe for target 'all' failed
make: *** [all] Error 2
I'm not sure what's causing this. This repo used to work (when I lasted tested it on kernel 4.1). Not sure if this is a kernel or gcc issue.
This is a change in kernel 4.6. I'm not sure when this change was implemented, but get_user_pages needs to be get_user_pages_remote (and page_cache_release needs to be put_page).
I'm running Debian 8 with kernel 4.6.3 (from jessie-backports) and gcc 4.9.2. I was trying to compile the crystalhd driver, when I got the following compile errors:
I'm not sure what's causing this. This repo used to work (when I lasted tested it on kernel 4.1). Not sure if this is a kernel or gcc issue.