lkml.org 
[lkml]   [2015]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Semaphore API] down_interruptible_timeout
On Mon, 15 Jun 2015, Mason wrote:
> A) process-context kernel thread fills a FIFO and calls down(&fifo_empty);
> B) ISR handles the FIFO-empty interrupt with up(&fifo_empty);
>
> However, in case something goes wrong and the interrupt never fires,
> I don't want the process to be stuck in an uninterruptible sleep.
>
> Perhaps I can set a tiny timeout (e.g. 10 µs) and not worry about
> the interruptible part for such a small duration? (Hmm, __down_common
> calls schedule_timeout, which is jiffies-based. I don't think there
> is a hrtimers flavor. So µs timeouts would be off the table?)
>
> Or I could use the interruptible version, and let the user kill the
> operation if necessary.

Use a completion.

Thanks,

tglx
\
 
 \ /
  Last update: 2015-06-15 19:21    [W:0.378 / U:1.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site