Moderator Control Panel ]

Drivers won't build (make fails) after Ubuntu kernel update

It's important to keep your driver and software updated.

Drivers won't build (make fails) after Ubuntu kernel update

Postby BlueSky » Sat Mar 16, 2019 3:48 pm

Ubuntu pushed out a kernel update tonight, to 4.4.0-143-generic, and the TBS drivers I have been using for quite some time now fail to build. The problem occurs when running make, specifically when it gets to trying to make videobuf-dma-sg.o although I suspect that even if that module were omitted there would be other failures. It started going wonky here:

Code: Select All Code
  CC [M]  /home/backend/Drivers/linux-tbs-drivers/v4l/videobuf-dma-sg.o
/home/backend/Drivers/linux-tbs-drivers/v4l/videobuf-dma-sg.c: In function 'videobuf_dma_init_user_locked':
/home/backend/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/backend/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/backend/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/backend/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/backend/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/backend/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/backend/Drivers/linux-tbs-drivers/v4l/videobuf-dma-sg.o' failed
make[3]: *** [/home/backend/Drivers/linux-tbs-drivers/v4l/videobuf-dma-sg.o] Error 1
Makefile:1454: recipe for target '_module_/home/backend/Drivers/linux-tbs-drivers/v4l' failed
make[2]: *** [_module_/home/backend/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/backend/Drivers/linux-tbs-drivers/v4l'
Makefile:26: recipe for target 'all' failed
make: *** [all] Error 2


I am running the proprietary drivers, specifically tbs-linux-drivers_v160219 because they have always worked well for me under Ubuntu up until now. I used to upgrade the drivers as new versions were released but then I got a version that mis-identified one of my TBS cards (if I recall correctly it thought a TBS6905 was a TBS6908 or TBS6909 or something like that, and lost all my channels and muxes from that tuner until I went back to the v160219 version). I do see that there is a never version, v170330, but I am not sure it would solve this issue since it was also created prior to these latest kernel changes. For the moment I have rebooted my backend into the previous kernel (4.4.0-142-generic) and that works, but does not allow me to get security upgrades to the kernel.

So I guess my question is, where do I go from here? I really don't want to lose all my muxes, channels, etc. Will you be updating your drivers to build without errors under the new kernel?
BlueSky
 
Posts: 29
Joined: Sat Nov 08, 2014 12:46 pm

Re: Drivers won't build (make fails) after Ubuntu kernel upd

Postby Cheeseborough » Mon Mar 18, 2019 4:18 pm

The same thing has happened to me. I updated the kernel to 4.4.0-143, and got the "incompatible pointer type" error. I am using the version 170330 driver. I have temporarily resolved the problem by backing out the 143 kernel and running 142, however this is not a sustainable solution. I agree with BlueSky, and humbly ask that you update your drivers or issue a patch for the current driver.

I also tried building the driver on my Ubuntu 18.10 machine, that fails for different reasons.
Cheeseborough
 
Posts: 1
Joined: Sat Mar 16, 2019 5:09 pm

Re: Drivers won't build (make fails) after Ubuntu kernel upd

Postby mitja » Wed Mar 20, 2019 8:37 pm

Any news on this?
I am getting the same error, currently reverted kernel back.
mitja
 
Posts: 17
Joined: Fri Jan 10, 2014 5:55 pm

Re: Drivers won't build (make fails) after Ubuntu kernel upd

Postby steven » Thu Mar 21, 2019 4:53 pm

Hi

For 170330 please try to update the kernel to 4.10 then try again with
#sudo rm -rf /lib/modules/`uname -r`/kernel/drivers/media/
1.wget http://www.tbsiptv.com/download/common/ ... 170330.zip
2.unzip tbs-linux-drivers_v170330.zip
3. tar jxvf linux-tbs-drivers.tar.bz2
4. cd linux-tbs-drivers
5. ./v4l/tbs-x86_64.sh
6. make -j4
7.make install
8.restart

Thanks

Kind Regards

steven
steven
 
Posts: 2239
Joined: Fri Aug 06, 2010 3:23 pm

Re: Drivers won't build (make fails) after Ubuntu kernel upd

Postby BlueSky » Fri Mar 22, 2019 12:47 am

steven Wrote:Hi

For 170330 please try to update the kernel to 4.10 then try again with
#sudo rm -rf /lib/modules/`uname -r`/kernel/drivers/media/
1.wget http://www.tbsiptv.com/download/common/ ... 170330.zip
2.unzip tbs-linux-drivers_v170330.zip
3. tar jxvf linux-tbs-drivers.tar.bz2
4. cd linux-tbs-drivers
5. ./v4l/tbs-x86_64.sh
6. make -j4
7.make install
8.restart

Thanks

Kind Regards

steven

If anyone gets this to work in Ubuntu 16.04 I would very much appreciate it if you would let us know exactly what you had to do to get it to work, and in particular how did you update the kernel to 4.10 in Ubuntu.

I have been watching this issue in several places, and it looks like someone (not me) picked up much of the text of my original post and posted it to the Ubuntu bug tracker: https://bugs.launchpad.net/ubuntu/+sour ... ug/1820454

Apparently they do not consider this a bug and have no plans to fix it a future Ubuntu kernel release, which is what I had REALLY hoped would happen. The last post in that thread says this:

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-kerne ... ba5064f39a

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.


It appears this change has broken several other pieces of software, too, particularly some installations of Vmware. As I said in my original post, the reason I had been staying with the 160219 package is because subsequent ones mis-identified one of my TBS tuner cards and lost all the muxes, settings, etc. associated with that card. I'm willing to give the 170330 drivers a try if all else fails, but I'm not sure how to upgrade to the 4.10 kernel. I do know that you can upgrade to the 4.15 kernel in Ubuntu 16.04 server by running

sudo apt-get install --install-recommends linux-generic-hwe-16.04

Which also installs an updated hardware enablement stack of some kind. However when I tried that and then tried to build the 160219 drivers against that it actually failed much earlier in the make process, so I had to go back to the older kernel. So I would be really interested to know if the 170330 drivers will build successfully under the 4.15 kernel. I don't want to dig myself into too deep a hole here because I'm not that proficient in Linux, and I REALLY don't want to completely bork this system.

So that is why I'm asking, if anyone is successful in getting this to work under Ubuntu 16.04 or even 18.04, please let us know exactly what you had to do prior to running steven's instructions, or if you had to make any modifications to his instructions. Thank you!
BlueSky
 
Posts: 29
Joined: Sat Nov 08, 2014 12:46 pm

Re: Drivers won't build (make fails) after Ubuntu kernel upd

Postby BlueSky » Fri Mar 22, 2019 5:58 am

By the way this is what happened when I tried to build the 160219 drivers under the 4.15 kernel:

Code: Select All Code
  CC [M]  /home/satellite/Drivers/linux-tbs-drivers/v4l/saa7146_i2c.o
  CC [M]  /home/satellite/Drivers/linux-tbs-drivers/v4l/saa7146_core.o
  LD [M]  /home/satellite/Drivers/linux-tbs-drivers/v4l/saa7146.o
  CC [M]  /home/satellite/Drivers/linux-tbs-drivers/v4l/saa7146_fops.o
  CC [M]  /home/satellite/Drivers/linux-tbs-drivers/v4l/saa7146_video.o
/home/satellite/Drivers/linux-tbs-drivers/v4l/saa7146_video.c: In function 'video_init':
/home/satellite/Drivers/linux-tbs-drivers/v4l/saa7146_video.c:1307:2: error: implicit declaration of function 'init_timer' [-Werror=implicit-function-declaration]
  init_timer(&vv->video_q.timeout);
  ^
/home/satellite/Drivers/linux-tbs-drivers/v4l/saa7146_video.c:1308:31: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
  vv->video_q.timeout.function = saa7146_buffer_timeout;
                               ^
/home/satellite/Drivers/linux-tbs-drivers/v4l/saa7146_video.c:1309:21: error: 'struct timer_list' has no member named 'data'
  vv->video_q.timeout.data     = (unsigned long)(&vv->video_q);
                     ^
cc1: some warnings being treated as errors
scripts/Makefile.build:332: recipe for target '/home/satellite/Drivers/linux-tbs-drivers/v4l/saa7146_video.o' failed
make[3]: *** [/home/satellite/Drivers/linux-tbs-drivers/v4l/saa7146_video.o] Error 1
Makefile:1551: recipe for target '_module_/home/satellite/Drivers/linux-tbs-drivers/v4l' failed
make[2]: *** [_module_/home/satellite/Drivers/linux-tbs-drivers/v4l] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-4.15.0-46-generic'
Makefile:51: recipe for target 'default' failed
make[1]: *** [default] Error 2
make[1]: Leaving directory '/home/satellite/Drivers/linux-tbs-drivers/v4l'
Makefile:26: recipe for target 'all' failed
make: *** [all] Error 2
Error running make
BlueSky
 
Posts: 29
Joined: Sat Nov 08, 2014 12:46 pm

Re: Drivers won't build (make fails) after Ubuntu kernel upd

Postby iqofafish » Fri Mar 22, 2019 7:42 am

@BlueSky, firstly just to say it was I that opened the bug and yes I did use the vast majority of your paste as it was practically the same as mine give or take. As I was on the askubuntu thread that you started, for ease of use I copied and changed the user details, just to save me trawling through my logs, lazy I know and I apologise for any offence I may have created with my shortcut.

To business. I've got it working on 16.04 LTS. I had to upgrade to the 4.15 HWE kernel and then ran the install guide from https://github.com/tbsdtv/linux_media/wiki. The make from this guide will still fail on 4.4.0-143, at least it did for me.
The make takes ages, like 30 mins+ ages and you will see warnings. I also had to run the dmesg & modprobe commands from https://linuxtv.org/wiki/index.php/TBS_PCIe_card_setup to get my BBC HD channels to lock but that may just have been my local issue as I did find the SAA716x dvb adapter in the blacklist, so I had to remote it and create the new conf file as per the guide, so that bit may not be necessary for you.

Only drawback with those drivers is that the remote doesn't work, but that's a known fault on those. I have a usb infra red lirc receiver somewhere so I may dig that out if using the keyboard because too much of a pain. Least it's now working on a updated kernel and I can relaxing knowing the kernel will continue to get security updates.
iqofafish
 
Posts: 2
Joined: Mon Oct 19, 2015 4:56 am

Re: Drivers won't build (make fails) after Ubuntu kernel upd

Postby BlueSky » Fri Mar 22, 2019 8:16 pm

iqofafish Wrote:@BlueSky, firstly just to say it was I that opened the bug and yes I did use the vast majority of your paste as it was practically the same as mine give or take. As I was on the askubuntu thread that you started, for ease of use I copied and changed the user details, just to save me trawling through my logs, lazy I know and I apologise for any offence I may have created with my shortcut.


No offense taken; I actually really appreciate that you did that. I just wanted to clarify that it wasn't me that posted it there; I would not even have known how to do that.

iqofafish Wrote:To business. I've got it working on 16.04 LTS. I had to upgrade to the 4.15 HWE kernel and then ran the install guide from https://github.com/tbsdtv/linux_media/wiki.


Those are not the drivers we're talking about here. Those are the so-called "open source" drivers which for some reason did not work for me when I tried them, though I don't remember what the exact problem was. What I am wanting to know is if anyone is able to build either the 160219 version of the drivers, which is what I have been using, or the 170330 drivers from http://www.tbsiptv.com/download/common/ ... 170330.zip as mentioned in steven's post. The open source drivers are a different animal entirely and only support a subset of TBS cards.

I'm glad they worked for you but I really hope someone will try the original TBS drivers and report if they have any success building them under the 4.15 HWE kernel. Thank you.
Last edited by BlueSky on Sat Mar 23, 2019 5:54 am, edited 1 time in total.
BlueSky
 
Posts: 29
Joined: Sat Nov 08, 2014 12:46 pm

Re: Drivers won't build (make fails) after Ubuntu kernel upd

Postby iqofafish » Fri Mar 22, 2019 10:09 pm

Apologies I should have stated that they were the Open Source ones. The list of cards they support didn't look that much different to me and had my card listed, hence why I tried them.

The ones I use aren't ideal, but hopefully TBS support get a new set up and running
iqofafish
 
Posts: 2
Joined: Mon Oct 19, 2015 4:56 am

Re: Drivers won't build (make fails) after Ubuntu kernel upd

Postby BlueSky » Sun Mar 31, 2019 6:46 am

I did not want to post this until I'd had a chance to try this personally, which I did this afternoon, and it worked for me. CrazyCat has patched the four files that needed to be patched in order for the drivers to build under the new Ubuntu 4.4.0-143-generic kernel. You can find the patches at this link:

https://bitbucket.org/CrazyCat/linux-tb ... c57ede115b

You can directly download the four patched files (these are the full files that are already patched, not patch files) using these links. Use sudo wget if you are doing it on your Linux system:

https://bitbucket.org/CrazyCat/linux-tb ... ivtv-yuv.c
https://bitbucket.org/CrazyCat/linux-tb ... vtv-udma.c
https://bitbucket.org/CrazyCat/linux-tb ... f-dma-sg.c
https://bitbucket.org/CrazyCat/linux-tb ... 2-dma-sg.c

Then you need to copy them over the existing driver files.

ivtv-udma.c and ivtv-yuv.c would get copied over the same-named files in ...../linux-tbs-drivers/linux/drivers/media/video/ivtv
videobuf2-dma-sg.c and videobuf-dma-sg.c would get copied over the same-named files in ...../linux-tbs-drivers/linux/drivers/media/video

You may or may not need to fix permissions and ownership on the copied files. I did not show full paths above because they would be different on every system.

Then you should be able to do the make, make install, etc.

This will NOT work if you are running the Linux HWE kernel, in other words the 4.15.0-46-generic kernel. But it should be good for anything in the 4.4.0-*-generic kernel series, at least I hope so!

Thanks very much to CrazyCat for these fixes!
BlueSky
 
Posts: 29
Joined: Sat Nov 08, 2014 12:46 pm

Next

Return to Driver & Software Update

Who is online

Users browsing this forum: No registered users and 13 guests