<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body 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
class="moz-txt-star"><span class="moz-txt-tag">*</span>after<span
class="moz-txt-tag">*</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 class="moz-smiley-s1" title=":)"></span>
<br>
<br>
Greetings,
<br>
Nils
</body>
</html>