Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Aug 1998 20:19:16 +0000
From:      Mike Smith <mike@smith.net.au>
To:        Karl Pielorz <kpielorz@tdx.co.uk>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: High? Latency device-driver with no IRQ's? 
Message-ID:  <199808182019.UAA03250@dingo.cdrom.com>
In-Reply-To: Your message of "Tue, 18 Aug 1998 20:08:36 %2B0100." <Pine.BSF.3.96.980818193217.2981A-100000@caladan.tdx.co.uk> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 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



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