Results 1 to 5 of 5
I have situation where I have to wait in interrupt handler till I compele other work/wait till some flag set.
i.e want to wait (not return from IH) and block ...
- 10-30-2011 #1Just Joined!
- Join Date
- Jan 2011
- Posts
- 10
Blocking in interrupt handler.
I have situation where I have to wait in interrupt handler till I compele other work/wait till some flag set.
i.e want to wait (not return from IH) and block inside interrupt handler, dont want to loop as it cause lot of cpu usage.
let me know if we have any signaling or any mechanism.
Thanks in Advance!!!
- 10-30-2011 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,961
Bad! Bad!! Bad!!! Bad!!!! Bad!!!!!
NEVER wait in an interrupt handler! Set some state flag and let your driver or kernel thread wait until the event you need happens, or a timeout occurs. What you propose is a perfect way to cause a system to totally hang, or go into some sort of LaLa Land...
So, this brings us to the real question - what is it that you are trying to accomplish?Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 11-22-2011 #3Banned
- Join Date
- Nov 2011
- Posts
- 13
Hi,
You can use workqueues, and schdule a work from interrupt handler and them in workqueue handler perform the required logic. However, if you really want to loop inside in the interrupt handle, I will suggest you change preempt mode to Realtime (CONFIG_RT), this will make the interrupt handlers as threads, then you can block inside them.Last edited by oz; 11-22-2011 at 12:23 PM. Reason: spam removal
- 11-22-2011 #4Just Joined!
- Join Date
- Jan 2011
- Posts
- 10
Thanks Deepak ,, configuring to realtime will work for me..
- 11-26-2011 #5Banned
- Join Date
- Nov 2011
- Posts
- 13
Welcome, but what is the requirement to block inside an interrupt handler? If you want to some do exclusive work, then why not protect non interrupt code with spin_lock_irqsave/spin_unlock_irqrestore. If not, then I think you need to modify your design to avoid blocking inside an interrupt handler.
Last edited by oz; 11-26-2011 at 12:34 PM. Reason: spam removal


1Likes
Reply With Quote

