diff options
-rw-r--r-- | arch/x86/include/asm/qrwlock.h | 10 | ||||
-rw-r--r-- | include/asm-generic/qrwlock.h | 9 |
2 files changed, 1 insertions, 18 deletions
diff --git a/arch/x86/include/asm/qrwlock.h b/arch/x86/include/asm/qrwlock.h index a8810bf135ab..c537cbb038a7 100644 --- a/arch/x86/include/asm/qrwlock.h +++ b/arch/x86/include/asm/qrwlock.h | |||
@@ -2,16 +2,6 @@ | |||
2 | #define _ASM_X86_QRWLOCK_H | 2 | #define _ASM_X86_QRWLOCK_H |
3 | 3 | ||
4 | #include <asm-generic/qrwlock_types.h> | 4 | #include <asm-generic/qrwlock_types.h> |
5 | |||
6 | #ifndef CONFIG_X86_PPRO_FENCE | ||
7 | #define queued_write_unlock queued_write_unlock | ||
8 | static inline void queued_write_unlock(struct qrwlock *lock) | ||
9 | { | ||
10 | barrier(); | ||
11 | ACCESS_ONCE(*(u8 *)&lock->cnts) = 0; | ||
12 | } | ||
13 | #endif | ||
14 | |||
15 | #include <asm-generic/qrwlock.h> | 5 | #include <asm-generic/qrwlock.h> |
16 | 6 | ||
17 | #endif /* _ASM_X86_QRWLOCK_H */ | 7 | #endif /* _ASM_X86_QRWLOCK_H */ |
diff --git a/include/asm-generic/qrwlock.h b/include/asm-generic/qrwlock.h index deb9e8b0eb9e..eb673dde8879 100644 --- a/include/asm-generic/qrwlock.h +++ b/include/asm-generic/qrwlock.h | |||
@@ -134,21 +134,14 @@ static inline void queued_read_unlock(struct qrwlock *lock) | |||
134 | atomic_sub(_QR_BIAS, &lock->cnts); | 134 | atomic_sub(_QR_BIAS, &lock->cnts); |
135 | } | 135 | } |
136 | 136 | ||
137 | #ifndef queued_write_unlock | ||
138 | /** | 137 | /** |
139 | * queued_write_unlock - release write lock of a queue rwlock | 138 | * queued_write_unlock - release write lock of a queue rwlock |
140 | * @lock : Pointer to queue rwlock structure | 139 | * @lock : Pointer to queue rwlock structure |
141 | */ | 140 | */ |
142 | static inline void queued_write_unlock(struct qrwlock *lock) | 141 | static inline void queued_write_unlock(struct qrwlock *lock) |
143 | { | 142 | { |
144 | /* | 143 | smp_store_release((u8 *)&lock->cnts, 0); |
145 | * If the writer field is atomic, it can be cleared directly. | ||
146 | * Otherwise, an atomic subtraction will be used to clear it. | ||
147 | */ | ||
148 | smp_mb__before_atomic(); | ||
149 | atomic_sub(_QW_LOCKED, &lock->cnts); | ||
150 | } | 144 | } |
151 | #endif | ||
152 | 145 | ||
153 | /* | 146 | /* |
154 | * Remapping rwlock architecture specific functions to the corresponding | 147 | * Remapping rwlock architecture specific functions to the corresponding |