interruptible_sleep_on, interrupts and device drivers
A message that is not in the archive (sent off-list or not yet received): [email protected]
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 tointerruptible_sleep_on, what happen if the handler break the procedure immediately before entering theinterruptible_sleep_onfunction ?
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/