]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-powerpc/delay.h
[MTD] jedec_probe: Fix SST 16-bit chip detection
[linux-2.6-omap-h63xx.git] / include / asm-powerpc / delay.h
index 54fe1f4f8fd069bdaa121aa6bd90e7e855f2e8eb..f9200a65c632b9421d02b16106feded2eb3eb4eb 100644 (file)
@@ -1,5 +1,6 @@
 #ifndef _ASM_POWERPC_DELAY_H
 #define _ASM_POWERPC_DELAY_H
+#ifdef __KERNEL__
 
 /*
  * Copyright 1996, Paul Mackerras.
 extern void __delay(unsigned long loops);
 extern void udelay(unsigned long usecs);
 
+/*
+ * On shared processor machines the generic implementation of mdelay can
+ * result in large errors. While each iteration of the loop inside mdelay
+ * is supposed to take 1ms, the hypervisor could sleep our partition for
+ * longer (eg 10ms). With the right timing these errors can add up.
+ *
+ * Since there is no 32bit overflow issue on 64bit kernels, just call
+ * udelay directly.
+ */
+#ifdef CONFIG_PPC64
+#define mdelay(n)      udelay((n) * 1000)
+#endif
+
+#endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_DELAY_H */