diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-10-08 09:32:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-08 15:32:35 -0400 |
commit | 7a39f52202a70ff6834e37053e2ee55c7d351621 (patch) | |
tree | de2f029495110336d2dd2b89205db2c62710dd50 /arch/sparc/kernel/sparc_ksyms.c | |
parent | 6d24c8dc2e656b02807aa0506405727d34c0376c (diff) |
[PATCH] sparc32 rwlock fix
read_trylock() is broken on sparc32 (doesn't build and didn't work
right, actually). Proposed fix:
- make "writer holds lock" distinguishable from "reader tries to grab
lock"
- have __raw_read_trylock() try to acquire the mutex (in LSB of lock),
terminating spin if we see that there's writer holding it. Then do
the rest as we do in read_lock().
Thanks to Ingo for discussion...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/sparc/kernel/sparc_ksyms.c')
-rw-r--r-- | arch/sparc/kernel/sparc_ksyms.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c index 4d441a554d35..33dadd9f2871 100644 --- a/arch/sparc/kernel/sparc_ksyms.c +++ b/arch/sparc/kernel/sparc_ksyms.c | |||
@@ -87,6 +87,7 @@ extern void ___set_bit(void); | |||
87 | extern void ___clear_bit(void); | 87 | extern void ___clear_bit(void); |
88 | extern void ___change_bit(void); | 88 | extern void ___change_bit(void); |
89 | extern void ___rw_read_enter(void); | 89 | extern void ___rw_read_enter(void); |
90 | extern void ___rw_read_try(void); | ||
90 | extern void ___rw_read_exit(void); | 91 | extern void ___rw_read_exit(void); |
91 | extern void ___rw_write_enter(void); | 92 | extern void ___rw_write_enter(void); |
92 | 93 | ||
@@ -104,8 +105,9 @@ extern unsigned _Urem(unsigned, unsigned); | |||
104 | EXPORT_SYMBOL(sparc_cpu_model); | 105 | EXPORT_SYMBOL(sparc_cpu_model); |
105 | EXPORT_SYMBOL(kernel_thread); | 106 | EXPORT_SYMBOL(kernel_thread); |
106 | #ifdef CONFIG_SMP | 107 | #ifdef CONFIG_SMP |
107 | // XXX find what uses (or used) these. | 108 | // XXX find what uses (or used) these. AV: see asm/spinlock.h |
108 | EXPORT_SYMBOL(___rw_read_enter); | 109 | EXPORT_SYMBOL(___rw_read_enter); |
110 | EXPORT_SYMBOL(___rw_read_try); | ||
109 | EXPORT_SYMBOL(___rw_read_exit); | 111 | EXPORT_SYMBOL(___rw_read_exit); |
110 | EXPORT_SYMBOL(___rw_write_enter); | 112 | EXPORT_SYMBOL(___rw_write_enter); |
111 | #endif | 113 | #endif |