From patchwork Fri Feb 15 22:37:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10816069 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 2230B1390 for ; Fri, 15 Feb 2019 22:39:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 100512FD5E for ; Fri, 15 Feb 2019 22:39:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01ADF2FDAC; Fri, 15 Feb 2019 22:39:23 +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 92D8A2FD5E for ; Fri, 15 Feb 2019 22:39:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392963AbfBOWjX (ORCPT ); Fri, 15 Feb 2019 17:39:23 -0500 Received: from mail-eopbgr780051.outbound.protection.outlook.com ([40.107.78.51]:19280 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390411AbfBOWjW (ORCPT ); Fri, 15 Feb 2019 17:39:22 -0500 Received: from BYAPR07CA0074.namprd07.prod.outlook.com (2603:10b6:a03:12b::15) by BL0PR07MB5457.namprd07.prod.outlook.com (2603:10b6:208:37::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Fri, 15 Feb 2019 22:38:41 +0000 Received: from BY2NAM05FT039.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::208) by BYAPR07CA0074.outlook.office365.com (2603:10b6:a03:12b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Fri, 15 Feb 2019 22:38:40 +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 BY2NAM05FT039.mail.protection.outlook.com (10.152.100.176) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Fri, 15 Feb 2019 22:38:40 +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; Fri, 15 Feb 2019 14:37:34 -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 x1FMbWFu025486; Fri, 15 Feb 2019 14:37:32 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1FMbW4D025485; Fri, 15 Feb 2019 14:37:32 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 03/11] qla2xxx: Fix unload when NVMe devices are configured Date: Fri, 15 Feb 2019 14:37:14 -0800 Message-ID: <20190215223722.25439-4-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190215223722.25439-1-hmadhani@marvell.com> References: <20190215223722.25439-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131947439206122733;(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)(396003)(346002)(136003)(39860400002)(376002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(446003)(126002)(2906002)(2616005)(305945005)(86362001)(8936002)(476003)(105606002)(50466002)(76176011)(51416003)(356004)(47776003)(11346002)(1076003)(4326008)(48376002)(6666004)(80596001)(110136005)(54906003)(14444005)(87636003)(42186006)(53936002)(316002)(97736004)(16586007)(36756003)(498600001)(69596002)(81156014)(486006)(106466001)(68736007)(81166006)(50226002)(85426001)(36906005)(26826003)(336012)(8676002)(26005)(5660300002);DIR:OUT;SFP:1101;SCL:1;SRVR:BL0PR07MB5457;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: af4c8084-24ca-4266-f700-08d69396555d X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:BL0PR07MB5457; X-MS-TrafficTypeDiagnostic: BL0PR07MB5457: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 09497C15EB X-Microsoft-Exchange-Diagnostics: 1;BL0PR07MB5457;23:2Zg5T8/aRm40FVDvr2/414LLjCPB7Ywetu3Z0TL6Aw4E6ASTQZxAwbFG07Wl7bh8nyutWy3c2OU1aerUIijlg9gzupmLl2bYMqTysSkSZE8i715oCL5vSMtAap5rWUIt+4/3wcTDebA8uogl9dUPJPHT/Yn7jwoVc9uDMal9eku9ICjeKjdLkv3R5SkI7MsBZykVyIKe6WtGI9U42w3eXYTMmJfeoKfg4wrZmsb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Y4xtKhbt/brFwxyjdUswpTfdxvBxP97clDsLSTRk/6VmTJCANrbzOGzxuG023tpQwbprdv88Ad8d/Pe3tdJs6ugVDR8nMQezxwlw0z67gEsplvga5wewNNtv8EnrQuCvkolzaM5I4wbntzWM82PyUnLBbSEm+Qi+hnlWUHuqeAxAyCD56alB9yaQvGnX3OkY+Ej7+DAMyvvyg34OAFGApC2AGkCgGtnvMJf9cZSeBCO/gr/iKtiPdTebzfQT+pFyDyANmufEMJz7ELkvsJckz8/BJ3EcKDgSYryeM4Akh6pMtH+Ld8kbzM9a5PrzurJbrYtr7L8XV2gDjEFP/r3YWeXbQC/DKRRLLe7ZsaXmLp5HMUKigc0fdMEQFWDKLVmywcdpZXNkOjA6Xdy0= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2019 22:38:40.3570 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af4c8084-24ca-4266-f700-08d69396555d 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: BL0PR07MB5457 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,