]> Pileus Git - ~andy/linux/blobdiff - include/linux/seqlock.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
[~andy/linux] / include / linux / seqlock.h
index e98cd2e5719446fa69b03aeee3d349d14e138daa..06d69648fc86c3a731c528cde7fba3b72a2688be 100644 (file)
@@ -88,12 +88,12 @@ static __always_inline unsigned read_seqbegin(const seqlock_t *sl)
        unsigned ret;
 
 repeat:
-       ret = sl->sequence;
-       smp_rmb();
+       ret = ACCESS_ONCE(sl->sequence);
        if (unlikely(ret & 1)) {
                cpu_relax();
                goto repeat;
        }
+       smp_rmb();
 
        return ret;
 }