From patchwork Wed Feb 13 18:53:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10810727 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 3BFF5922 for ; Wed, 13 Feb 2019 18:54:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BBAF29569 for ; Wed, 13 Feb 2019 18:54:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2012F2D52D; Wed, 13 Feb 2019 18:54:50 +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 A60D929569 for ; Wed, 13 Feb 2019 18:54:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394315AbfBMSys (ORCPT ); Wed, 13 Feb 2019 13:54:48 -0500 Received: from mail-eopbgr790042.outbound.protection.outlook.com ([40.107.79.42]:37931 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2394301AbfBMSyr (ORCPT ); Wed, 13 Feb 2019 13:54:47 -0500 Received: from BYAPR07CA0069.namprd07.prod.outlook.com (2603:10b6:a03:60::46) by MWHPR07MB2911.namprd07.prod.outlook.com (2603:10b6:300:1f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.17; Wed, 13 Feb 2019 18:54:45 +0000 Received: from DM3NAM05FT051.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::208) by BYAPR07CA0069.outlook.office365.com (2603:10b6:a03:60::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Wed, 13 Feb 2019 18:54:45 +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 DM3NAM05FT051.mail.protection.outlook.com (10.152.98.165) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Wed, 13 Feb 2019 18:54:44 +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; Wed, 13 Feb 2019 10:53:35 -0800 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 x1DIrYL6021699; Wed, 13 Feb 2019 10:53:34 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1DIrYcg021698; Wed, 13 Feb 2019 10:53:34 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 03/12] qla2xxx: Fix unload when NVMe devices are configured Date: Wed, 13 Feb 2019 10:53:15 -0800 Message-ID: <20190213185324.21652-4-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190213185324.21652-1-hmadhani@marvell.com> References: <20190213185324.21652-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131945576848119869;(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)(376002)(396003)(39860400002)(136003)(346002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(69596002)(81166006)(81156014)(105606002)(8676002)(97736004)(26005)(4326008)(42186006)(47776003)(80596001)(48376002)(68736007)(16586007)(76176011)(110136005)(106466001)(305945005)(85426001)(8936002)(2906002)(50466002)(87636003)(53936002)(446003)(86362001)(11346002)(54906003)(51416003)(14444005)(26826003)(486006)(2616005)(476003)(36906005)(126002)(6666004)(336012)(316002)(356004)(1076003)(36756003)(50226002)(498600001);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR07MB2911;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM05FT051;1:GKjTnUatkg1Bi+xYATVifRaEYd7jZ25jd7fmoXrNbI6XILEHtPoCKei/w0AYFqbTDooKnnabXcjh5uTPI+Pq1jwDuOcaRLV9f554LS9MG48t5hE4SlD+p6Zg9kDN9F8tK9HJzZ59AQVGPve+VmUMHw== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ae22c8be-8130-488c-8495-08d691e4b821 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:MWHPR07MB2911; X-MS-TrafficTypeDiagnostic: MWHPR07MB2911: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 094700CA91 X-Microsoft-Exchange-Diagnostics: 1;MWHPR07MB2911;23:k6/UXIFlLvHwB0WiQPkI3P0FXHKlg/MKfUF86rQJG9qvAMOS7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/GaC1EnTzf88Ua4TxCaXNcoEZPtDua1s/3R1J2Z4xeb4mceSTyVnHCK5VwEC7+4QgdlIfi2o738m9OAYavLvLnb58e9pGdFefMg== X-Microsoft-Antispam-Message-Info: OJD4whkFOo3jDgqVh7AQdBxwhIjz80Y6VaMHk1z/rwTpsPqKWm+yXgAELtdy6PcpaejQfRHUXyfX/8bSA06uki5A4TjqY47FQNtzPOfdqXWKgWiZMVD0MQPF/0RmybtKjSMrG7aXQJAt4QtgmPZZMaRtpZVSCSxMAo7VgET7TOb2yuffsV5mKMpq6gU/yT5iC+NyC04UEtFfLLfSCL2JOPC930ebzZ/r99+JqcM048SwCYUN3KyAMYOUrO/XyDG5xaybxfE1IXNehpxuVIyuWHRlJwT2lSBA79r0u5swx91hAmT4mH44DmHqgflAtqXDuOvi/yCiuSL4cR+w5W06LdQZNEkdbtD0BStgUNv1D8rT2WWC0k5Jzb5zX0Kz7LyH6+ibYa0JrI5LznhYgAe4YiwUp/pnaNmCnrjizAcQKI8= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2019 18:54:44.3856 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ae22c8be-8130-488c-8495-08d691e4b821 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: MWHPR07MB2911 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 This patch fixes driver unload issue when FC-NVMe devices are configured. Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_nvme.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index d6ba078d8255..232b987e79dd 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -607,6 +607,7 @@ 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; @@ -614,6 +615,15 @@ 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) { @@ -630,23 +640,11 @@ static void qla_nvme_unregister_remote_port(struct work_struct *work) void qla_nvme_delete(struct scsi_qla_host *vha) { - struct qla_nvme_rport *qla_rport, *trport; - fc_port_t *fcport; int nv_ret; if (!IS_ENABLED(CONFIG_NVME_FC)) return; - list_for_each_entry_safe(qla_rport, trport, - &vha->nvme_rport_list, list) { - fcport = qla_rport->fcport; - - ql_log(ql_log_info, fcport->vha, 0x2114, "%s: fcport=%p\n", - __func__, fcport); - - nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, 0); - } - if (vha->nvme_local_port) { init_completion(&vha->nvme_del_done); ql_log(ql_log_info, vha, 0x2116,