Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Aug 1998 12:57:12 -0700 (PDT)
From:      Julian Elischer <julian@whistle.com>
To:        Karl Pielorz <kpielorz@tdx.co.uk>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: High? Latency device-driver with no IRQ's?
Message-ID:  <Pine.BSF.3.95.980818124754.9917C-100000@current1.whistle.com>
In-Reply-To: <Pine.BSF.3.96.980818193217.2981A-100000@caladan.tdx.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help


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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.980818124754.9917C-100000>