diff options
Diffstat (limited to 'include/linux/seqlock.h')
| -rw-r--r-- | include/linux/seqlock.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 7973a821ac58..ead97654c4e9 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
| @@ -277,7 +277,10 @@ static inline void raw_write_seqcount_barrier(seqcount_t *s) | |||
| 277 | 277 | ||
| 278 | static inline int raw_read_seqcount_latch(seqcount_t *s) | 278 | static inline int raw_read_seqcount_latch(seqcount_t *s) |
| 279 | { | 279 | { |
| 280 | return lockless_dereference(s)->sequence; | 280 | int seq = READ_ONCE(s->sequence); |
| 281 | /* Pairs with the first smp_wmb() in raw_write_seqcount_latch() */ | ||
| 282 | smp_read_barrier_depends(); | ||
| 283 | return seq; | ||
| 281 | } | 284 | } |
| 282 | 285 | ||
| 283 | /** | 286 | /** |
| @@ -331,7 +334,7 @@ static inline int raw_read_seqcount_latch(seqcount_t *s) | |||
| 331 | * unsigned seq, idx; | 334 | * unsigned seq, idx; |
| 332 | * | 335 | * |
| 333 | * do { | 336 | * do { |
| 334 | * seq = lockless_dereference(latch)->seq; | 337 | * seq = raw_read_seqcount_latch(&latch->seq); |
| 335 | * | 338 | * |
| 336 | * idx = seq & 0x01; | 339 | * idx = seq & 0x01; |
| 337 | * entry = data_query(latch->data[idx], ...); | 340 | * entry = data_query(latch->data[idx], ...); |
