diff options
author | kanoj <kanoj> | 2002-02-02 03:33:48 +0000 |
---|---|---|
committer | kanoj <kanoj> | 2002-02-02 03:33:48 +0000 |
commit | d90dd365c478667e07c53bb8269405771ca659cd (patch) | |
tree | a5d66efb47e1012de771500a03a8125d4909ec1b | |
parent | 196c12e4cd0e24949ff52bee94e6839db0f6d4a0 (diff) | |
download | netdev-vger-cvs-d90dd365c478667e07c53bb8269405771ca659cd.tar.gz |
Forward port cpu_relax fix from 2.4: Implement a somewhat randomized
version of cpu_relax() to alleviate livelock problems in the brlock
code, seen when writer and reader cpus get instep with each other.
-rw-r--r-- | drivers/video/aty/mach64_accel.c | 1 | ||||
-rw-r--r-- | include/asm-sparc64/delay.h | 10 | ||||
-rw-r--r-- | include/asm-sparc64/processor.h | 5 |
3 files changed, 12 insertions, 4 deletions
diff --git a/drivers/video/aty/mach64_accel.c b/drivers/video/aty/mach64_accel.c index 1252d7334..ca2700a7a 100644 --- a/drivers/video/aty/mach64_accel.c +++ b/drivers/video/aty/mach64_accel.c @@ -3,6 +3,7 @@ * ATI Mach64 Hardware Acceleration */ +#include <linux/sched.h> #include <linux/delay.h> #include <linux/fb.h> diff --git a/include/asm-sparc64/delay.h b/include/asm-sparc64/delay.h index 8c1439b15..3819bb1bf 100644 --- a/include/asm-sparc64/delay.h +++ b/include/asm-sparc64/delay.h @@ -1,4 +1,4 @@ -/* $Id: delay.h,v 1.12 2001-04-24 01:09:12 davem Exp $ +/* $Id: delay.h,v 1.13 2002-02-02 03:33:48 kanoj Exp $ * delay.h: Linux delay routines on the V9. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu). @@ -9,9 +9,13 @@ #include <linux/config.h> #include <linux/param.h> + +#ifndef __ASSEMBLY__ + #ifdef CONFIG_SMP -#include <linux/sched.h> #include <asm/smp.h> +#else +extern unsigned long loops_per_jiffy; #endif extern __inline__ void __delay(unsigned long loops) @@ -49,4 +53,6 @@ extern __inline__ void __udelay(unsigned long usecs, unsigned long lps) #define udelay(usecs) __udelay((usecs),__udelay_val) +#endif /* !__ASSEMBLY__ */ + #endif /* defined(__SPARC64_DELAY_H) */ diff --git a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h index 6015dde8a..8d6fdbe63 100644 --- a/include/asm-sparc64/processor.h +++ b/include/asm-sparc64/processor.h @@ -1,4 +1,4 @@ -/* $Id: processor.h,v 1.80 2001-11-17 00:10:48 davem Exp $ +/* $Id: processor.h,v 1.81 2002-02-02 03:33:48 kanoj Exp $ * include/asm-sparc64/processor.h * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -21,6 +21,7 @@ #include <asm/signal.h> #include <asm/segment.h> #include <asm/page.h> +#include <asm/delay.h> /* Bus types */ #define EISA_bus 0 @@ -304,7 +305,7 @@ __out: __ret; \ #define init_task (init_task_union.task) #define init_stack (init_task_union.stack) -#define cpu_relax() do { } while (0) +#define cpu_relax() udelay(1 + smp_processor_id()) #endif /* __KERNEL__ */ |