From mboxrd@z Thu Jan 1 00:00:00 1970 From: jsmart2021@gmail.com Subject: [PATCH-v1 12/22] Fix driver usage of 128B WQEs when WQ_CREATE is V1. Date: Wed, 19 Apr 2017 21:46:31 -0700 Message-ID: <20170420044641.10657-13-jsmart2021@gmail.com> References: <20170420044641.10657-1-jsmart2021@gmail.com> Return-path: Received: from mail-oi0-f66.google.com ([209.85.218.66]:36002 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941127AbdDTErP (ORCPT ); Thu, 20 Apr 2017 00:47:15 -0400 Received: by mail-oi0-f66.google.com with SMTP id a3so346864oii.3 for ; Wed, 19 Apr 2017 21:47:15 -0700 (PDT) In-Reply-To: <20170420044641.10657-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: linux-scsi@vger.kernel.org, linux-nvme@lists.infradead.org, sagi@grimberg.me, martin.petersen@oracle.com Cc: James Smart , Dick Kennedy , James Smart From: James Smart 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 Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_sli.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index d606944..1519fdf 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -14741,6 +14741,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: -- 2.1.0