Polling for Linux kernel device drivers

Martijn van Oosterhout kleptog at svana.org
Tue Oct 2 17:38:26 EST 2001


On Tue, Oct 02, 2001 at 02:03:51PM +1000, James Macnicol wrote:
> Hello,
> 
> 	We are trying to write a device driver for a data aquisition card
> (ISA bus) that is only capable of doing polled I/O (no interrupts).  We need
> to poll every 10 microseconds or so.  Since this is shorter than a jiffy we
> can't use kernel timers.  It is possible to make it work using udelay() calls
> but this ties up the kernel rather badly and causes the disk to make funny
> noises....  Does anyone know of any drivers out there that already do this
> sort of thing (that we can crib code from) or just know what the best way
> to approach this problem is ?

Let me see, 1 every 10us is 100,000 times per second. The ISA bus runs at
about 8MHz. So you have to do a request every 80 ISA clocks. I think that's
a pretty tough ask, since I'm pretty sure the machine will be fairly tied up
while waiting for the ISA bus.

Have you enabled unmaskirq on all your disk drives? This would probaby work
much better with a dual CPU.

Seriously though, does it actually produce data that often? Interrupts on
the ISA bus are just a simple matter of pulling the right line up or down.
Or even better, use a DMA channel, but that's more complicated.

Basically, when you access the ISA bus, the CPU slows down to the speed of
the ISA bus. I'd say the best solution would be to have an old machine (say
486Dx2/66) with the acquisition card and a network card and all the system
does is poll and buffer and send complete packets.

HTH,
-- 
Martijn van Oosterhout <kleptog at svana.org>
http://svana.org/kleptog/
> Magnetism, electricity and motion are like a three-for-two special offer:
> if you have two of them, the third one comes free.




More information about the linux mailing list