LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This 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


Reply
  Search this Thread
Old 07-30-2010, 01:15 PM   #1
wachi
LQ Newbie
 
Registered: Jun 2010
Posts: 10

Rep: Reputation: 0
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 ^_^
 
Old 07-30-2010, 02:38 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
The interrupt handler registration is successful if request_irq() return successfully. It doesn't means that interrupt can reach your handler and can happen.
 
Old 07-30-2010, 03:59 PM   #3
wachi
LQ Newbie
 
Registered: Jun 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by nini09 View Post
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.
 
Old 08-03-2010, 02:33 PM   #4
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
The reason why the handler isn't called is very complicated. In general, checking whether interrupt is enable really.
 
Old 08-03-2010, 05:14 PM   #5
wachi
LQ Newbie
 
Registered: Jun 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by nini09 View Post
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
 
Old 08-04-2010, 02:29 PM   #6
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
If it is successful to register interrupter handler, counter in "cat /proc/interrupt" is increased when interrupt hit handler.
 
Old 08-04-2010, 06:34 PM   #7
wachi
LQ Newbie
 
Registered: Jun 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by nini09 View Post
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.
 
Old 08-05-2010, 05:30 AM   #8
Suresh Maniyath
Member
 
Registered: Feb 2009
Location: India
Distribution: Fedora, Ubuntu
Posts: 37

Rep: Reputation: 19
Lightbulb 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
 
Old 08-14-2010, 10:49 AM   #9
archieval
Member
 
Registered: Apr 2007
Location: Philippines
Distribution: Kubuntu, Ubuntu, CentOS
Posts: 289

Rep: Reputation: 41
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
 
Old 09-06-2010, 09:45 PM   #10
wachi
LQ Newbie
 
Registered: Jun 2010
Posts: 10

Original Poster
Rep: Reputation: 0
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
 
Old 01-27-2011, 12:05 AM   #11
mkvemuri
LQ Newbie
 
Registered: Jul 2005
Posts: 7

Rep: Reputation: 0
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
 
Old 01-27-2011, 01:29 AM   #12
archieval
Member
 
Registered: Apr 2007
Location: Philippines
Distribution: Kubuntu, Ubuntu, CentOS
Posts: 289

Rep: Reputation: 41
Register it as interrupt port, not input port. Then register the assigned interrupt number to the interrupt service routine.
 
Old 01-27-2011, 02:06 AM   #13
mkvemuri
LQ Newbie
 
Registered: Jul 2005
Posts: 7

Rep: Reputation: 0
sorry for confusing though. it is configured as interrupt port only. the direction is set correctly, as input.
 
Old 01-27-2011, 08:44 PM   #14
archieval
Member
 
Registered: Apr 2007
Location: Philippines
Distribution: Kubuntu, Ubuntu, CentOS
Posts: 289

Rep: Reputation: 41
- 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()?
 
  


Reply

Tags
interrupt



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
request_irq() on kernel 2.6.27 neu2sam Linux - Kernel 1 04-20-2009 11:47 AM
GCC compilation returns a "cannot execute binary file" error Antongarou Linux - Newbie 13 01-03-2009 07:28 PM
Any thoughts on minimum requirements to successfully execute an "openvt"? lumix Linux - General 1 05-01-2008 09:51 PM
Keyboard interrupt - request_irq() Pioz Linux - General 0 02-21-2008 10:10 AM
request_irq() handling. ksrinivas Linux - Kernel 0 08-07-2007 03:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 12:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration