Skip to content

Commit 18477ba

Browse files
James Smartgregkh
authored andcommitted
scsi: lpfc: Add missing memory barrier
[ Upstream commit 6b3b3bdb83b4ad51252d21bb13596db879e51850 ] 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> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent fdc1e9d commit 18477ba

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/scsi/lpfc/lpfc_sli.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ lpfc_sli4_wq_put(struct lpfc_queue *q, union lpfc_wqe *wqe)
118118
if (q->phba->sli3_options & LPFC_SLI4_PHWQ_ENABLED)
119119
bf_set(wqe_wqid, &wqe->generic.wqe_com, q->queue_id);
120120
lpfc_sli_pcimem_bcopy(wqe, temp_wqe, q->entry_size);
121+
/* ensure WQE bcopy flushed before doorbell write */
122+
wmb();
121123

122124
/* Update the host index before invoking device */
123125
host_index = q->host_index;

0 commit comments

Comments
 (0)