module fails to load under kernel 4.6 or 4.2

Bug #1572536 reported by Owen Savill
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
crystalhd (Ubuntu)
New
Undecided
Unassigned

Bug Description

Attempting to build this package under kernel 4.6 or 4.2 results in numerous errors, mainly with __devinit and __devexit .

I replaced __devexit with __exit and __devinit with __init. I also replaced calls to check_mem_region with calls to request_mem_region and page_cache_release with put_page. The module then builds but the kernel asserts at start up when attempting to load the module and then fails to boot any further. I believe a panic message is triggered but have been unable to capture this.

from the logs:
syslog.1:Apr 20 11:27:27 owen-AOA150 kernel: [ 7.144700] crystalhd: module verification failed: signature and/or required key missing - tainting kernel
syslog.1:Apr 20 11:27:27 owen-AOA150 kernel: [ 7.152755] Loading crystalhd v3.10.0
syslog.1:Apr 20 11:27:27 owen-AOA150 kernel: [ 7.152849] crystalhd 0000:03:00.0: Starting Device:0x1615
syslog.1:Apr 20 11:27:27 owen-AOA150 kernel: [ 7.155801] crystalhd 0000:03:00.0: BAR 0: can't reserve [mem 0x70800000-0x7080ffff 64bit]
syslog.1:Apr 20 11:27:27 owen-AOA150 kernel: [ 7.155827] crystalhd 0000:03:00.0: chd_dec_pci_probe: Failed to set up memory regions.
syslog.1:Apr 20 11:27:27 owen-AOA150 kernel: [ 7.161108] crystalhd: probe of 0000:03:00.0 failed with error -16
syslog.1:Apr 20 11:27:27 owen-AOA150 kernel: [ 10.689896] Modules linked in: rt73usb(+) rt2x00usb rt2x00lib snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel mac80211 snd_hda_codec snd_hda_core cfg80211 snd_hwdep snd_pcm sparse_keymap snd_seq_midi crc_itu_t snd_seq_midi_event snd_rawmidi uvcvideo videobuf2_vmalloc snd_seq videobuf2_memops acerhdf videobuf2_v4l2 snd_seq_device coretemp videobuf2_core snd_timer joydev videodev input_leds media snd serio_raw lpc_ich crystalhd(OE) soundcore shpchp mac_hid parport_pc ppdev lp parport autofs4 i915 i2c_algo_bit drm_kms_helper syscopyarea sysfillrect psmouse sysimgblt fb_sys_fops r8169 drm pata_acpi mii fjes video wmi

kern.log:Apr 20 11:31:26 owen-AOA150 kernel: [ 90.967650] crystalhd: disagrees about version of symbol module_layout
kern.log:Apr 20 11:32:50 owen-AOA150 kernel: [ 175.127641] crystalhd: module verification failed: signature and/or required key missing - tainting kernel
kern.log:Apr 20 11:32:50 owen-AOA150 kernel: [ 175.129387] Loading crystalhd v3.10.0
kern.log:Apr 20 11:32:50 owen-AOA150 kernel: [ 175.129487] crystalhd 0000:03:00.0: Starting Device:0x1615
kern.log:Apr 20 11:32:50 owen-AOA150 kernel: [ 175.129796] crystalhd 0000:03:00.0: BAR 0: can't reserve [mem 0x70800000-0x7080ffff 64bit]
kern.log:Apr 20 11:32:50 owen-AOA150 kernel: [ 175.129816] crystalhd 0000:03:00.0: chd_dec_pci_probe: Failed to set up memory regions.
kern.log:Apr 20 11:32:50 owen-AOA150 kernel: [ 175.130007] crystalhd: probe of 0000:03:00.0 failed with error -16
kern.log:Apr 20 12:35:42 owen-AOA150 kernel: [ 3282.646749] crystalhd: module verification failed: signature and/or required key missing - tainting kernel

So it appears that my use of request_mem_region is probably wrong.

It would be really great to get this module going again as many netbooks, including mine, have this card.

Revision history for this message
Owen Savill (osavill) wrote :

Or if preferred I am more than willing to pursue this but I need some help as low level kernel drivers are not where my experience is, but I'd love to learn as there is another device I've been itching to get working in Linux for ages!

summary: - module fails to build under kernel 4.6 or 4.2
+ module fails to load under kernel 4.6 or 4.2
description: updated
Revision history for this message
Dan Lenski (lenski) wrote :

Hi Owen, you might want to take a look over on Github where I and others have modified the source package to build without errors for recent kernels. I'm using it on kernel 4.4.0 under Ubuntu Xenial current:

https://github.com/dbason/crystalhd

Revision history for this message
Owen Savill (osavill) wrote :
Download full text (4.0 KiB)

Hi Dan,

Many thanks for doing this. I am currently running the 4.6 branch and when compiling I get the following output:
In file included from include/linux/mutex.h:13:0,
                 from include/linux/kernfs.h:13,
                 from include/linux/sysfs.h:15,
                 from include/linux/kobject.h:21,
                 from include/linux/device.h:17,
                 from /home/owen/CrystalHD/crystalhd/driver/linux/crystalhd_misc.c:27:
/home/owen/CrystalHD/crystalhd/driver/linux/crystalhd_misc.c: In function ‘crystalhd_map_dio’:
./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/owen/CrystalHD/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/owen/CrystalHD/crystalhd/driver/linux/crystalhd_lnx.h:34:0,
                 from /home/owen/CrystalHD/crystalhd/driver/linux/crystalhd_misc.c:30:
include/linux/mm.h:1253: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 include/linux/mutex.h:13:0,
                 from include/linux/kernfs.h:13,
                 from include/linux/sysfs.h:15,
                 from include/linux/kobject.h:21,
                 from include/linux/device.h:17,
                 from /home/owen/CrystalHD/crystalhd/driver/linux/crystalhd_misc.c:27:
./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/owen/CrystalHD/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/owen/CrystalHD/crystalhd/driver/linux/crystalhd_lnx.h:34:0,
                 from /home/owen/CrystalHD/crystalhd/driver/linux/crystalhd_misc.c:30:
include/linux/mm.h:1253: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/owen/CrystalHD/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/owen/CrystalHD/crystalhd/driver/linux/crystalhd_lnx.h:34:0,
                 from /home/owen/CrystalHD/crystalhd/driver/linux/crystalhd_misc.c:30:
include/linux/mm.h:1253:6: note: expected ‘struct page **’ but argument is of type ‘int’
 long get_user_pages(unsigned long start, unsigned long nr_pages,
      ^
/home/owen/CrystalHD/crystalhd/driver/linux/crystalhd_misc.c:655:8: error: too many arguments to function ‘get_user_pages’
  res = get_user_pages(current, current-...

Read more...

Revision history for this message
Owen Savill (osavill) wrote :

I've now compiled your source running 4.4 and it all complies and the module is loaded, but nothing seem to use is and all video is decoded in s/w. Do you have a test video I can try it on?

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.