Subject: Grrr: Small delays
To: None <dej@eecg.toronto.edu>
From: David S. Miller <davem@caip.rutgers.edu>
List: port-sparc
Date: 08/14/1995 13:19:41
   From: David Jones <dej@eecg.toronto.edu>
   Date: 	Mon, 14 Aug 1995 12:23:11 -0400

   Is there a standard way of delaying for less than 1 us in the kernel?

    ....

   wait_req_true:
    while (req not true)
     delay(1);

   This works, but gives you lousy transfer rates.  I'd like to do something
   like:

   while (req not true)
     delay200ns();

    ...

   The ncr5380 code is going to be universally portable, so for now I'm sticking
   to delay().

   Any ideas?  Of course this is not so much a problem once I get DMA going...

Is not the 'hz' variable available to your routines?  At boot time you
could use it to calculate delay constants for the driver, perhaps
implement a delay200ns() macro which will use this driver constant in
a decrementing loop to get the accuracy you are looking for.

Later,
David S. Miller
davem@caip.rutgers.edu