From patchwork Tue Mar 20 05:58:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10296439 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BBDB960386 for ; Tue, 20 Mar 2018 05:59:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABF5B28AA5 for ; Tue, 20 Mar 2018 05:59:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A05FD29516; Tue, 20 Mar 2018 05:59:11 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 1B63228AA5 for ; Tue, 20 Mar 2018 05:59:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751751AbeCTF7J (ORCPT ); Tue, 20 Mar 2018 01:59:09 -0400 Received: from mail-sn1nam02on0050.outbound.protection.outlook.com ([104.47.36.50]:61712 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751689AbeCTF7B (ORCPT ); Tue, 20 Mar 2018 01:59:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=DEkLkdM3WSo2Y1MnJOCim9V4Bzp1POroJj+V6Ui4Y3o=; b=chmPv0HdOiQO0PHvxxbn5UOiMHg1tUyRO62CPuOGNdQzEkBaizguVqLi+5MQwLRTmDcjpqQg+bBFRb4BbXYSwN7k0fUfKdwrjbQk70Yru8aUZ8awIJuTE9pQv5aagRq44kdeiREGaXHd36COtedwQUjlGRiIYWpR+WrB5SONoxk= Received: from SN1PR0701CA0034.namprd07.prod.outlook.com (2a01:111:e400:5173::44) by BN7PR07MB4209.namprd07.prod.outlook.com (2603:10b6:406:b2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.609.10; Tue, 20 Mar 2018 05:58:58 +0000 Received: from BL2FFO11FD025.protection.gbl (2a01:111:f400:7c09::125) by SN1PR0701CA0034.outlook.office365.com (2a01:111:e400:5173::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.588.14 via Frontend Transport; Tue, 20 Mar 2018 05:58:58 +0000 Received-SPF: Fail (protection.outlook.com: domain of cavium.com does not designate 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BL2FFO11FD025.mail.protection.outlook.com (10.173.161.104) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.527.18 via Frontend Transport; Tue, 20 Mar 2018 05:58:57 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Mon, 19 Mar 2018 22:58:40 -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 w2K5weoH005321; Mon, 19 Mar 2018 22:58:40 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w2K5weD0005320; Mon, 19 Mar 2018 22:58:40 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 10/13] qla2xxx: Fix FC-NVMe IO abort during driver reset Date: Mon, 19 Mar 2018 22:58:34 -0700 Message-ID: <20180320055837.5246-11-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180320055837.5246-1-himanshu.madhani@cavium.com> References: <20180320055837.5246-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(396003)(346002)(376002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(110136005)(54906003)(106466001)(59450400001)(16586007)(356003)(5660300001)(8676002)(81156014)(81166006)(8936002)(6346003)(26005)(4326008)(186003)(36756003)(76176011)(47776003)(1076002)(575784001)(86362001)(51416003)(87636003)(478600001)(6666003)(105606002)(2950100002)(316002)(48376002)(305945005)(72206003)(50226002)(42186006)(336012)(50466002)(80596001)(69596002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR07MB4209; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Fail; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD025; 1:DKUuv2ncBQFzoFsBPrYXdXYZr8LemvaJvTbZcxnYlicKxf1RMQS0RgRezCgZKc/ljGT/LA8zW8wiI/QrxHPrkuon9jfk8Sj8vvcZ6KJKEAzhd8VDIxIZ0D7hP+0PKsef X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b7895eb7-cde3-4da8-b52a-08d58e27abd1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:B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J8=; 20:Tbvhk0o2aZRwBsu0ER66uMtbLUdFeyjcft68B6V0yfvmBSSxRi7SRjr1EF8K7vccRoRPb7Km/AKC6sJ0CqOcA/WGsc7I4nXFGyyJ8/gBzpeWXldNYQ1XuRctBXhuQQOWD4XYHCVsHepfNXYyt9uGfBwSS/L18GvM+F85TprF9YUDR5yLeDHf/sKYzZByiG21CVxdSaNkoiMgb3hvp/epHwRs/hhPhFKu3akaKBIHtUlebgOm4baWm60dsl0mRnm2nXigrCn3qep0LWqt/qlfEtNlyj7D24lufNYjM8dDsvl36dck9AOqDEAnTphIp7ChpWuMP97rw/RjwcP0qE/a1LIw27e2Ns+OlQYWYUxVvzzg1vib+VLTK/9Xc4x8ZKm+AhJC52c8VWSPCzzvamJVzecKuBEry+3dRZSki4ssR75+d/qNlCEv/iLk9v5sA1EcdC0FdqbLHvluE1MZu5We6TZALSnWL/7kTO7bu0FXnGnrTL//SzEsbCOOTg0ywYTP X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501307)(52105095)(10201501046)(3002001)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:BN7PR07MB4209; BCL:0; PCL:0; RULEID:; SRVR:BN7PR07MB4209; X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4209; 4:8TSSgYYleaYe2QzXjRzC/JiRGk/9jDYvRK25k4tXy09GPF0D35/u+YaEsR+m5ubvHoAwKRW2Ildr7ZckfnkoMR8velfo7h5ZeC7P+Un87NN8iO0KANsNBp/d3pri3fIvciad06Hi6L3/tKuczrfDY9ecIh6nJvUPTP8+RJpA6+at6IFNfTEE7G6bltmK2IGXhK8NthTs+DNzRulg5pv/ReOemOV4kSb0LhUCDap+L4Gj3rf1GRNro+GmbofQT7Hf4tNwIjN8fqphdmfPWIQZrQ== X-Forefront-PRVS: 061725F016 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN7PR07MB4209; 23:uHWsGulf1d2BJoFixX75F0CIP4IA2UAoMHF0eZcQF?= =?us-ascii?Q?HSn2+fZASskE99iOfzvQ6h549x22s35vxuyArs7KPqmBLrkNZHbJzM93ViYb?= =?us-ascii?Q?hWSPWv+RCxFeOU9BSvyzwEfGfnhX79FV5dqZNvYtFcAdAdEdFfx3vY8ggdqQ?= =?us-ascii?Q?Ug7fbiaPvixREI2af2UN5fn5RMrBiKJICKiVvOQZdULVj250rOgoj8NNi5Xr?= =?us-ascii?Q?1eiFYBgnsk4rAcTWMDNs2Q6lzC2Jhr6T1ZCuCYpSRA2u5Pz7uKg5AzROCfWZ?= =?us-ascii?Q?GkMKyjVQosrjUs1NSFxNLeXCjAUKYs+vr4lDaziKXBkuzoKD8bDvWp/jo3ym?= =?us-ascii?Q?898e1Q/UxhhTutPuNvZQ5d8uT9d2LNODV1wEnW1dfVU+EnrXY+bV3XESODVX?= =?us-ascii?Q?ujo2DCHrHbiX2tsbDW264JjLSmMEUXrxKZqHkF4eMxSOB6z6xiKwkZmD/LcN?= =?us-ascii?Q?Mv+0k7X7PIZUHTy6+V+wUjH52gEEOTsei/UGifBlxPXKPNuFG/GZU9UiH0ao?= =?us-ascii?Q?ktorGMo7suyimffVqNn+Kr73bIjaQXx83UrZOOAomUOp899+1yBFSfla7edu?= =?us-ascii?Q?qXTrU7rsS9710CgmAR2FfFONqWola4SEwvdona/KtUNCYUplPVAKWojaovpG?= =?us-ascii?Q?MXa5WxR8zkpXiZg/yTGLX+IHRtGGpMv6nNvHCDuqCBLNWKVTHepZfniZLlpk?= =?us-ascii?Q?2SIERT5Qdav7EsGMmoSH/YAgi3vup/Xx8BkMmmZykapXP0NME160PfzZQRgl?= =?us-ascii?Q?cOYYao+D7bUu7ZljHhgJ5yQw1pA/wpFa0I3zp28vK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X1XDE7djX38VaDncgfBooYoTaBU4xEnmTjX5T6zjgSD9MO9j+vdzJZQA7LEKLXKg4tQlhq0UR5c8Y/c8w==; 5:MwEsJnpYXy9dCi8cd7LbavrPm3tFEwohsMADsYDVYIusJAUTBgbC5tFO4/YFqSz3Fqc78a5drFmNkudSc18FZuYgQD7BxJgmVFy/df3tiIEe6nHim/4pEUXCF2JKhzLYdeOIyC2Kx0K1e/A/0t8K4IohizbaMreUgbI3g/5Amns=; 24:6vi5YNN2uYx4kmAIRNJcYQC8GHAaP0a6/3jjbGdg+rtUMVSfCyFI0Ei7tulgTV//cB0vnA3SgynjzEdPKvkCNNnztdpFdpyGi38Ekul/FXU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4209; 7:yoN6OIrhqgEeCPfkdpgFk3I7X1WShywRCf74E9XovY3aqstieEyAQ3Tqf1uOUTU4vDxj7vTbgQnPB7MBE3wYfbWV0yo6A8rvEYp2uIt+e7EbPpHHgmYRUGeXDCuLHtjNrnLYFOhTHG8uK7Wt5FYQUGDg8lYWLjTlSQHUly/ZTAZKjaFH4mCC3SGtNxOf6R0ySv9rs5ZCyIXJnIARlGM79ZUGgmUB0utniEk2f72Sr0685L0fRcHyICwKImCHzVwy X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2018 05:58:57.6565 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b7895eb7-cde3-4da8-b52a-08d58e27abd1 X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR07MB4209 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: Darren Trapp Signed-off-by: Darren Trapp Signed-off-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn --- drivers/scsi/qla2xxx/qla_nvme.c | 17 ++++++++++++----- drivers/scsi/qla2xxx/qla_nvme.h | 2 +- drivers/scsi/qla2xxx/qla_os.c | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index 8c05df30c083..57275bc9fe14 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -489,6 +489,9 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport, vha = fcport->vha; + if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags)) + return rval; + /* * If we know the dev is going away while the transport is still sending * IO's return busy back to stall the IO Q. This happens when the @@ -597,14 +600,18 @@ static int qla_nvme_wait_on_command(srb_t *sp) return ret; } -void qla_nvme_abort(struct qla_hw_data *ha, struct srb *sp) +void qla_nvme_abort(struct qla_hw_data *ha, struct srb *sp, int res) { int rval; - rval = ha->isp_ops->abort_command(sp); - if (!rval && !qla_nvme_wait_on_command(sp)) - ql_log(ql_log_warn, NULL, 0x2112, - "nvme_wait_on_comand timed out waiting on sp=%p\n", sp); + if (!test_bit(ABORT_ISP_ACTIVE, &sp->vha->dpc_flags)) { + rval = ha->isp_ops->abort_command(sp); + if (!rval && !qla_nvme_wait_on_command(sp)) + ql_log(ql_log_warn, NULL, 0x2112, + "timed out waiting on sp=%p\n", sp); + } else { + sp->done(sp, res); + } } static void qla_nvme_unregister_remote_port(struct work_struct *work) diff --git a/drivers/scsi/qla2xxx/qla_nvme.h b/drivers/scsi/qla2xxx/qla_nvme.h index 8df379478269..816854ada654 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.h +++ b/drivers/scsi/qla2xxx/qla_nvme.h @@ -145,7 +145,7 @@ struct pt_ls4_rx_unsol { void qla_nvme_register_hba(struct scsi_qla_host *); int qla_nvme_register_remote(struct scsi_qla_host *, struct fc_port *); void qla_nvme_delete(struct scsi_qla_host *); -void qla_nvme_abort(struct qla_hw_data *, struct srb *sp); +void qla_nvme_abort(struct qla_hw_data *, struct srb *sp, int res); void qla24xx_nvme_ls4_iocb(struct scsi_qla_host *, struct pt_ls4_request *, struct req_que *); void qla24xx_async_gffid_sp_done(void *, int); diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index bd37a243c0bd..54f93f9cba48 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -1734,7 +1734,7 @@ __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res) sp_get(sp); spin_unlock_irqrestore(qp->qp_lock_ptr, flags); - qla_nvme_abort(ha, sp); + qla_nvme_abort(ha, sp, res); spin_lock_irqsave(qp->qp_lock_ptr, flags); } else if (GET_CMD_SP(sp) &&