0

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.

  • 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. –  Oct 13 '17 at 07:08
  • Thanks for the input. I will check but based on the "symptoms" I don't think this might be the issue. – EnthuMan Oct 13 '17 at 07:24
  • Yes as a "symptoms" ;), gl. –  Oct 13 '17 at 07:25
  • Follow-up: just checked, usb boot is not enabled (in /boot/config.txt) – EnthuMan Oct 13 '17 at 07:35
  • 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? –  Oct 13 '17 at 07:43
  • I used the second approach, sudo apt-get update..... – EnthuMan Oct 13 '17 at 08:53

1 Answers1

0

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.

Sathesh
  • 51
  • 7
  • I checked the USB device list using lsusb but didn't see anything specific. I tried to soft reset the usb device and this helped in inserting my driverx.ko without a problem. (eg. an answer on another thread on SO, $ sudo usb_modeswitch -v 0x7392 -p 0x7811 --reset-usb). – EnthuMan Oct 14 '17 at 00:21
  • looks the problem with the device which may drawing more current from the port. Try to change the power source of pi. – Sathesh Oct 14 '17 at 01:09
  • Alternatively use external hub (self powered) and connect your device on the hub – Sathesh Oct 14 '17 at 01:10