diff options
| author | Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> | 2007-04-02 02:49:37 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-02 13:06:08 -0400 |
| commit | 10fa1155a2c3282f421a74fedfad1957e8bdc86c (patch) | |
| tree | 21ec69d27c0d5e239f9c0eed531dbcdc0f602af2 /include | |
| parent | 05565b65a5309e3e5c86db1975b57f75661bee8f (diff) | |
[PATCH] uml: fix unreasonably long udelay
Currently we have a confused udelay implementation.
* __const_udelay does not accept usecs but xloops in i386 and x86_64
* our implementation requires usecs as arg
* it gets a xloops count when called by asm/arch/delay.h
Bugs related to this (extremely long shutdown times) where reported by some
x86_64 users, especially using Device Mapper.
To hit this bug, a compile-time constant time parameter must be passed -
that's why UML seems to work most times. Fix this with a simple udelay
implementation.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Acked-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-um/delay.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/include/asm-um/delay.h b/include/asm-um/delay.h index 0985bda66750..c71e32b6741e 100644 --- a/include/asm-um/delay.h +++ b/include/asm-um/delay.h | |||
| @@ -1,9 +1,20 @@ | |||
| 1 | #ifndef __UM_DELAY_H | 1 | #ifndef __UM_DELAY_H |
| 2 | #define __UM_DELAY_H | 2 | #define __UM_DELAY_H |
| 3 | 3 | ||
| 4 | #include "asm/arch/delay.h" | ||
| 5 | #include "asm/archparam.h" | ||
| 6 | |||
| 7 | #define MILLION 1000000 | 4 | #define MILLION 1000000 |
| 8 | 5 | ||
| 6 | /* Undefined on purpose */ | ||
| 7 | extern void __bad_udelay(void); | ||
| 8 | |||
| 9 | extern void __udelay(unsigned long usecs); | ||
| 10 | extern void __delay(unsigned long loops); | ||
| 11 | |||
| 12 | #define udelay(n) ((__builtin_constant_p(n) && (n) > 20000) ? \ | ||
| 13 | __bad_udelay() : __udelay(n)) | ||
| 14 | |||
| 15 | /* It appears that ndelay is not used at all for UML, and has never been | ||
| 16 | * implemented. */ | ||
| 17 | extern void __unimplemented_ndelay(void); | ||
| 18 | #define ndelay(n) __unimplemented_ndelay() | ||
| 19 | |||
| 9 | #endif | 20 | #endif |
