From patchwork Tue Feb 12 23:40:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10808971 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 ECC5D1390 for ; Tue, 12 Feb 2019 23:42:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB3D22C080 for ; Tue, 12 Feb 2019 23:42:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC9DF2C083; Tue, 12 Feb 2019 23:42:44 +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 B73ED2C080 for ; Tue, 12 Feb 2019 23:42:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732544AbfBLXmn (ORCPT ); Tue, 12 Feb 2019 18:42:43 -0500 Received: from mail-eopbgr780053.outbound.protection.outlook.com ([40.107.78.53]:31722 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728579AbfBLXmm (ORCPT ); Tue, 12 Feb 2019 18:42:42 -0500 Received: from BYAPR07CA0004.namprd07.prod.outlook.com (2603:10b6:a02:bc::17) by SN1PR0701MB1934.namprd07.prod.outlook.com (2a01:111:e400:517e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.22; Tue, 12 Feb 2019 23:42:01 +0000 Received: from CO1NAM05FT060.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::205) by BYAPR07CA0004.outlook.office365.com (2603:10b6:a02:bc::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Tue, 12 Feb 2019 23:42:01 +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 CO1NAM05FT060.mail.protection.outlook.com (10.152.96.178) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Tue, 12 Feb 2019 23:42:00 +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; Tue, 12 Feb 2019 15:40:56 -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 x1CNeu8v029865; Tue, 12 Feb 2019 15:40:56 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1CNeuC5029864; Tue, 12 Feb 2019 15:40:56 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 03/12] qla2xxx: Fix unload when NVMe devices are configured Date: Tue, 12 Feb 2019 15:40:37 -0800 Message-ID: <20190212234046.29809-4-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190212234046.29809-1-hmadhani@marvell.com> References: <20190212234046.29809-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131944885207915462;(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)(39860400002)(376002)(346002)(136003)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(14444005)(105606002)(6666004)(356004)(1076003)(47776003)(110136005)(498600001)(68736007)(48376002)(16586007)(2906002)(50466002)(316002)(87636003)(42186006)(54906003)(36906005)(26826003)(4326008)(86362001)(76176011)(51416003)(53936002)(106466001)(26005)(85426001)(69596002)(80596001)(36756003)(97736004)(50226002)(446003)(81166006)(8936002)(8676002)(336012)(476003)(81156014)(2616005)(486006)(11346002)(126002)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR0701MB1934;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT060;1:HKevAdqU5t3HQgu8/M+NfrV6G9jROM0cvLWkWpimjdSgyX/TUSFT+IpLTTIaQbsdn78AAIUode9Daj6oyBfhCGqg1yd6/BC1izSj27uP/59pudDLCMIBQ//xtMn1mx9MwSl1qPeU9EPXzeutbjbOUkqnjYhZFRUnZpewtUemS6k= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a8d99dcb-c340-4b64-2848-08d69143af28 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:SN1PR0701MB1934; X-MS-TrafficTypeDiagnostic: SN1PR0701MB1934: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0946DC87A1 X-Microsoft-Exchange-Diagnostics: 1;SN1PR0701MB1934;23:2/Bs3Y1+/k7+y3upvMbjM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KH1w5DHlypmfearnPmOg9ldZdo+73XETMZg2wdsvH/kcJDLNgWuHHgGaB7OA2Bb65i2OIfGjQejPLcuTx82LgzN4JslQiEu+GSZiwNf/A7Qd8abb6mBHXgpIjEYKHwqEWKU2puIx5FaIMt8vcDEQ== X-Microsoft-Antispam-Message-Info: 7SWh9aBOC6a53h90nRIWWJelt4RefVFbGrSuQWxnRgYFRePhgj0tZsXGnKk6qF9QMdNu595r4Ryf/vr0xVcwK48Zlb3HLgQNme9WGM+FLY3Ul3/O0WPhikhEBckvLGUaLuBbDfM/36V9WQhh3yRAndklZW5ZVPSQ/1YlIMceAAyUSic+qz3bZHKNveeDTtqZsIgzYcb7TT6BTxTBiCdkpEZNgpXRcckt0PkapzOUAvy6/X0JEj38tpxELDVrrgkJcDqv4PTkTPdh3Qz1p9vl96zWKW3pfS3hU6ON7Z2LJLa3JSV0twyGJNURFBvV7pdVSE5ld/Ajw4bjMWa1m1BylqmyiRfT17NWtSKK9Fh+ysXMmLnno2cBWFUPK9EfqboRXrtMm/VztbloU2DTrQTCHqSN5sIyplrIkUbkxVM0nfA= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2019 23:42:00.4012 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8d99dcb-c340-4b64-2848-08d69143af28 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: SN1PR0701MB1934 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 efc23761de1c..69fb7c605c75 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -609,6 +609,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; @@ -616,6 +617,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) { @@ -632,23 +642,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,