[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.
Notices
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
request_irq() returns successfully but ISR is not execute
Hi guys,
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,
dev_id);
The interrupt handler registration is successful if request_irq() return successfully. It doesn't means that interrupt can reach your handler and can happen.
The interrupt handler registration is successful if request_irq() return successfully. It doesn't means that interrupt can reach your handler and can happen.
Thanks for the reply. But, what could be the reason why is it not calling the handler? I search through the net but it seems that no one had yet to provide the solution.
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?
It turns out that nothing is wrong with the driver I created. We found out there's a hardware changes and one of the gpio group(including the gpio line im using) where all affected.
Anyway, Thank you so much to those who respond to this question.
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
Murali
- check 'cat /proc/interrupts', do you see your device with the correct interrupt number?
- have you masked that GPIO port/pin?
- have you enabled it properly? enabled_irq()?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.