Re: Sleeping in block device driver

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

 



Surely that should have worked out. Still there is another way, you
can initialize a semaphore and sleep on the semaphore. Once the thread
has recieved the network packet it would post the semaphore.

Thanks,
Sumit

----- Original Message -----
From: David Stroupe <dstroupe@keyed-upsoftware.com>
Date: Thursday, March 7, 2002 0:58 am
Subject: Re: Sleeping in block device driver

> 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/
> 
> 
begin:vcard
n:Agarwal;Sumit
fn:Sumit Agarwal
tel;cell:+919845205210
tel;fax:+91-80-5732696
tel;home:+919845205210
tel;work:+91-805732296 / 93 extn. 5243
url:www.wipro.com
org:Wipro Technologies;SIDC, Embedded and Internet Division
adr:;;Wipro Technologies, Chamundi Complex, No.26, Hosur Main Road, Bommanahalli;Bangalore;Karnataka;560068;INDIA
version:2.1
email;internet:sumit.agarwal@wipro.com
title:Senior Software Engineer
end:vcard


**************************Disclaimer************************************

Information contained in this E-MAIL being proprietary to Wipro Limited
is 'privileged' and 'confidential' and intended for use only by the
individual or entity to which it is addressed. You are notified that any
use, copying or dissemination of the information contained in the E-MAIL
in any manner whatsoever is strictly prohibited.


 ********************************************************************

[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