Add a memory barrier to ensure the valid bit is read before any of the cqe payload is read. This fixes an issue seen on Power where the cqe payload was getting loaded before the valid bit. When this occurred, we saw an iotag out of range error when a command completed, but since the iotag looked invalid the command didn't get completed to scsi core. Later we hit the command timeout, attempted to abort the command, then waited for the aborted command to get returned. Since the adapter already returned the command, we timeout waiting, and end up escalating EEH all the way to host reset. This patch fixes this issue. Signed-off-by: Brian King <brking@xxxxxxxxxxxxxxxxxx> --- drivers/scsi/lpfc/lpfc_sli.c | 2 ++ 1 file changed, 2 insertions(+) diff -puN drivers/scsi/lpfc/lpfc_sli.c~lpfc_iotag_barrier drivers/scsi/lpfc/lpfc_sli.c --- linux/drivers/scsi/lpfc/lpfc_sli.c~lpfc_iotag_barrier 2014-05-07 09:28:23.000000000 -0500 +++ linux-bjking1/drivers/scsi/lpfc/lpfc_sli.c 2014-05-07 09:28:23.000000000 -0500 @@ -265,6 +265,7 @@ lpfc_sli4_eq_get(struct lpfc_queue *q) return NULL; q->hba_index = idx; + mb(); return eqe; } @@ -370,6 +371,7 @@ lpfc_sli4_cq_get(struct lpfc_queue *q) cqe = q->qe[q->hba_index].cqe; q->hba_index = idx; + mb(); return cqe; } _ -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html