Jump to content

Linux loads "spidev" module even if spidev.ko.xz file is removed


dudeiot

Recommended Posts

Hi,

I could  enable  "spidev" support  by  armbian-config -> system -> hardware (enable spidev) . Everything worked fine.

However, the original spidev module supports messages only up to 4096 bytes.

I compiled a new version of custom spidev.ko with the 32,768 buffer size.

Then, converted it to spidev.ko.xz  ( xz -v spidev.ko) and replaced the original file under /lib/modules/5.15.85-sunxi/kernel/drivers/spi/spidev.ko.xz 

The  new module works fine when I install it manually:  insmod /lib/modules/5.15.85-sunxi/kernel/drivers/spi/spidev.ko.xz

However, after the reboot the original 4096-byte version of "spidev"  module is loaded magically.

It is loaded even if I  remove the /lib/modules/5.15.85-sunxi/kernel/drivers/spi/spidev.ko.xz file.

I searched through the whole micro-SD partition and cound not find any copy of spidev.ko.xz or spidev.ko

 

Would you please explaine the mystery ?

Thanks in advance

 

 

Link to comment
Share on other sites

17 hours ago, dudeiot said:

Then, converted it to spidev.ko.xz  ( xz -v spidev.ko) and replaced the original file under /lib/modules/5.15.85-sunxi/kernel/drivers/spi/spidev.ko.xz 

In your list of steps, I am not seeing that you ever ran depmod to ensure extraction of updated module deplist and symbols information. Without that kernel will not try to load your module other than you force loading it with insmod.

 

17 hours ago, dudeiot said:

However, after the reboot the original 4096-byte version of "spidev"  module is loaded magically.

It is loaded even if I  remove the /lib/modules/5.15.85-sunxi/kernel/drivers/spi/spidev.ko.xz file.

I searched through the whole micro-SD partition and cound not find any copy of spidev.ko.xz or spidev.ko

Nothing magical about it, The module most likely would also be present inside initrd file and being loaded from there. You never mentioned that you regenerated initrd, so thats a possible explaination

Link to comment
Share on other sites

Quote

armbianmonitor -u

https://paste.armbian.com/apusitudaq

 

Quote

In your list of steps, I am not seeing that you ever ran depmod 

I did not mention that. However,  I executed

 

depmod -a

sync

reboot

 

It did not help

 

Quote

The module most likely would also be present inside initrd file

Good catch ! If the module is loaded from the initrd  it explains everything.

It seems to solve my problem  it is necessary to change "devspi" module source in Linux source tree and regenerate all images.

Is  there a simple way to generate  uInitrd-5.15.85-sunxi  only?

 

 

Thanks

Edited by dudeiot
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines