Skip to contentSkip to conversation

ldd irq problem

DISCUSSION Chris Rutherford 2 participants 3 messages Nov 30, 2007 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Helo lkml,

I'm trying to write a LDD but I have got a bug. Any ideas what i might be doing wrong?

ret = request_irq(12, handler, SA_INTERRUPT | SA_SHIRQ, "sha1 handler", DEVICE_NAME);
printk (KERN_INFO "req irq %d \n", ret); enable_irq(12);

I am working on a linux device driver and trying to handle interupts. using the code above I get the log messages below.

req irq 0
Unbalanced enable for IRQ 12

BUG: warning at kernel/irq/manage.c:118/enable_irq()
 [<c0140889>] enable_irq+0x54/0x87
 [<c02133de>] __driver_attach+0x0/0x5d
 [<e0b6f23b>] device_probe+0x16b/0x173 [raggedstone1]
 [<c01c33ce>] pci_device_probe+0x36/0x57
 [<c0213339>] driver_probe_device+0x42/0x91
 [<c0213416>] __driver_attach+0x38/0x5d
 [<c0212e58>] bus_for_each_dev+0x37/0x59
 [<c02132a3>] driver_attach+0x11/0x13
 [<c02133de>] __driver_attach+0x0/0x5d
 [<c0212b67>] bus_add_driver+0x6b/0xfd
 [<c01c3509>] __pci_register_driver+0x47/0x63
 [<c0135c67>] sys_init_module+0x1732/0x18b5
 [<c015a43b>] do_sync_read+0xb6/0xf1
 [<c016e2db>] dput+0x2a/0x119
 [<c0102bed>] sysenter_past_esp+0x56/0x79

Has any one seen this type of bug message before? any idea what could be causing it.

Thanks

Chris

#2 lore raw
Quoted 9 lines · Chris Rutherford

Helo lkml,

I'm trying to write a LDD but I have got a bug. Any ideas what i might be doing wrong?

ret = request_irq(12, handler, SA_INTERRUPT | SA_SHIRQ, "sha1 handler", DEVICE_NAME);
printk (KERN_INFO "req irq %d \n", ret); enable_irq(12);

enable_irq is opposite of disable_irq(_nosync), you don't need to call it in probe function and in most cases you don't need it at all.

regards,

Signature · 2 lines
Jiri Slaby ([email protected])
Faculty of Informatics, Masaryk University
#3 lore raw

many thanks, the following says it all..

box:/home/chris/work/fpgaio# grep sha1 /proc/interrupts
 12:   14669741          XT-PIC  sha1 handler
Quoted 19 lines · Jiri Slaby
Quoted 9 lines · Chris Rutherford

Helo lkml,

I'm trying to write a LDD but I have got a bug. Any ideas what i might be doing wrong?

ret = request_irq(12, handler, SA_INTERRUPT | SA_SHIRQ, "sha1 handler", DEVICE_NAME);
printk (KERN_INFO "req irq %d \n", ret); enable_irq(12);

enable_irq is opposite of disable_irq(_nosync), you don't need to call it in probe function and in most cases you don't need it at all.

regards,
--
Jiri Slaby ([email protected])
Faculty of Informatics, Masaryk University