seqlock: add SMP_WMB to seqlock

This commit added SMP_WMB to seqlock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
hujun5
2025-09-19 20:17:04 +08:00
committed by Alan C. Assis
parent 65247f2603
commit 46ad770b60
+2
View File
@@ -161,6 +161,7 @@ irqstate_t write_seqlock_irqsave(FAR seqcount_t *s)
irqstate_t flags = spin_lock_irqsave(&s->lock); irqstate_t flags = spin_lock_irqsave(&s->lock);
s->sequence++; s->sequence++;
SMP_WMB();
return flags; return flags;
} }
@@ -183,6 +184,7 @@ irqstate_t write_seqlock_irqsave(FAR seqcount_t *s)
static inline_function static inline_function
void write_sequnlock_irqrestore(seqcount_t *s, irqstate_t flags) void write_sequnlock_irqrestore(seqcount_t *s, irqstate_t flags)
{ {
SMP_WMB();
s->sequence++; s->sequence++;
spin_unlock_irqrestore(&s->lock, flags); spin_unlock_irqrestore(&s->lock, flags);
} }