lkml.org 
[lkml]   [1999]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] udelay() for Alpha 2.2
Date
Below is a simple patch for the udelay() problem on EV6 alpha processors.
For those of you who prefer one line fixes, the following will work equally
well:

- __asm__ __volatile__(".align 3\n"
+ __asm__ __volatile__(".align 4\n\tnop\n\tnop\n"

Alpha delay loops are currently quadword aligned. If the delay loop in
ncrgetfreq() falls on an even quadword, that loop will run at half speed on
EV6 processors. This is a function of the other two instructions (two ldq's
in this case) that share the same octaword as the delay loop (subq bge). By
forcing at least one "nop" into the octaword we can guarantee consistent
(fast) performance on the 21264 microprocessor.

In most cases if udelay(1) causes a 2 microsecond delay, the only
consequence is the loss of a few cycles. However, the ncr53cxx and sym53cxx
drivers use udelay(1000) to calculate the NCR clock frequency. When a time
of 200 milliseconds is mistaken for 100, a 40MHz clock is mistaken for
80MHz. When the controller fails to operate at that speed, the system fails
to boot.

I believe this problem is serious enough to warrant a fix in 2.2. I will
reissue the udelay() that uses the processor cycle counter as a patch to 2.3

Jim

--- linux-2.2.12/include/asm-alpha/delay.h Tue Dec 29 16:56:15 1998
+++ patch-2.2.12/include/asm-alpha/delay.h Mon Sep 20 14:47:56 1999
@@ -12,9 +12,10 @@
extern __inline__ void
__delay(unsigned long loops)
{
- __asm__ __volatile__(".align 3\n"
+ __asm__ __volatile__(".align 4\n"
"1:\tsubq %0,1,%0\n\t"
- "bge %0,1b": "=r" (loops) : "0" (loops));
+ "bge %0,1b\n\t"
+ "nop": "=r" (loops) : "0" (loops));
}

/*

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.291 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site