From patchwork Thu Mar 28 17:10:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10875461 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 205E7186E for ; Thu, 28 Mar 2019 17:12:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0E7D28BE7 for ; Thu, 28 Mar 2019 17:12:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5B4328CC9; Thu, 28 Mar 2019 17:12:00 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 9003B28EB3 for ; Thu, 28 Mar 2019 17:12:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726715AbfC1RMA (ORCPT ); Thu, 28 Mar 2019 13:12:00 -0400 Received: from mail-eopbgr680075.outbound.protection.outlook.com ([40.107.68.75]:7745 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726029AbfC1RL7 (ORCPT ); Thu, 28 Mar 2019 13:11:59 -0400 Received: from DM5PR07CA0033.namprd07.prod.outlook.com (2603:10b6:3:16::19) by SN1PR07MB4030.namprd07.prod.outlook.com (2603:10b6:802:2b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.16; Thu, 28 Mar 2019 17:11:57 +0000 Received: from BY2NAM05FT014.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by DM5PR07CA0033.outlook.office365.com (2603:10b6:3:16::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.17 via Frontend Transport; Thu, 28 Mar 2019 17:11:56 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by BY2NAM05FT014.mail.protection.outlook.com (10.152.100.151) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1771.6 via Frontend Transport; Thu, 28 Mar 2019 17:11:55 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Thu, 28 Mar 2019 10:10:52 -0700 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id x2SHApa5026504; Thu, 28 Mar 2019 10:10:51 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x2SHApEo026503; Thu, 28 Mar 2019 10:10:51 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 11/15] qla2xxx: Set remote port devloss timeout to 0 Date: Thu, 28 Mar 2019 10:10:08 -0700 Message-ID: <20190328171012.26425-12-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190328171012.26425-1-hmadhani@marvell.com> References: <20190328171012.26425-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131982667164152877;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(39860400002)(346002)(376002)(396003)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(11346002)(336012)(476003)(126002)(486006)(105606002)(446003)(2616005)(1076003)(53936002)(6666004)(356004)(2906002)(106466001)(26005)(8676002)(81156014)(81166006)(4326008)(54906003)(86362001)(110136005)(305945005)(16586007)(316002)(51416003)(36756003)(76176011)(69596002)(47776003)(498600001)(50466002)(5660300002)(8936002)(48376002)(80596001)(50226002)(68736007)(42186006)(26826003)(87636003)(97736004)(85426001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR07MB4030;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 97c2c50c-86b4-4dbe-dd42-08d6b3a07b37 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600127)(711020)(4605104)(2017052603328);SRVR:SN1PR07MB4030; X-MS-TrafficTypeDiagnostic: SN1PR07MB4030: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0990C54589 X-Microsoft-Antispam-Message-Info: xAQ8q9Bf+gKMV5POPWjOTXCwIU+PcspEf5xBeukznjGXg/8GD5JEeMlsPEtrErVxiFJ97CL44VJtFWW4J51J9YVcTDhj4QU1TMJapB20nUkeTlbnpOqKLf5xRbtSC46zx4RNr2DbLTOCj2o7eQn7Bo699uQHk9xHuIB2deLob2bBEdo4TF19Yb2vglGGMA8rzv9Ps+aHMVsZMH6d1LL9qC2iFL+ObUEM1nRrmHqTvGscWHsdh6mjPsGR7mkIetnnwAwh4o4ArezcDTpRI2D3UxT+WaelAJWUzlIXsL9qc7AGVglPlq+fsBSVcmNaruIdujru4yHQOfS1ru2N97kqg7+BDFF3Y2sK08v3BhXkqqrfasyZ8TxCnWpHnLOw7k3LQtFk4hf17PrRKVjUzHWDY2Ukn3recuUTO2V8icH9TTY= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2019 17:11:55.6726 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97c2c50c-86b4-4dbe-dd42-08d6b3a07b37 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB4030 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: Giridhar Malavali This patch sets remote_port_devloss value to 0. This indicates to FC-NVMe transport that driver is unloading and transport should not retry. Fixes: e476fe8af5ff ("scsi: qla2xxx: Fix unload when NVMe devices are configured") Cc: stable@vger.kernel.org Signed-off-by: Giridhar Malavali Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_nvme.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index cc2afc21a30d..46c14bfecd4e 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -615,7 +615,6 @@ static void qla_nvme_unregister_remote_port(struct work_struct *work) struct fc_port *fcport = container_of(work, struct fc_port, nvme_del_work); struct qla_nvme_rport *qla_rport, *trport; - scsi_qla_host_t *base_vha; if (!IS_ENABLED(CONFIG_NVME_FC)) return; @@ -623,23 +622,19 @@ static void qla_nvme_unregister_remote_port(struct work_struct *work) ql_log(ql_log_warn, NULL, 0x2112, "%s: unregister remoteport on %p\n",__func__, fcport); - base_vha = pci_get_drvdata(fcport->vha->hw->pdev); - if (test_bit(PFLG_DRIVER_REMOVING, &base_vha->pci_flags)) { - ql_dbg(ql_dbg_disc, fcport->vha, 0x2114, - "%s: Notify FC-NVMe transport, set devloss=0\n", - __func__); - - nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, 0); - } - list_for_each_entry_safe(qla_rport, trport, &fcport->vha->nvme_rport_list, list) { if (qla_rport->fcport == fcport) { ql_log(ql_log_info, fcport->vha, 0x2113, "%s: fcport=%p\n", __func__, fcport); + nvme_fc_set_remoteport_devloss + (fcport->nvme_remote_port, 0); init_completion(&fcport->nvme_del_done); - nvme_fc_unregister_remoteport( - fcport->nvme_remote_port); + if (nvme_fc_unregister_remoteport + (fcport->nvme_remote_port)) + ql_log(ql_log_info, fcport->vha, 0x2114, + "%s: Failed to unregister nvme_remote_port\n", + __func__); wait_for_completion(&fcport->nvme_del_done); break; }