LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-18-2011, 01:57 AM   #1
ming
LQ Newbie
 
Registered: Dec 2011
Posts: 2

Rep: Reputation: Disabled
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.
 
Old 12-18-2011, 06:20 AM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
If you're writing the driver yourself, you should add a bunch of printk()'s to your code, and then trace the program flow with dmesg. This will help you to troubleshoot which part of your driver is failing.
 
Old 12-18-2011, 08:22 AM   #3
ming
LQ Newbie
 
Registered: Dec 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi jhwilliams,
Thank you for your input.

> If you're writing the driver yourself, you should add a bunch
> of printk()'s to your code,

i did add a bunch of printk()'s in most functions including
static int __init foo_init(void)
and examined the output from both dmesg and /var/log/messages but i did not find additional clues other than error messages i included in my first posting. Moreover, i also checked the function return values whenever possible.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error opening PCM device Device or resource busy Herbivore Linux - Newbie 2 08-23-2008 01:45 AM
Boot cd initrd error - pivot_root: Device or resource busy fotoguy Linux - Software 2 08-03-2006 07:44 PM
Device or resource busy error obulpathi Linux - Laptop and Netbook 1 01-20-2006 04:03 AM
realtek rtl8139 gives device or resource busy error with slack 9.1 /xp dualboot joe83 Linux - Networking 2 06-10-2004 07:32 AM
nvidia insmod: "Device or resource busy" w/GeForce 4 MX KeithSpook Linux - Hardware 4 03-03-2004 12:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration