LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   request_irq() returns successfully but ISR is not execute (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/request_irq-returns-successfully-but-isr-is-not-execute-823091/)

wachi 07-30-2010 01:15 PM

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);

reg_gpio_enable_interrupt(gpio);
............


any help is deeply appreciated.


Thanks in advance ^_^

nini09 07-30-2010 02:38 PM

The interrupt handler registration is successful if request_irq() return successfully. It doesn't means that interrupt can reach your handler and can happen.

wachi 07-30-2010 03:59 PM

Quote:

Originally Posted by nini09 (Post 4050376)
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.

nini09 08-03-2010 02:33 PM

The reason why the handler isn't called is very complicated. In general, checking whether interrupt is enable really.

wachi 08-03-2010 05:14 PM

Quote:

Originally Posted by nini09 (Post 4054498)
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.

# cat /proc/interrupts
CPU0
7: 2 - secdom
41: 0 - irqname
48: 204 - i2c
53: 42333 - DDI0271 Timer Tick
61: 12524 - eth0
64: 0 - mmc0
70: 725 - uart



Thanks

nini09 08-04-2010 02:29 PM

If it is successful to register interrupter handler, counter in "cat /proc/interrupt" is increased when interrupt hit handler.

wachi 08-04-2010 06:34 PM

Quote:

Originally Posted by nini09 (Post 4055897)
If it is successful to register interrupter handler, counter in "cat /proc/interrupt" is increased when interrupt hit handler.

You mean, eventhough the irqname can be seen in the /proc/interrupts that doesn't mean that requesting for interrupt is successful?

I still don't know why this happen :( .. do you have any idea nini09 and to the others guys out there.

Suresh Maniyath 08-05-2010 05:30 AM

Pull up or Pull down
 
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?

Regards,
Suresh Maniyath

archieval 08-14-2010 10:49 AM

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?

Regards,
archieval

wachi 09-06-2010 09:45 PM

Hello Guys,

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.

Have a good day!

-wachi

mkvemuri 01-27-2011 12:05 AM

same situation
 
Hi there,

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

archieval 01-27-2011 01:29 AM

Register it as interrupt port, not input port. Then register the assigned interrupt number to the interrupt service routine.

mkvemuri 01-27-2011 02:06 AM

sorry for confusing though. it is configured as interrupt port only. the direction is set correctly, as input.

archieval 01-27-2011 08:44 PM

- 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()?


All times are GMT -5. The time now is 10:15 AM.