lkml.org 
[lkml]   [1999]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Problems writting a CHAR Driver with interruptible_sleep (wait _queu e)
On 12 Aug, thomas.putnam@natinst.com wrote:
> A quick solution is to turn off interrupts with a cli() immediately before you
> tell the device that you want them. When you call interuptible_sleep, Linux
> will enable interrupts after you are safely in the wait queue, and any pending
> interrupts will occur.

I just did that, and it really improved the response :-)

But as you said below, it eventually loses the interrupt call and stays
sleeping until "^C" (using an cat /dev/chaos).

> To avoid losing interrupts, however, you might want
> implement some kind of queue to hold messages. You would still use a cli() to
> make sure everything happened atomically, however. The correct implementation
> really depends on how your device functions.

Yes, I guess that I will need something like the queue.
I was thinking of something like:

while (queue == 0){ schedue(); }

And wait for the interrupt to change "queue". But, isn't it a BAD
implemantation?

But if keep using cli() I will miss an interrupt eventually, right?
how do I avoid that (using cli)?


Best Regards,
Raul Dias


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.331 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site