0
votes

We are running the latest raspibian on the raspberry pi board and have a kernel driver for a USB peripheral which is added externally (sudo insmod driverx.ko) after boot-up by connecting to the hardware using ssh (its a headless system).

The problem is as follows: If the device is already connected to the system upon power-up then running sudo insmod driverx.ko leads to the terminal getting stuck (no response, Ctrl+C doesn't work). Running lsmod by starting another ssh session shows that the module is in use even though there is no code running that will use it.

If I plug the USB device after the system boots up then sudo insmod driverx.ko works normally, (the terminal is still active). Running lsmod subsequently shows that that module is loaded but not in use by anyone. I can then run my user code and everything is fine. Upon running my user code lsmod shows the kernel module is in use and the number of users is 1.

In our system the USB device will always be plugged in. The kernel version and the driver version are the same.
I can fill in more details but do not wish to bias or make this query un-readble. Please advise on what could the problem be.

Thank you for your time and help.

1
any bios usb boot on start ? you need to put usb on the bottom list of boot bios, this can make bad situation if the usb is bootable. No sure if is relevant of your problem. Regards. - user8556290
Thanks for the input. I will check but based on the "symptoms" I don't think this might be the issue. - EnthuMan
Yes as a "symptoms" ;), gl. - user8556290
Follow-up: just checked, usb boot is not enabled (in /boot/config.txt) - EnthuMan
did you installed the the prerequisite as sudo apt-get xxx-firmware or did you update your distrib sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade ? wich is it? - user8556290

1 Answers

0
votes

Possibility is that, the device is already attached into some other driver during startup. If it’s the case, the device credential of your specific device has to be removed from the startup driver.

Check the USB device list before to insert your driver.