The HyperNews Linux KHG Discussion Pages

Question: interruptible_sleep_on() too slow!

Forum: The Linux Kernel Hackers' Guide
Keywords: device driver interrupts interruptible_sleep_on()
Date: Fri, 31 Oct 1997 06:37:26 GMT
From: Bill Blackwell <>

Hi,
   I'm in the process of writing a driver for a data
acquisition board.  I'm having some difficulties setting up
the interrupt handler.  Here's the problem:

I first write a byte to a register on the board which initiates a data conversion (when data is ready to be read, an interrupt is generated). The next line of code is an interruptible_sleep_on() call. On some occasions, the A/D board generates an interrupt BEFORE the i_s_o() call is complete, so the task is never put to sleep and added to the queue (I hope I have that right, I'm very new to this stuff...). When the companion wake_up_interruptible() call is made at the end of the interrupt handler routine, the program stalls, since there is nothing to be awakened.

   Is there a fix for this?

Thanks for reading this - sorry if this is excruciatingly trivial.