summaryrefslogtreecommitdiffstats
path: root/drivers/ptp/ptp_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ptp/ptp_sysfs.c')
-rw-r--r--drivers/ptp/ptp_sysfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/ptp/ptp_sysfs.c b/drivers/ptp/ptp_sysfs.c
index f97a5eefa..b9e2f0896 100644
--- a/drivers/ptp/ptp_sysfs.c
+++ b/drivers/ptp/ptp_sysfs.c
@@ -91,7 +91,8 @@ static ssize_t extts_fifo_show(struct device *dev,
qcnt = queue_cnt(queue);
if (qcnt) {
event = queue->buf[queue->head];
- queue->head = (queue->head + 1) % PTP_MAX_TIMESTAMPS;
+ /* Paired with READ_ONCE() in queue_cnt() */
+ WRITE_ONCE(queue->head, (queue->head + 1) % PTP_MAX_TIMESTAMPS);
}
spin_unlock_irqrestore(&queue->lock, flags);