newracom / nrc7292_sw_pkg

NRC7292 Software Package for Host mode (Linux OS)
http://www.newracom.com/product
GNU General Public License v2.0
58 stars 27 forks source link

Raspberry Pi 4 CS0 already in use #76

Open Avamander opened 1 year ago

Avamander commented 1 year ago

After installing the kernel module, the relevant overlays (.dtbo's) for the Raspberry Pi 4, I still can't load the module because the SPI CS0 seems to be in use.

Kernel and distribution: 5.15.0-1033-raspi Ubuntu 22.04.2 LTS

$ cat /sys/class/spi_master/spi0/spi0.0/modalias 
spi:nrc80211

dmesg:

[  192.677568] nrc: loading out-of-tree module taints kernel.
[  192.746704] spi-bcm2835 fe204000.spi: chipselect 0 already in use
[  192.748805] [Error] failed to instantiate a new spi device.
[  192.750930] failed to initialize hif
[  192.750968] nrc80211: probe of nrc80211 failed with error -22

How would I go about finding out why spi0.0 is supposedly already in use?

enganguish commented 1 year ago

Could you show me the execution results of below?

Avamander commented 1 year ago

@enganguish

$ ls -al /dev (pty and tty filtered out)

total 4
drwxr-xr-x 17 root root       14180 Jul 14 12:37 .
drwxr-xr-x 22 root root        4096 Jul 14 12:38 ..
crw-r--r--  1 root root     10, 235 Jul 14 12:37 autofs
drwxr-xr-x  2 root root         400 Jul 14 12:38 block
drwxr-xr-x  2 root root          60 Jul 14 12:34 bsg
crw-rw----  1 root disk     10, 234 Jul 14 12:37 btrfs-control
drwxr-xr-x  3 root root          60 Jan  1  1970 bus
drwxr-xr-x  2 root root       13420 Jul 14 12:37 char
lrwxrwxrwx  1 root root          11 Jul 14 12:37 core -> /proc/kcore
crw-------  1 root root     10, 124 Jul 14 12:37 cpu_dma_latency
crw-------  1 root root     10, 203 Jul 14 12:37 cuse
drwxr-xr-x  7 root root         140 Jan  1  1970 disk
drwxr-xr-x  2 root root          80 Jan  1  1970 dma_heap
crw-rw----  1 root video    29,   0 Jul 14 12:37 fb0
lrwxrwxrwx  1 root root          13 Jul 14 12:37 fd -> /proc/self/fd
crw-rw-rw-  1 root root      1,   7 Jul 14 12:37 full
crw-rw-rw-  1 root root     10, 229 Jul 14 12:37 fuse
crw-------  1 root root    254,   0 Jul 14 12:37 gpiochip0
crw-------  1 root root    254,   1 Jul 14 12:37 gpiochip1
crw-------  1 root root    510,   0 Jul 14 12:37 gpiomem
drwxr-xr-x  2 root root           0 Jul 14 12:37 hugepages
crw-------  1 root root     10, 183 Jul 14 12:37 hwrng
crw-------  1 root root     89,   1 Jul 14 12:37 i2c-1
lrwxrwxrwx  1 root root          12 Jul 14 12:37 initctl -> /run/initctl
drwxr-xr-x  2 root root          60 Jan  1  1970 input
crw-r--r--  1 root root      1,  11 Jul 14 12:37 kmsg
crw-rw----  1 root kvm      10, 232 Jul 14 12:37 kvm
lrwxrwxrwx  1 root root          28 Jul 14 12:37 log -> /run/systemd/journal/dev-log
brw-rw----  1 root disk      7,   0 Jul 14 12:37 loop0
brw-rw----  1 root disk      7,   1 Jul 14 12:37 loop1
brw-rw----  1 root disk      7,  10 Jul 14 12:37 loop10
brw-rw----  1 root disk      7,  11 Jul 14 12:37 loop11
brw-rw----  1 root disk      7,  12 Jul 14 12:37 loop12
brw-rw----  1 root disk      7,  13 Jul 14 12:37 loop13
brw-rw----  1 root disk      7,   2 Jul 14 12:37 loop2
brw-rw----  1 root disk      7,   3 Jul 14 12:37 loop3
brw-rw----  1 root disk      7,   4 Jul 14 12:37 loop4
brw-rw----  1 root disk      7,   5 Jul 14 12:37 loop5
brw-rw----  1 root disk      7,   6 Jul 14 12:37 loop6
brw-rw----  1 root disk      7,   7 Jul 14 12:37 loop7
brw-rw----  1 root disk      7,   8 Jul 14 12:37 loop8
brw-rw----  1 root disk      7,   9 Jul 14 12:37 loop9
crw-rw----  1 root disk     10, 237 Jul 14 12:37 loop-control
drwxr-xr-x  2 root root          60 Jan  1  1970 mapper
crw-rw----  1 root video   234,   0 Jul 14 12:37 media0
crw-rw----  1 root video   234,   1 Jul 14 12:37 media1
crw-rw----  1 root video   234,   2 Jul 14 12:37 media2
crw-r-----  1 root kmem      1,   1 Jul 14 12:37 mem
brw-rw----  1 root disk    179,   0 Jul 14 12:37 mmcblk0
brw-rw----  1 root disk    179,   1 Jul 14 12:37 mmcblk0p1
drwxrwxrwt  2 root root          40 Jan  1  1970 mqueue
drwxr-xr-x  2 root root          60 Jan  1  1970 net
crw-rw-rw-  1 root root      1,   3 Jul 14 12:37 null
crw-r-----  1 root kmem      1,   4 Jul 14 12:37 port
crw-------  1 root root    108,   0 Jul 14 12:37 ppp
crw-------  1 root root    246,   0 Jul 14 12:37 pps0
crw-------  1 root root    246,   1 Jul 14 12:37 pps1
crw-------  1 root root     10,   1 Jul 14 12:37 psaux
crw-rw-rw-  1 root root      1,   8 Jul 14 12:37 random
crw-rw-r--  1 root root     10, 242 Jul 14 12:37 rfkill
crw-rw----  1 root video   507,   0 Jul 14 12:37 rpivid-h264mem
crw-rw----  1 root video   509,   0 Jul 14 12:37 rpivid-hevcmem
crw-rw----  1 root video   508,   0 Jul 14 12:37 rpivid-intcmem
crw-rw----  1 root video   506,   0 Jul 14 12:37 rpivid-vp9mem
lrwxrwxrwx  1 root root           4 Jul 14 12:37 rtc -> rtc0
crw-------  1 root root    248,   0 Jul 14 12:37 rtc0
brw-rw----  1 root disk      8,   0 Jul 14 12:37 sda
brw-rw----  1 root disk      8,   1 Jul 14 12:38 sda1
crw-rw----  1 root disk     21,   0 Jul 14 12:37 sg0
drwxrwxrwt  2 root root         120 Jul 14 12:38 shm
drwxr-xr-x  2 root root          80 Jul 14 12:37 snd
lrwxrwxrwx  1 root root          15 Jul 14 12:37 stderr -> /proc/self/fd/2
lrwxrwxrwx  1 root root          15 Jul 14 12:37 stdin -> /proc/self/fd/0
lrwxrwxrwx  1 root root          15 Jul 14 12:37 stdout -> /proc/self/fd/1
crw-rw----  1 root kvm      10, 125 Jul 14 12:37 udmabuf
crw-------  1 root root     10, 239 Jul 14 12:37 uhid
crw-------  1 root root     10, 223 Jul 14 12:37 uinput
crw-rw-rw-  1 root root      1,   9 Jul 14 12:37 urandom
crw-------  1 root root     10, 240 Jul 14 12:37 userio
drwxr-xr-x  3 root root          60 Jul 14 12:37 v4l
crw-rw----  1 root video   235,   0 Jul 14 12:37 vchiq
crw-rw----  1 root video    10, 126 Jul 14 12:37 vcio
crw-------  1 root root    241,   0 Jul 14 12:37 vc-mem
crw-rw----  1 root video    10, 123 Jul 14 12:37 vcsm-cma
crw-------  1 root root     10, 137 Jul 14 12:37 vhci
crw-rw----  1 root kvm      10, 238 Jul 14 12:37 vhost-net
crw-rw----  1 root kvm      10, 241 Jul 14 12:37 vhost-vsock
crw-rw----  1 root video    81,   8 Jul 14 12:37 video10
crw-rw----  1 root video    81,   9 Jul 14 12:37 video11
crw-rw----  1 root video    81,  10 Jul 14 12:37 video12
crw-rw----  1 root video    81,   0 Jul 14 12:37 video13
crw-rw----  1 root video    81,   1 Jul 14 12:37 video14
crw-rw----  1 root video    81,   2 Jul 14 12:37 video15
crw-rw----  1 root video    81,   3 Jul 14 12:37 video16
crw-rw----  1 root video    81,  11 Jul 14 12:37 video18
crw-rw----  1 root video    81,   4 Jul 14 12:37 video20
crw-rw----  1 root video    81,   5 Jul 14 12:37 video21
crw-rw----  1 root video    81,   6 Jul 14 12:37 video22
crw-rw----  1 root video    81,   7 Jul 14 12:37 video23
crw-rw----  1 root video    81,  12 Jul 14 12:37 video31
crw-------  1 root root     10, 130 Jul 14 12:37 watchdog
crw-------  1 root root    243,   0 Jul 14 12:37 watchdog0
crw-rw-rw-  1 root root      1,   5 Jul 14 12:37 zero
crw-------  1 root root     10, 249 Jul 14 12:37 zfs

There's no /boot/config.txt on Ubuntu 22.04, it's /boot/firmware/config.txt, the user part of the config is:

enable_uart=1
cmdline=nobtcmd.txt

hdmi_force_hotplug:0=1
hdmi_drive:0=2
hdmi_mode:0=82

hdmi_ignore_edid:0=0xa5000080
hdmi_ignore_edid_audio:0=1

consoleblank=0

dtoverlay=newracom
dtparam=spi=on

start_x=1
gpu_mem=256

dtparam=i2c_arm=on
dtparam=i2c_baudrate=400000
dtoverlay=i2c-rtc,ds3231
enganguish commented 1 year ago

@Avamander ,

How did you install the kernel module? Could you show me your whole insmod command? (And, please add 'debug_level_all=1' into the module parameters.)