From: Chris J Arges <chris.j.arges@canonical.com>
To: stable@vger.kernel.org
Cc: kamal.mostafa@canonical.com
Subject: commit 27f344eb15dd0da80ebec80c7245e8c85043f841
Date: Thu, 25 Jun 2015 11:22:00 -0500 [thread overview]
Message-ID: <20150625162200.GA5867@canonical.com> (raw)
Please consider adding commit 27f344eb15dd0da80ebec80c7245e8c85043f841 to the
following stable trees: 3.10.y 3.12.y 3.13.y-ckt 3.14.y
It is a clean cherry-pick for these series, and addresses an issue on Power
systems under I/O stress and using the lpfc driver.
BugLink: http://bugs.launchpad.net/bugs/1468416
--
>From 27f344eb15dd0da80ebec80c7245e8c85043f841 Mon Sep 17 00:00:00 2001
From: James Smart <james.smart@emulex.com>
Date: Wed, 7 May 2014 17:16:46 -0400
Subject: [PATCH] lpfc: Add iotag memory barrier
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@linux.vnet.ibm.com>
Signed-off-by: James Smart <james.smart@emulex.com>
---
lpfc_sli.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/scsi/lpfc/lpfc_sli.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 6bb51f8..393662c 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -265,6 +265,16 @@ lpfc_sli4_eq_get(struct lpfc_queue *q)
return NULL;
q->hba_index = idx;
+
+ /*
+ * insert barrier for instruction interlock : data from the hardware
+ * must have the valid bit checked before it can be copied and acted
+ * upon. Given what was seen in lpfc_sli4_cq_get() of speculative
+ * instructions allowing action on content before valid bit checked,
+ * add barrier here as well. May not be needed as "content" is a
+ * single 32-bit entity here (vs multi word structure for cq's).
+ */
+ mb();
return eqe;
}
@@ -370,6 +380,17 @@ lpfc_sli4_cq_get(struct lpfc_queue *q)
cqe = q->qe[q->hba_index].cqe;
q->hba_index = idx;
+
+ /*
+ * insert barrier for instruction interlock : data from the hardware
+ * must have the valid bit checked before it can be copied and acted
+ * upon. Speculative instructions were allowing a bcopy at the start
+ * of lpfc_sli4_fp_handle_wcqe(), which is called immediately
+ * after our return, to copy data before the valid bit check above
+ * was done. As such, some of the copied data was stale. The barrier
+ * ensures the check is before any data is copied.
+ */
+ mb();
return cqe;
}
--
1.9.1
next reply other threads:[~2015-06-25 16:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-25 16:22 Chris J Arges [this message]
2015-06-27 0:49 ` commit 27f344eb15dd0da80ebec80c7245e8c85043f841 Greg KH
2015-06-29 13:33 ` Jiri Slaby
2015-07-01 19:30 ` Kamal Mostafa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150625162200.GA5867@canonical.com \
--to=chris.j.arges@canonical.com \
--cc=kamal.mostafa@canonical.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).