Skip to contentSkip to conversation

interruptible_sleep_on, interrupts and device drivers

DISCUSSION Robert Hancock 1 participant 1 message Oct 15, 2005 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 9 lines · Gabriele Brugnoni

But:
If the test is made with IRQ closed, and IRQ are then enabled after the test but before the call to interruptible_sleep_on, what happen if the handler break the procedure immediately before entering the interruptible_sleep_on function ?
I beleave that the interrupt handler, calling the wakeup function, will not wake our process, because is not in the waiting list. But at return from IRQ handler, the process will continue execution calling the sleep function, and nobody will wake it because the data is now already available.

This is why interruptible_sleep_on is deprecated and should not be used anymore. The wait_event_interruptible, etc. functions avoid this race since the condition is tested after the caller is put into the wait queue, so if the condition is true you are guaranteed to be woken up.

Signature · 3 lines
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from [email protected]
Home Page: http://www.roberthancock.com/