Messages in this thread | | | Subject | Module usecount probs with 2.4.0-test5 | Date | Thu, 3 Aug 100 17:21:09 +0200 (MET DST) | From | (Alexander Schulz) |
| |
Hello,
I tried to port two of my older modules from 2.0 to 2.4. After changing some prototypes and stuff, the first one seems to work ok, except every time I run a program on it, the usecount is incremented by one. I have one MOD_INC_USE_COUNT in the open- and one MOD_DEC_USE_COUNT in the release-function. That always worked. I used GET_USE_COUNT to print the usecount and it is always 2 when open is called, and thus 3 when release is called. My MOD_DEC_USE_COUNT decrements it to 2, something after that decrements it to one. But that is still too much, of course.
When the module is opened and another program tries to open it, open returns -EBUSY without incrementing the usecount. But what happens is this: open is called with usecount=5 (again incremented by 2) and leaves it at 4 after it returned the error.
Can anybody tell me what is changing my usecount here? Other modules (smc-ultra, sensors, lm75 etc.) seem to work correctly, so probably it's something with my module but I really can't find it.
Another thing, I don't if it is related: The second module is for a PCI-Framegrabber. It initializes after I changed the interface (pci_module_init, getting resources from dev->*, pci_enable_device etc.) but it does not seem to get any interrupts any longer. /proc/interrupts says 0 ints for this card (irq 19 IIRC).
I am usig modutils 2.3.11, kernel 2.4.0-test5, glibc 2.1.3, gcc 2.95.2, binutils 2.9.5, the module is compiled with: gcc -O2 -Wall -DMODULE -D__KERNEL__ -D__SMP__ -I/usr/src/linux/include -fomit-frame-pointer -c devicenet.c
Any ideas?
Thanks in advance Alexander
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |