Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Nov 1998 12:24:53 +1030
From:      Greg Lehey <grog@lemis.com>
To:        Etienne de Bruin <Etienne.Debruin@KryptoKom.DE>, Hackers FreeBSD <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: waiting in device driver
Message-ID:  <19981105122453.B784@freebie.lemis.com>
In-Reply-To: <199811041416.PAA04355@borg.kryptokom.de>; from Etienne de Bruin on Wed, Nov 04, 1998 at 03:16:24PM %2B0100
References:  <199811041416.PAA04355@borg.kryptokom.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday,  4 November 1998 at 15:16:24 +0100, Etienne de Bruin wrote:
> which is the best way to wait for the DMA routines of a card to complete?
> should one go in a while loop and test a flag (which gets set by the
> interrupt handler once completed) or should i go for the tsleep option?

Please don't copy -questions on this kind of question.  -hackers is
the appropriate forum.

How long are you expecting to wait?  If you're transferring from
external storage such as disk or tape, tsleep() is your only option,
but you can only use it from the top half of a driver.  If you're
talking to an electronic device which can reasonably be expected to
respond in a few (< 10) microseconds, you might get away with a loop,
but you'd have to limit it to a certain number of iterations and give
up if it didn't happen in that time: otherwise you could cause hangs.

Greg
--
See complete headers for address, home page and phone numbers
finger grog@lemis.com for PGP public key

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19981105122453.B784>