From owner-freebsd-hackers Wed Nov 4 17:55:28 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA23079 for freebsd-hackers-outgoing; Wed, 4 Nov 1998 17:55:28 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA23070 for ; Wed, 4 Nov 1998 17:55:22 -0800 (PST) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id MAA06130; Thu, 5 Nov 1998 12:24:54 +1030 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.1/8.9.0) id MAA06879; Thu, 5 Nov 1998 12:24:54 +1030 (CST) Message-ID: <19981105122453.B784@freebie.lemis.com> Date: Thu, 5 Nov 1998 12:24:53 +1030 From: Greg Lehey To: Etienne de Bruin , Hackers FreeBSD Subject: Re: waiting in device driver References: <199811041416.PAA04355@borg.kryptokom.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <199811041416.PAA04355@borg.kryptokom.de>; from Etienne de Bruin on Wed, Nov 04, 1998 at 03:16:24PM +0100 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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