Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 09-15-2006, 10:27 AM   #1
LQ Newbie
Registered: Aug 2006
Posts: 6

Rep: Reputation: 0
Linux 2.6 PCI driver module causing kernel panic on remove (rmmod)

I am writing a PCI device driver for an end-user using Linux 2.6 (Gentoo 2006.0), and am having difficlty.

I have a PCI device driver module that causes a kernel panic (dump below), when I rmmod the module (remove). I can build and insert (insmod) the module, detect my board and use the interrupt handler. But, when I rmmod the module, it calls the driver's .remove routine, and then I consistantly get a panic. It is a PCI device that uses shared interrupts, and I believe that this panic happens only when my PCI device shares an IRQ with another device in the system. It appears to be an interrupt-related problem from the dump (below).

Any ideas what I am doing wrong or not doing on remove or in my registered interrupt routine? I have looked at dozens of drivers on my system and modeled my driver like them.....

Is there a certain order I need to call my free_irq(), pci_disable_device(), unregister_chrdev(), and pci_unregister_driver() calls? I tried various different orders and even commented some out and it still panics, which makes me wonder if I am still missing something.

[abbreviated dump]:
Code: Bad EIP value
<0> KErnel panic - not syncing: Fatal Exception in interrupt

A thousand thanks,

Old 09-17-2006, 08:20 PM   #2
Senior Member
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
When I've compiled kernels I've noticed that module removal is an option. Maybe the kernel wasn't compiled with this ability.
Old 09-18-2006, 10:04 AM   #3
LQ Newbie
Registered: Aug 2006
Posts: 6

Original Poster
Rep: Reputation: 0
stress_junkie -
Sorry, I guess I should have mentioned that this appears to only happen when one of my PCI devices is sharing an interrupt with another device in the system. I will double-check, however to be sure my kernel is supporting the module unload option....



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ or pure C for Linux kernel module, Linux device driver development. What to use? Igor007 Programming 91 07-19-2014 11:55 AM
Kernel Upgrade causing Kernel Panic DragonM15 Linux - Software 28 12-20-2006 10:41 AM
nvidia driver 8762 kernel module mismatch x module openfun Ubuntu 5 06-27-2006 10:02 PM
making sys call ex:insmod,rmmod from function in user module shashishankar_h Linux - General 1 09-01-2005 12:36 AM
rmmod segfaulting and causing lsmod to hang withh 2.6.3 kernel Kurt M. Weber Linux - Software 5 02-25-2004 11:51 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:06 AM.

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