Received: by 10.213.65.68 with SMTP id h4csp244836imn; Fri, 23 Mar 2018 03:48:26 -0700 (PDT) X-Google-Smtp-Source: AG47ELvmnTVzo0cnH6ksLkI/tRjH7n7MJPxLylcAPqB0RHYS5Ef1R9jIir+eyhssskNZgtlWe1of X-Received: by 10.99.60.6 with SMTP id j6mr20046836pga.73.1521802106445; Fri, 23 Mar 2018 03:48:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521802106; cv=none; d=google.com; s=arc-20160816; b=DltTzmBR5ju1g8TwUSrChui2k/YAwdTuOjCWlSBxoYWhVGwxROdnJHSvluxLKq6EAK Q3BWXjH/Wze3ifng9RoiMEPgzfE85pVGJMjtkrTrfyxqTRwaKK9ndDurFMH/EdEpfJ7m nFxBwwp2ccNZV5vfMewuj59RZP6+4kt/7+6L66FhrLvYVfcICkRT0OZhr2SqzeV/v96p SyhKDPOYwbxJ2Qaza4pOBOQojxVD5QC0QILEI1xy0ddKONAYc3Nm3AD6bUjHnQQfJ/jo W2hcY6J2ldNUBrIfnMhk94frNB6Q8tA1XkLCUTuiMjm0w/sAkvcFGxkn7MVBTiKnkoVh LfUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=MuJjBN+q/7p0KoocwKEkcrhRTK9GyotTJb9Wxu9/gt0=; b=oowjGdCWNlV1WjE7wwotpo5oo6r5uuYUm+C51rldPTjKbbRk0NcqRvNTy9fZtQjmH5 62ttvmQmQMBnKhZ2Jk5YTfJy3LKQkkOpX5uu78ysVmsr7bR138br1j4DZhFxaIsVh1az IS/1E7ObM6T8PkX1dWCsw6WeyAVoBhyo10siE78/Zgn1T7mO2yD6iDUWtJmsqODdzRH/ m42Zt1GML1ZMYqwb5Bb/0qKiCIVPak54Rc8D3oVtdoRONYKRrlpyTIK+hsUs766bCxty GQnGFxQE3k8ZTCunWU2nDfleJL05Q0eCpu5VWPnLhAMiLJt/1pkd67umUb0DzYFRV7OK u9tA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h14si6470804pfd.404.2018.03.23.03.48.12; Fri, 23 Mar 2018 03:48:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933432AbeCWKPN (ORCPT + 99 others); Fri, 23 Mar 2018 06:15:13 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45516 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933400AbeCWKPJ (ORCPT ); Fri, 23 Mar 2018 06:15:09 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E36D41275; Fri, 23 Mar 2018 10:15:08 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dick Kennedy , James Smart , Johannes Thumshirn , Sasha Levin Subject: [PATCH 4.4 37/97] Fix driver usage of 128B WQEs when WQ_CREATE is V1. Date: Fri, 23 Mar 2018 10:54:24 +0100 Message-Id: <20180323094159.737455073@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323094157.535925724@linuxfoundation.org> References: <20180323094157.535925724@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: James Smart [ 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 Signed-off-by: James Smart Reviewed-by: Johannes Thumshirn Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/lpfc/lpfc_sli.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -13493,6 +13493,9 @@ lpfc_wq_create(struct lpfc_hba *phba, st 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: