Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-13-2012, 06:01 AM   #1
LQ Newbie
Registered: Jan 2012
Posts: 6

Rep: Reputation: Disabled
wake_up_interruptible() in a threaded irq handler

Hi everybody,

I have a question regarding the behavior of the driver I am developing, about the waiting queues and irq handling. I enable irq with request_threaded_irq(), where I define a minimal irq_handler, and a threaded_irq_handler to run more processing.

At a point in time, my main process, in my wait4confirmation() function, will stop on a call to wait_event_interruptible_timeout(), waiting to be woken up by a call to wake_up_interruptible() at the end of the threaded_irq_handler.. This works well for most of the cases.

However, sometimes, when my driver is in under stressed conditions, I can see (with debug traces) that I call wake_up_interruptible() as expected, but then I re-enter my irq_handler and my threaded_irq_handler again, and sometimes interrupts may come so often that I reach the timeout of my waiting queue on the other side.

I would have expected the sleeping process to be woken up/scheduled at least before the new call to the threaded_irq_handler but this is not the case.

In order to have more information, I have printed out the current process which is running when passing in the three locations, and I am a bit puzzled:
  • wait4confirmation(), just before stopping on the waiting queue -> wait4cfm Process is "ifconfig" (PID 280)
  • irq_handler -> ipc_irq_hdlr Process is "ifconfig" (PID 280)
  • threaded_irq_handler -> ipc_irq_thread_hdlr Process is "irq/36-rwnx_dri" (PID 277)

So, my questions are:
  1. Why my main process which is supposed to be woken up is never scheduled when I receive many interrupts, which makes me reach the timeout?
  1. Is it normal to see that my threaded_irq_handler is executed under irq process? And my irq_handler under my main process? Or is there something wrong when I print the processes out? (I call: printk("xxx Process is \"%s\" (PID %i)\n", current->comm, current->pid); )

Sorry for this long topic but I wanted to give as many information as possible, since I have made many searches on the web without success. Thanks in advance for your help.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
low stack detected by irq handler beev1812 Linux - Server 1 08-22-2011 03:17 PM
Setting priority for irq handler zvivered Linux - Hardware 1 11-28-2009 07:43 PM
Wondering what "do_IRQ: .176 No Irq handler for vector (irq -1)" means 4restg Linux - Newbie 1 10-27-2009 03:41 AM
Software irq handler Rainbow012 Linux - Kernel 1 02-25-2009 04:41 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:34 PM.

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