"_raw_spin_lock" undefined for Stretch on Pi 3 B+

Bug #1776851 reported by Mr Slugre
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Raspbian
New
Undecided
Unassigned

Bug Description

I'm trying to compile a driver on the RaspberryPi 3 B+ (using Raspbian Stretch) and I get the following warnings:

WARNING: "_raw_spin_lock_bh" [/home/pi/linuxcan/linuxcan/common/kvcommon.ko] undefined!
WARNING: "_raw_spin_unlock_irqrestore" [/home/pi/linuxcan/linuxcan/common/kvcommon.ko] undefined!
WARNING: "_raw_spin_unlock_bh" [/home/pi/linuxcan/linuxcan/common/kvcommon.ko] undefined!
WARNING: "_raw_spin_lock" [/home/pi/linuxcan/linuxcan/common/kvcommon.ko] undefined!
WARNING: "_raw_spin_lock_irqsave" [/home/pi/linuxcan/linuxcan/common/kvcommon.ko] undefined!

These seems like serious warnings to me, and when trying to load the module, I get the following error:

Jun 11 07:00:13 ida kernel: [ 1397.943764] usb 1-1.3: new high-speed USB device number 6 using dwc_otg
Jun 11 07:00:13 ida kernel: [ 1398.074305] usb 1-1.3: New USB device found, idVendor=0bfd, idProduct=0104
Jun 11 07:00:13 ida kernel: [ 1398.074318] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jun 11 07:00:13 ida kernel: [ 1398.074326] usb 1-1.3: Product: Kvaser Memorator Pro 5xHS
Jun 11 07:00:13 ida kernel: [ 1398.074335] usb 1-1.3: Manufacturer: Kvaser AB
Jun 11 07:00:13 ida mtp-probe: checking bus 1, device 6: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3"
Jun 11 07:00:13 ida mtp-probe: bus: 1, device: 6 was not an MTP device
Jun 11 07:00:16 ida kernel: [ 1401.191291] kvcommon: disagrees about version of symbol module_layout
Jun 11 07:00:16 ida /usr/sbin/mhydra.sh: modprobe: ERROR: could not insert 'mhydra': Exec format error
Jun 11 07:00:16 ida systemd-udevd[3391]: Process '/usr/sbin/mhydra.sh start' failed with exit code 1.

Here I assume that the "disagrees about version of symbol" has something to do with the missing "_raw_spin_lock" above...

The code is using "raw_spinlock" calls which seems to be translated into these "_raw_spin_lock" by 'linux/spinlock.h' but from here I have no clue what to look for...

I have successfully built the same driver on a Raspberry Pi 3 Model B Rev 1.2 (i.e. not a '+') using identical FW version hash and version of Linux kernel

The driver I'm trying to compile is available at https://www.kvaser.com/downloads-kvaser/?utm_source=software&utm_ean=7330130980754&utm_status=latest

My environment:
Raspbian GNU/Linux 9 (stretch)
Linux ida 4.14.34-v7+ #1110 SMP Mon Apr 16 15:18:51 BST 2018 armv7l GNU/Linux
Raspberry Pi 3 Model B Plus Rev 1.3
FW version: af8084725947aa2c7314172068f79dad9be1c8b4 (clean) (release)
FW version hash in the target system: 5db8e4e1c63178e200d6fbea23ed4a9bf4656658
version of Linux kernel in the system: f70eae405b5d75f7c41ea300b9f790656f99a203

Mr Slugre (slugre)
summary: - "_raw_spin_lock" undefined for Stretch on Pi B+
+ "_raw_spin_lock" undefined for Stretch on Pi 3 B+
description: updated
Revision history for this message
Mr Slugre (slugre) wrote :

I just retested this on a new RPI3B+, and it works if you read and follow the blog https://www.kvaser.com/developer-blog/building-canlib-linuxcan-raspberry-pi/

When the build failed, I probably used the wrong symbols:

# For RaspberryPi Model B and B+
$ wget https://raw.github.com/raspberrypi/firmware/$RPI_FW_REV/extra/Module.symvers

# For RaspberryPi 2 and 3
$ wget https://raw.github.com/raspberrypi/firmware/$RPI_FW_REV/extra/Module7.symvers -O Module.symvers

This report can be closed.

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.