From patchwork Tue Apr 4 17:17:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dick Kennedy X-Patchwork-Id: 9662239 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 16B1260353 for ; Tue, 4 Apr 2017 17:27:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05D0A22B39 for ; Tue, 4 Apr 2017 17:27:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE62428469; Tue, 4 Apr 2017 17:27:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A05B126E75 for ; Tue, 4 Apr 2017 17:27:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932260AbdDDR1F (ORCPT ); Tue, 4 Apr 2017 13:27:05 -0400 Received: from lpdvrndsmtp01.broadcom.com ([192.19.229.170]:38157 "EHLO rnd-relay.smtp.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755046AbdDDRZi (ORCPT ); Tue, 4 Apr 2017 13:25:38 -0400 Received: from pallmd1.broadcom.com (pallmd1.ash.broadcom.net [10.85.232.165]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id A087830C092 for ; Tue, 4 Apr 2017 10:17:28 -0700 (PDT) Received: from lvnvda1400.lvn.broadcom.net (lvnvda1400.lvn.broadcom.net [10.75.197.131]) by pallmd1.broadcom.com (Postfix) with ESMTP id 849D6360052; Tue, 4 Apr 2017 13:17:28 -0400 (EDT) Received: from lvnvda1400.lvn.broadcom.net (localhost.localdomain [127.0.0.1]) by lvnvda1400.lvn.broadcom.net (8.14.4/8.14.4) with ESMTP id v34HHRcV011334; Tue, 4 Apr 2017 10:17:27 -0700 Received: (from rkennedy@localhost) by lvnvda1400.lvn.broadcom.net (8.14.4/8.14.4/Submit) id v34HHR3i011333; Tue, 4 Apr 2017 10:17:27 -0700 From: Dick Kennedy To: linux-scsi@vger.kernel.org Cc: Dick Kennedy , Dick Kennedy , James Smart Subject: [lpfc 07/19] Fix driver usage of 128B WQEs when WQ_CREATE is V1. Date: Tue, 4 Apr 2017 10:17:00 -0700 Message-Id: <1491326232-11255-8-git-send-email-rkennedy@broadcom.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1491326232-11255-1-git-send-email-rkennedy@broadcom.com> References: <1491326232-11255-1-git-send-email-rkennedy@broadcom.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dick Kennedy 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: