lkml.org 
[lkml]   [2022]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 6/9] nvme-apple: Add initial Apple SoC NVMe driver
    On Mon, Mar 21, 2022 at 05:50:46PM +0100, Sven Peter wrote:
    > +static bool apple_nvme_poll_cq(struct apple_nvme_queue *q,
    > + struct io_comp_batch *iob)
    > +{
    > + bool found = false;
    > +
    > + while (apple_nvme_cqe_pending(q)) {
    > + found = true;
    > +
    > + /*
    > + * load-load control dependency between phase and the rest of
    > + * the cqe requires a full read memory barrier
    > + */
    > + dma_rmb();
    > + apple_nvme_handle_cqe(q, iob, q->cq_head);
    > + apple_nvme_update_cq_head(q);
    > + }
    > +
    > + if (found)
    > + writel_relaxed(q->cq_head, q->cq_db);

    Doesn't a relaxed write mean that a subsequent write can bypass the previous?
    If so, that sounds like it can corrupt the cq head.

    \
     
     \ /
      Last update: 2022-09-17 16:18    [W:6.604 / U:0.096 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site