Re: Sleeping in block device driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pooja Gupta wrote:

>Hi there...
>  I am writing a network block device driver.  In the
>request function, when I get a READ command, I have to
>send a message to a remote machine and get the data
>from there.  This takes considerable time duration. 
>So, I need to make that device driver sleep.  The
>reception of data is done in another thread.
>  I have tried different ways, all in vain.  I tried
>wait_event_interruptible(...) followed by condition
>set and wake_up(...) when I want to wake up.  
>
Why didn't this work?  Set your condition and do your wake_up from 
whereever you determine that all the information has been read.  I have 
a driver that does this waiting for an irq to happen.  So my 'read' 
blocks until the irq handler runs, sets the condition then wakes up the 
queue.

-- 
Best regards,
David Stroupe
Keyed-Up Software


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux