Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp241611ybi; Wed, 29 May 2019 20:28:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxDlh+G+lUGQErn0E9sccXs8vwO76Jl+4nmq1aV5ax6IIZ++9qQ/zBVVDD23Zs8G45QWF6 X-Received: by 2002:a17:902:8d92:: with SMTP id v18mr1607388plo.225.1559186906137; Wed, 29 May 2019 20:28:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559186906; cv=none; d=google.com; s=arc-20160816; b=iLhM37dpGqoKyIZuuidc5Gtx0d80GGoXcZgEyetmY99+FAmOXQdVDt7+VXY7UUO+Pe pBW8AWfbTIRIqgtDBofl1i722zptvUXgTU+6iu7Z1qfkjzK9Hf6Otx5jLegDXtqynrAo rrR9xZ4isv6laKY4DtXMPxn5Y6YkVKqreyWymxV0v3nyDdrZOqc7RQzh1kxsVwICTqI5 ZAPpXqg14BBR2njl1rzOwwtN8Sa9QFWfDyCgYhq+Kxl9nfTnbHosGpnUQjRBVOaWyBBr 6vgP8jMR8Qvsvc/gjp+IhxC5QBBS6RG4AuWGYAM93IMMp9uc+wZjFmHwBv0lAYtSGcNU Pj+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Y04ba+/71RjFff+qUzoyWzDc5wZHxGZD+Bq10z7Kp/M=; b=qOUg8AHWKtoK9y+ha2WEv8QAE+GY0iaWODLTlHAAFx84ZtT2nF5b1Td6HdqERH8hIR rX+LH279NUzrWjDg68nChsHNuRtvsUfZMkh+JrkB5im3j/ZS0onKTIyRLE0XyONjTIkH 8xc/JffIqSXx3LMSjpHyuBW7aMD3cn+Y72SL7A/8JMESQ+Gautlmv2HlWhsrcZ2ZMIdB gtiGfpspsK1OzlDT4LfXl4qvqGjxc93MkFiTY4GQb2v/N12lZI2AOk9YwtDquD3/CGWd IY9p1Dwd3rshNwZYh7ixE9doPxOliF/CwRnudr2pwrPucntTu3U6ZgI10f26C5Fmpe4X qbrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="xkH/IWAt"; 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 15si2091547pfh.174.2019.05.29.20.28.10; Wed, 29 May 2019 20:28: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; dkim=pass header.i=@kernel.org header.s=default header.b="xkH/IWAt"; 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 S1732998AbfE3DZF (ORCPT + 99 others); Wed, 29 May 2019 23:25:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:50820 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731514AbfE3DSU (ORCPT ); Wed, 29 May 2019 23:18:20 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A9A2224797; Thu, 30 May 2019 03:18:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186299; bh=26QTh7W2kOaStXsicwHMDRCIoLbn5N/5YiHsHPplAgw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xkH/IWAtGX33ZH3Bk9f0mM2CQnFRgq76WqlS8n64N7qhk94Q4Fqtvg56JvT9j3L1Q wYt1cpWH0N5PIYwHtlskzWHYVUe2t369JVtj1x1sBN+wUyhrBl5oLHWXgiFSa6Vqs6 JAq4pxhoAbe34wmsQpTuMgPad1WD7Ebi6cpuLMQk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dick Kennedy , James Smart , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.19 263/276] scsi: lpfc: Fix SLI3 commands being issued on SLI4 devices Date: Wed, 29 May 2019 20:07:01 -0700 Message-Id: <20190530030541.649106030@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit c95a3b4b0fb8d351e2329a96f87c4fc96a149505 ] During debug, it was seen that the driver is issuing commands specific to SLI3 on SLI4 devices. Although the adapter correctly rejected the command, this should not be done. Revise the code to stop sending these commands on a SLI4 adapter. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/lpfc/lpfc_hbadisc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index eb71877f12f8b..ccdd82b1123f7 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -921,7 +921,11 @@ lpfc_linkdown(struct lpfc_hba *phba) } } lpfc_destroy_vport_work_array(phba, vports); - /* Clean up any firmware default rpi's */ + + /* Clean up any SLI3 firmware default rpi's */ + if (phba->sli_rev > LPFC_SLI_REV3) + goto skip_unreg_did; + mb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); if (mb) { lpfc_unreg_did(phba, 0xffff, LPFC_UNREG_ALL_DFLT_RPIS, mb); @@ -933,6 +937,7 @@ lpfc_linkdown(struct lpfc_hba *phba) } } + skip_unreg_did: /* Setup myDID for link up if we are in pt2pt mode */ if (phba->pport->fc_flag & FC_PT2PT) { mb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); @@ -4855,6 +4860,10 @@ lpfc_unreg_default_rpis(struct lpfc_vport *vport) LPFC_MBOXQ_t *mbox; int rc; + /* Unreg DID is an SLI3 operation. */ + if (phba->sli_rev > LPFC_SLI_REV3) + return; + mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); if (mbox) { lpfc_unreg_did(phba, vport->vpi, LPFC_UNREG_ALL_DFLT_RPIS, -- 2.20.1