Pull locking fixes from Ingo Molnar: "Two fixes from lockdep coverage of seqlocks, which fix deadlocks on lockdep-enabled ARM systems" * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched_clock: Disable seqlock lockdep usage in sched_clock() seqlock: Use raw_ prefix instead of _no_lockdep
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -117,15 +117,15 @@ repeat: · 116 unmodified lines | ||
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
| 120 | − * read_seqcount_begin_no_lockdep - start seq-read critical section w/o lockdep | |
| 120 | + * raw_read_seqcount_begin - start seq-read critical section w/o lockdep | |
| 121 | 121 | * @s: pointer to seqcount_t |
| 122 | 122 | * Returns: count to be passed to read_seqcount_retry |
| 123 | 123 | * |
| 124 | − * read_seqcount_begin_no_lockdep opens a read critical section of the given | |
| 124 | + * raw_read_seqcount_begin opens a read critical section of the given | |
| 125 | 125 | * seqcount, but without any lockdep checking. Validity of the critical |
| 126 | 126 | * section is tested by checking read_seqcount_retry function. |
| 127 | 127 | */ |
| 128 | −static inline unsigned read_seqcount_begin_no_lockdep(const seqcount_t *s) | |
| 128 | +static inline unsigned raw_read_seqcount_begin(const seqcount_t *s) | |
| 129 | 129 | { |
| 130 | 130 | unsigned ret = __read_seqcount_begin(s); |
| 131 | 131 | smp_rmb(); |
| @@ -144,7 +144,7 @@ static inline unsigned read_seqcount_begin_no_lockdep(const seqcount_t *s) · 12 unmodified lines | ||
| 144 | 144 | static inline unsigned read_seqcount_begin(const seqcount_t *s) |
| 145 | 145 | { |
| 146 | 146 | seqcount_lockdep_reader_access(s); |
| 147 | − return read_seqcount_begin_no_lockdep(s); | |
| 147 | + return raw_read_seqcount_begin(s); | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /** |
| @@ -206,14 +206,26 @@ static inline int read_seqcount_retry(const seqcount_t *s, unsigned start) · 55 unmodified lines | ||
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | |
| 209 | + | |
| 210 | +static inline void raw_write_seqcount_begin(seqcount_t *s) | |
| 211 | +{ | |
| 212 | + s->sequence++; | |
| 213 | + smp_wmb(); | |
| 214 | +} | |
| 215 | + | |
| 216 | +static inline void raw_write_seqcount_end(seqcount_t *s) | |
| 217 | +{ | |
| 218 | + smp_wmb(); | |
| 219 | + s->sequence++; | |
| 220 | +} | |
| 221 | + | |
| 209 | 222 | /* |
| 210 | 223 | * Sequence counter only version assumes that callers are using their |
| 211 | 224 | * own mutexing. |
| 212 | 225 | */ |
| 213 | 226 | static inline void write_seqcount_begin_nested(seqcount_t *s, int subclass) |
| 214 | 227 | { |
| 215 | − s->sequence++; | |
| 216 | − smp_wmb(); | |
| 228 | + raw_write_seqcount_begin(s); | |
| 217 | 229 | seqcount_acquire(&s->dep_map, subclass, 0, _RET_IP_); |
| 218 | 230 | } |
| 219 | 231 | |
| @@ -225,8 +237,7 @@ static inline void write_seqcount_begin(seqcount_t *s) · 5 unmodified lines | ||
| 225 | 237 | static inline void write_seqcount_end(seqcount_t *s) |
| 226 | 238 | { |
| 227 | 239 | seqcount_release(&s->dep_map, 1, _RET_IP_); |
| 228 | − smp_wmb(); | |
| 229 | − s->sequence++; | |
| 240 | + raw_write_seqcount_end(s); | |
| 230 | 241 | } |
| 231 | 242 | |
| 232 | 243 | /** |