usb: dwc2: gadget: set the quirk_ep_out_alinged_size as true
[platform/kernel/linux-rpi.git] / drivers / ptp / ptp_chardev.c
index 362bf75..5a3a4cc 100644 (file)
@@ -490,7 +490,8 @@ ssize_t ptp_read(struct posix_clock *pc,
 
        for (i = 0; i < cnt; i++) {
                event[i] = 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);