summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJames Smart <jsmart2021@gmail.com>2017-04-21 16:04:56 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-24 10:57:33 +0100
commitc84d2e72f5dd07d6a3fc4195a2b8574ba8f7721d (patch)
tree76d46d1a9819855d4f68bebd4496eb1ebc26f7b6 /drivers
parent21bdd575943daef3c951ecd3dd70ef62bb9f065e (diff)
downloadlinux-stable-c84d2e72f5dd07d6a3fc4195a2b8574ba8f7721d.tar.gz
linux-stable-c84d2e72f5dd07d6a3fc4195a2b8574ba8f7721d.tar.bz2
linux-stable-c84d2e72f5dd07d6a3fc4195a2b8574ba8f7721d.zip
Fix driver usage of 128B WQEs when WQ_CREATE is V1.
[ Upstream commit 3f247de750b8dd8f50a2c1390e2a1238790a9dff ] There are two versions of a structure for queue creation and setup that the driver shares with FW. The driver was only treating as version 0. Verify WQ_CREATE with 128B WQEs in V0 and V1. Code review of another bug showed the driver passing 128B WQEs and 8 pages in WQ CREATE and V0. Code inspection/instrumentation showed that the driver uses V0 in WQ_CREATE and if the caller passes queue->entry_size 128B, the driver sets the hdr_version to V1 so all is good. When I tested the V1 WQ_CREATE, the mailbox failed causing the driver to unload. Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <james.smart@broadcom.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index fb7dc27a2e1c..c3cdb9f72bd8 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -13469,6 +13469,9 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq,
case LPFC_Q_CREATE_VERSION_1:
bf_set(lpfc_mbx_wq_create_wqe_count, &wq_create->u.request_1,
wq->entry_count);
+ bf_set(lpfc_mbox_hdr_version, &shdr->request,
+ LPFC_Q_CREATE_VERSION_1);
+
switch (wq->entry_size) {
default:
case 64: