From owner-freebsd-hackers Tue Aug 18 13:09:02 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA18639 for freebsd-hackers-outgoing; Tue, 18 Aug 1998 13:09:02 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA18633 for ; Tue, 18 Aug 1998 13:08:58 -0700 (PDT) (envelope-from julian@whistle.com) Received: (from daemon@localhost) by alpo.whistle.com (8.8.5/8.8.5) id MAA23426; Tue, 18 Aug 1998 12:57:25 -0700 (PDT) Received: from current1.whistle.com(207.76.205.22) via SMTP by alpo.whistle.com, id smtpdW23416; Tue Aug 18 19:57:20 1998 Date: Tue, 18 Aug 1998 12:57:12 -0700 (PDT) From: Julian Elischer To: Karl Pielorz cc: hackers@FreeBSD.ORG Subject: Re: High? Latency device-driver with no IRQ's? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 18 Aug 1998, Karl Pielorz wrote: > > Hi All, > > The device driver I've been designing / writing for FreeBSD is starting to > shape nicely, except I've hit a problem... > > The driver needs a 10us delay for the card to carry out some operations, > rising to up to 30us delay for others... use DELAY(30); > > What's the best way of getting this delay? - I can get the card to > generate interrupts or I can wait 10us (for the 30us delay I just have to > wait, i.e. there is no irq at the end of the operation). don't use interrupts for this.. I presume that the this is not a permanent series of 30uSec delays, but once per transaction, and that after the transaction, you can return to the user.. > > The interrupt fires after every word has been transfered (it uses a 16 > bit i/o port)... I'd gather this isn't to hot a thing to do? (causing > excessive irq's) - you are corrct, but we need more info. like: how often is there data to be read, how much is available at a time? does it come in bursts? how much buffering is there on the card? how long does it take to service the card if it has full buffers? etc. etc. > am I better off waiting around in the kernel rather > than issuing a sleep() only to be woken up 10us later? Sleep will probably not have the granularity you want (sleep is in 10mSec units) (usually) > > If I am better waiting is there a better way to wait? (I can poll the card > until it's ready, but it seems a little draconian) - I gather sleep(lbolt) > / delay are all tied to the 100hz 'tick'? tell us more.. you may be able to use "aquire_timer0()" to give yourself a 20KHz polling clock.. > > Thanks in advance for any advice (apart from: Dump the card ;-) > > Regards, > > Karl Pielorz > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message