Skip to contentSkip to conversation

Patch "scsi: lpfc: Add missing memory barrier" has been added to the 3.18-stable tree

PATCH [email protected] 1 participant 1 message Nov 19, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

scsi: lpfc: Add missing memory barrier

to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
scsi-lpfc-add-missing-memory-barrier.patch
and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Sun Nov 19 12:16:40 CET 2017

From: James Smart <[email protected]>
Date: Mon, 19 Dec 2016 15:07:30 -0800
Subject: scsi: lpfc: Add missing memory barrier

From: James Smart <[email protected]>

[ 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.

---
 drivers/scsi/lpfc/lpfc_sli.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/scsi/lpfc/lpfc_sli.c +2 -0
@@ -118,6 +118,8 @@ lpfc_sli4_wq_put(struct lpfc_queue *q, u
 	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;

Patches currently in stable-queue which might be from [email protected] are

queue-3.18/scsi-lpfc-correct-host-name-in-symbolic_name-field.patch queue-3.18/scsi-lpfc-fcoe-vport-enable-disable-does-not-bring-up-the-vport.patch queue-3.18/scsi-lpfc-correct-issue-leading-to-oops-during-link-reset.patch queue-3.18/scsi-lpfc-add-missing-memory-barrier.patch