insmod error: inserting Device or resource busy & remove_id permission denied
Hi,
i'm working on an PCIe device driver for an FPGA card from Xilinx. The computing environment is as follows:
% uname -a
Linux dev-2 2.6.32-131.0.15.el6.x86_64 #1 SMP Sat May 21 10:27:57 CDT 2011 x86_64 x86_64 x86_64 GNU/Linux
% cat /etc/redhat-release
Scientific Linux release 6.1 (Carbon)
When i tried to load the module, i ran into the following error:
----------------------------------------
% sudo insmod ./foo_main.ko
insmod: error inserting './foo_main.ko': -1 Device or resource busy
----------------------------------------
i don't know why i got this error message. foo does not appear in the lsmod output. It is not clear to me why the kernel thinks the device/resource is "busy". i also attempted the following to remove the device but to no avail:
% sudo echo "51ac 9041" > /sys/bus/pci/drivers/foo/remove_id
bash: remove_id: Permission denied
wherein 51ac and 9041 are the vendor and device IDs respectively.
My questions are:
* Did i misuse the "sudo echo ... remove_id" command (i do have sudo
privilege)? How did i end up getting this error message?
* What is the cause of the "Device or resource busy" error message
and how i can rectify the problem?
If this is not the right forum for question of this nature, i apologize, and please kindly point me in the right direction.
Thanks.
|