From owner-freebsd-hackers Tue Aug 18 20:21:30 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA06838 for freebsd-hackers-outgoing; Tue, 18 Aug 1998 20:21:30 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from dingo.cdrom.com ([203.8.14.118]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA06830 for ; Tue, 18 Aug 1998 20:21:27 -0700 (PDT) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost.hilink.com.au [127.0.0.1] (may be forged)) by dingo.cdrom.com (8.9.1/8.8.8) with ESMTP id UAA03250; Tue, 18 Aug 1998 20:19:17 GMT (envelope-from mike@dingo.cdrom.com) Message-Id: <199808182019.UAA03250@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Karl Pielorz cc: hackers@FreeBSD.ORG Subject: Re: High? Latency device-driver with no IRQ's? In-reply-to: Your message of "Tue, 18 Aug 1998 20:08:36 +0100." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 18 Aug 1998 20:19:16 +0000 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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... > > 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). Use DELAY() if you can't guarantee an interrupt. > 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) - am I better off waiting around in the kernel rather > than issuing a sleep() only to be woken up 10us later? It depends on how much data you're moving. If you're moving more than a few of these words, then a fast interrupt handler is probably the way to go. In the ISA context, you can use a 'fast' fast interrupt handler. However, 10us is awfully fast; you will have to tune things pretty tightly to get 100kinterrupts/sec. > 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'? Yes. > Thanks in advance for any advice (apart from: Dump the card ;-) It's snot, that's for sure. -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message