]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
scsi: lpfc: Add missing memory barrier
authorJames Smart <james.smart@broadcom.com>
Mon, 19 Dec 2016 23:07:30 +0000 (15:07 -0800)
committerTim Gardner <tim.gardner@canonical.com>
Tue, 7 Mar 2017 16:45:53 +0000 (09:45 -0700)
BugLink: http://bugs.launchpad.net/bugs/1670490
On loosely ordered memory systems (PPC for example), the WQE elements
were being updated in memory, but not necessarily flushed before the
separate doorbell was written to hw which would cause hw to dma the
WQE element. Thus, the hardware occasionally received partially
updated WQE data.

Add the memory barrier after updating the WQE memory.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 6b3b3bdb83b4ad51252d21bb13596db879e51850)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/scsi/lpfc/lpfc_sli.c

index fc797b2508105e8f2f316f329e4e3c76a99ac4a7..55d1d2d26e824dab7b05a8ac2220d408f94eacf9 100644 (file)
@@ -120,6 +120,8 @@ lpfc_sli4_wq_put(struct lpfc_queue *q, union lpfc_wqe *wqe)
        if (q->phba->sli3_options & LPFC_SLI4_PHWQ_ENABLED)
                bf_set(wqe_wqid, &wqe->generic.wqe_com, q->queue_id);
        lpfc_sli_pcimem_bcopy(wqe, temp_wqe, q->entry_size);
+       /* ensure WQE bcopy flushed before doorbell write */
+       wmb();
 
        /* Update the host index before invoking device */
        host_index = q->host_index;