Hi Nils,<br><br>>>void cleanup_module(void) {
<br> >> ...
<br>
>> free_irq(ADC_IRQ, NULL); /* remove interrupt handler */
<br>
>> ...
<br>
>> return;
<br>
>>}
<br><br>You should not pass NULL here. It should be the unique cookie that you passed in request_irq (adc_irq_handler in your case) since you have used IRQF_SHARED which means you want to share your interrupt line. Also check whether you really want to share your interrupt line and also if you want to use "(void *)(adc_irq_handler)" as the unique identification.<br>
<br>HTH!<br><br>Regards<br>Mayur<br><br><div class="gmail_quote">On Tue, Feb 7, 2012 at 7:45 PM, nils.stec <span dir="ltr"><<a href="mailto:nils.stec@googlemail.com">nils.stec@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
Hi,
<br>
<br>
atm I'm writing a kernel module for an embedded ARM device.
<br>
This module uses IRQ9.
<br>
<br>
If i remove the module, the kernel tells me that:
<br>
<br>
------------[ cut here ]------------
<br>
WARNING: at kernel/irq/manage.c:858 __free_irq+0x84/0x154()
<br>
Trying to free already-free IRQ 9
<br>
Modules linked in: adc_demo_irq(P-) g_ether pegasus mii
<br>
[<c0028794>] (unwind_backtrace+0x0/0xd0) from
[<c003b504>] (warn_slowpath_common+0x48/0x60)
<br>
[<c003b504>] (warn_slowpath_common+0x48/0x60) from
[<c003b554>] (warn_slowpath_fmt+0x24/0x30)
<br>
[<c003b554>] (warn_slowpath_fmt+0x24/0x30) from
[<c005fa00>] (__free_irq+0x84/0x154)
<br>
[<c005fa00>] (__free_irq+0x84/0x154) from [<c005fb0c>]
(free_irq+0x3c/0x5c)
<br>
[<c005fb0c>] (free_irq+0x3c/0x5c) from [<bf01e18c>]
(cleanup_module+0x4c/0x60 [adc_demo_irq])
<br>
[<bf01e18c>] (cleanup_module+0x4c/0x60 [adc_demo_irq]) from
[<c005b898>] (sys_delete_module+0x1c4/0x238)
<br>
[<c005b898>] (sys_delete_module+0x1c4/0x238) from
[<c0022dc0>] (ret_fast_syscall+0x0/0x28)
<br>
---[ end trace 60d7a16d878ac0b3 ]---
<br>
adc testing module removed
<br>
------------[ cut here ]------------
<br>
<br>
The message "adc testing module removed" comes from my module <b><span>*</span>after<span>*</span></b> free_irq() via printk, so the
module exit routine works till the end.
<br>
<br>
This is my code (only the IRQ related part):
<br>
<br>
irqreturn_t adc_irq_handler(int irq, void *dev_id) {
<br>
<br>
... do someting ...
<br>
<br>
return IRQ_HANDLED;
<br>
}
<br>
<br>
int init_module(void) {
<br>
int32_t retval;
<br>
...
<br>
retval = request_irq(ADC_IRQ, adc_irq_handler, IRQF_SHARED,
"lpc313x adc irq", (void *)(adc_irq_handler));
<br>
...
<br>
return retval;
<br>
}
<br>
<br>
void cleanup_module(void) {
<br>
...
<br>
free_irq(ADC_IRQ, NULL); /* remove interrupt handler */
<br>
...
<br>
return;
<br>
}
<br>
<br>
<br>
I hope anyone of you can help me with that problem. If you need more
information, i'll send it <span title=":)"></span>
<br>
<br>
Greetings,
<br>
Nils
</div>
<br>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div><br>