TBS driver make fails

Bug #1820454 reported by Jason Kitching
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
linux-signed (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

16.04 LTS Kernel 4.4.0-143
When trying to make and install 3rd party drivers from TBSDTV, I receive the following errors during make.

CC [M] /home/user/Drivers/linux-tbs-drivers/v4l/videobuf-dma-sg.o
/home/user/Drivers/linux-tbs-drivers/v4l/videobuf-dma-sg.c: In function 'videobuf_dma_init_user_locked':
/home/user/Drivers/linux-tbs-drivers/v4l/videobuf-dma-sg.c:187:21: warning: passing argument 6 of 'get_user_pages' makes pointer from integer without a cast [-Wint-conversion]
         rw == READ, 1, /* force */
                     ^
In file included from include/linux/scatterlist.h:7:0,
                 from include/linux/dma-mapping.h:10,
                 from /home/user/Drivers/linux-tbs-drivers/v4l/videobuf-dma-sg.c:28:
include/linux/mm.h:1222:6: note: expected 'struct page **' but argument is of type 'int'
 long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
      ^
/home/user/Drivers/linux-tbs-drivers/v4l/videobuf-dma-sg.c:188:9: warning: passing argument 7 of 'get_user_pages' from incompatible pointer type [-Wincompatible-pointer-types]
         dma->pages, NULL);
         ^
In file included from include/linux/scatterlist.h:7:0,
                 from include/linux/dma-mapping.h:10,
                 from /home/user/Drivers/linux-tbs-drivers/v4l/videobuf-dma-sg.c:28:
include/linux/mm.h:1222:6: note: expected 'struct vm_area_struct **' but argument is of type 'struct page **'
 long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
      ^
/home/user/Drivers/linux-tbs-drivers/v4l/videobuf-dma-sg.c:185:8: error: too many arguments to function 'get_user_pages'
  err = get_user_pages(current, current->mm,
        ^
In file included from include/linux/scatterlist.h:7:0,
                 from include/linux/dma-mapping.h:10,
                 from /home/user/Drivers/linux-tbs-drivers/v4l/videobuf-dma-sg.c:28:
include/linux/mm.h:1222:6: note: declared here
 long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
      ^
scripts/Makefile.build:291: recipe for target '/home/user/Drivers/linux-tbs-drivers/v4l/videobuf-dma-sg.o' failed
make[3]: *** [/home/user/Drivers/linux-tbs-drivers/v4l/videobuf-dma-sg.o] Error 1
Makefile:1454: recipe for target '_module_/home/user/Drivers/linux-tbs-drivers/v4l' failed
make[2]: *** [_module_/home/user/Drivers/linux-tbs-drivers/v4l] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-4.4.0-143-generic'
Makefile:51: recipe for target 'default' failed
make[1]: *** [default] Error 2
make[1]: Leaving directory '/home/user/Drivers/linux-tbs-drivers/v4l'
Makefile:26: recipe for target 'all' failed
make: *** [all] Error 2

Same drivers make and install without issue on kernel 4.4.0-142

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux-signed (Ubuntu):
status: New → Confirmed
Revision history for this message
Kleber Sacilotto de Souza (kleber-souza) wrote :

Hello Jason,

This compilation error is caused by the following upstream stable fix we have backported to xenial kernel 4.4.0-143.169:

mm: replace get_user_pages() write/force parameters with gup_flags
https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/xenial/commit/?h=master-next&id=9c72ad08f1510332e9314046e6a2adba5064f39a

This change was needed to fix a security issue and unfortunately the external modules using the get_user_pages() API will need to adapt to the new function signature. The new signature is in place on mainline kernel for a while already (since v4.9-rc2), so it's likely that your module already have code in place to use the new signature.

To fix this module you would need some checking similar to:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 168)
        [use new API...]

Given that this is a known issue and not really a bug in the kernel, I'm going to make this bug report as invalid.

Thank you.

Changed in linux-signed (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.