[SOLVED] request_irq() returns successfully but ISR is not execute
Linux - Embedded & Single-board computerThis forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
request_irq() returns successfully but ISR is not execute
I tried to request for interrupt using the specific gpio line but the ISR is never called. Why? request_irq() returns succesfully and the kernel doesn't complain (it just output the unbalanced irq message, which is harmless as far as I know). I am using kernel version 2.6.27
Below is the snippet code:
ret = request_irq(IRQ_GPIO0+gpio, handler, irq_flags, devname,
The reason why the handler isn't called is very complicated. In general, checking whether interrupt is enable really.
My way to check if the interrupt is successfully requested or enabled is by doing "cat /proc/interrupt"? Highlighted row is the interrupt I requested. But the value of interrupt count(i assume) is always 0.
I am not aware of your architecture. But if my understanding is correct, then you have registered an interrupt handler with the kernel, also you have configured the hardware(GPIO) to trigger an interrupt if there is some activity (pull-up of pull-down).
Are you sure the specific GPIO's are pulled as per you architecture requirement to trigger an interrupt?
Can't help much since info is very limited, so I'll just post things to check.
I assume you did the registration at the open file operation part of your driver, and unregister it at close file operation. Did you trigger the interrupt when the driver is kept open? If your interrupt handler is protected by a spin lock, did you checked any contentions from other part of your code? Do you use the same spin lock on other parts of your driver which might preempt the execution of the interrupt handler indefinitely?
If interrupt service routine registration is successful, probably you have issues on the hardware side. Have you checked/set how the interrupt will be triggered on that GPIO port? level-triggered or edge-triggered? Have you masked the correct GPIO port?
I am in exact same situation, and I have no clue as to what is happening. How did you solve your problem? can you provide any more details?
for the background of the problem,
1. I have connected a pullup resistor to GPIO 21 of OMAP3530 & the voltage values I checked with oscilloscope, these change correctly.
2. I have registered GPIO 21 to be an input port so that I can read the value.
3. My device driver depends on this value, and when I check the ISR, its never called.
Any thoughts, pointers are welcome.
Thanks & regards