From patchwork Mon Mar 12 18:16:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10276947 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 3A56B60211 for ; Mon, 12 Mar 2018 18:17:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2410C28E0A for ; Mon, 12 Mar 2018 18:17:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 168A728E72; Mon, 12 Mar 2018 18:17:17 +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 8E30928E0A for ; Mon, 12 Mar 2018 18:17:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932792AbeCLSRQ (ORCPT ); Mon, 12 Mar 2018 14:17:16 -0400 Received: from mail-co1nam03on0080.outbound.protection.outlook.com ([104.47.40.80]:19913 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932764AbeCLSRL (ORCPT ); Mon, 12 Mar 2018 14:17:11 -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=ToDLWCZJr2UqRegTlXgV3xTGGaJveYa25bwPFgRkKw0=; b=c4UMph7VWJcHgsNABBjyUjSUGQt+9eNHiGUsIfgpfVDlscL9N8FwSjDBxejep8QwkrvMMakjQ1HZimsQ662S1RYUjDJ026a90RMIgwXkPJ7UnvlKmVYo72V06GtJ8tGj/j6dsRAH/NUJPsKGeh/6Ii7uMpW+a1mZ7OcH+oGfmCw= Received: from DM5PR07CA0035.namprd07.prod.outlook.com (2603:10b6:3:16::21) by SN1PR0701MB2093.namprd07.prod.outlook.com (2a01:111:e400:5309::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Mon, 12 Mar 2018 18:17:09 +0000 Received: from BL2FFO11OLC007.protection.gbl (2a01:111:f400:7c09::158) by DM5PR07CA0035.outlook.office365.com (2603:10b6:3:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.567.14 via Frontend Transport; Mon, 12 Mar 2018 18:17:09 +0000 Authentication-Results: spf=fail (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; HansenPartnership.com; dkim=none (message not signed) header.d=none;HansenPartnership.com; dmarc=none action=none header.from=cavium.com; 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 BL2FFO11OLC007.mail.protection.outlook.com (10.173.160.142) 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; Mon, 12 Mar 2018 18:17:09 +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, 12 Mar 2018 11:16:53 -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 w2CIGrq6020779; Mon, 12 Mar 2018 11:16:53 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w2CIGr1O020778; Mon, 12 Mar 2018 11:16:53 -0700 From: Himanshu Madhani To: , , , , CC: , Subject: [PATCH 10/13] qla2xxx: Fix FC-NVMe IO abort during driver reset Date: Mon, 12 Mar 2018 11:16:47 -0700 Message-ID: <20180312181650.20704-11-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180312181650.20704-1-himanshu.madhani@cavium.com> References: <20180312181650.20704-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)(376002)(39380400002)(346002)(396003)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(86362001)(80596001)(69596002)(16586007)(81156014)(81166006)(5660300001)(42186006)(87636003)(50466002)(59450400001)(478600001)(110136005)(6666003)(336012)(85426001)(106466001)(50226002)(2201001)(2950100002)(72206003)(8936002)(48376002)(105606002)(54906003)(47776003)(186003)(51416003)(1076002)(76176011)(36756003)(26005)(316002)(305945005)(2906002)(4326008)(8676002)(356003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0701MB2093; 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; BL2FFO11OLC007; 1:v73Wis0hYl3zVo5SBKXGBOhgtKiNgWNN3JJCdp/Hb//OkrBzZRRYyue1i1k4Rf7AF2uPdazDRczBgDL3QcWCZcbl7s+LFLRd/fAPYtY75+th5abgD78zLGJrnR8uOu9f X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 45571540-4973-4ea2-613e-08d58845783f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:SN1PR0701MB2093; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB2093; 3:eXzA226MypEjHkRUa/CslnCjbZMcsUOmPtewLQ+ZIPI38B7JGkS7dUmNWmC9yltVlaqLna6wfygLLFq+xAhO7/BR8zHFH0UlkVpAb3m0xFOBOQEw16lprEYcOeHtxPkllF87vZ1HrRgSv7dEeo9eciaUYOrJeM5c5FupOY2CedMwiwZZNxBi7WAso+IzjKJ02onla6Yk042CBVu3s0AU1uy9QtRZPUXY8oVDLDKWXBtvfnJ29NUj0Vvr8jQILFWAgOKSeVc7Ncl26Ddw5NtlG/ZBc9yU86Fy3Yr4/1Gfmc4mgKXiaX6FizvLJgY6MeFTax0x8L2+ZmO6+CzV0DXULXFHfF6Xh18+2ZfrI+LE1fM=; 25:d9yZOlje8K77Wua/7JAr3r5X7XTC2+TKUUhxsSpQEqB2HYCJOXUUu9QaQU8aNfrXKKXbHDzEuClxHi9bXAvCQrJR5RUTb4CwkhsRx5AFoklVva7JqkA6igAAjCAk6IYEoEKvN98hdK46kOq02G/QPY7o0EmWA5sK4GsAwg/Gm7y2Lsx8eT4ecd5rd/KBdPqWJzgdlqx55ld7rdKban5sJ4eU30mQFlDMz2a5F4fYJwWM0XSM4gp4P2ipKRf+73fu/O158h7aSE1GgvAp12K1QdhYI6lL4O6M+5f4WCnYZZoRe88ceOxqQl5einxhsmNJn77RGuIjrj3Aii9bc0WdKw== X-MS-TrafficTypeDiagnostic: SN1PR0701MB2093: X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB2093; 31:rGlyZdgRgyVouwZdQfEpUFYV6IwN7LiLa+c5+f9wX5W72IzJsGFKHGr1pPi+nF/10Wp7PxwdBxFDnqYkrG+J1qc/RJqDG7KuoT443O+Gnz2QTv9D3gOgrdfaERWqcxoM+Uagom8Ez5doDqEckdpiWFZWxFLbxFSXnWj8K2OM11Hhnxcm1X52LAw/o6n+cG4amZKraYFszPl2z15ly+y6ceg/JVHV9B3v59SDvMxpYs0=; 20:3zw+gD2G7Wne2rsg7X173J2qME69dFnqVn7UTGTsLs+6ASfApfkXxJxTCGMA4qYcXWMUHYWRMrCAjQOSkscJ3Ni0I7uGPEn/PCXMMhO+Tkh5x/9p+XRWCav8jFrVj3eEt0zCkIMxNZf93ix2dwyk2T4XcTNYLAcOVAD7BKjkfBYMl3P+jk7kwxk41F70dTcdGELRvewqzh5auVDz4TQMah1hGDZDxU/sHB4ypK9MhyTwTcSMlAWNZxvvb1LXSCQ0Ud3Fp+WgxlGQ1ZdXW2wCZ72TkC5lYk791mQyqG5ivFoZCfPmBSHyuzG0wu1/bV5dyCPMJvEpn7a/N3Ep02FI709fxniT+Zo0/bJDOyiw6ihJ4Pj19CqJBY6pUZn+hyRaT3LqxKEnOWuWT82ADG0CVw8Ba42yyaP5VmZGBXxnMOeW8qR5U7JhH3C0R4aYbqAP6nTAgypl6d6N/W3mmZdzIp1HjJrVYxMaLvy4ky4tN4NYEkCKu5YIxlkmSCchNwaa X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231220)(944501244)(52105095)(3002001)(10201501046)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:SN1PR0701MB2093; BCL:0; PCL:0; RULEID:; SRVR:SN1PR0701MB2093; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB2093; 4:SdHxpj20d1pmufbGodGxE6WKMcB/4E8UEdE4QHYCMZQ6i4nAcXpsR3zbjECWYQr8a54xGOrAlsXjfTmxMHPh2NY83fldrRkgCgIx4Kz2EQJMVbe0wlhx138fWuP8obdwu73/xKjwjVfuVtbGO8QikQS/tHONUwG+UzEmgbSBrA0SRczmu6LvSPFYOVXi5fBwNLd3gpuWmu2yNvp4S2jFNBdSRvYs9ggy+L0dsmIUiHWuSJrYwFjZdfQwyQbWqjn5stEADTK2pye5T9AOzXsWMA== X-Forefront-PRVS: 06098A2863 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0701MB2093; 23:M/s+U5korH4XxhJ/IYGEokONYs1IQe+dpBRWoMA?= =?us-ascii?Q?wlDpxU5V8NKzruVCyunb90yB36FbikqxqhXO3Le7RTKhjit8b+mWJHnHpcsH?= =?us-ascii?Q?9mj0hEQXu5vC81ZtX6EP31pAQOHc0sCjenKSFi9w/w7qnUc9pci8tXj+Rl/t?= =?us-ascii?Q?PtGYFlL6eXTex0lGlDGCZ1KzSPv7Dm2yJrEBeRUgculNSBywN7dfqz8Bkz7u?= =?us-ascii?Q?N3yNuHY/cK77BQBOOwdYbzkXfYkxasR5/g/8UBq0CCQnYqjcOxPNGzvamw6s?= =?us-ascii?Q?G8IkmYsEPobqhbRFhi2DIHbBrIWu4k8aVxFSktywDw8Yysi8iOd6kOC0RZ65?= =?us-ascii?Q?y9aweTTWEvBFb8LZBdT0zH0u968fBvTmn4iR6XtOiWywdLC6GTYxcBEV4CNA?= =?us-ascii?Q?DAThCWQ93fxGBNWVGwQoSfbx4kubRZEDPu9/0aQdOSaCImdtRK6G+0BZc1Lu?= =?us-ascii?Q?qsX+xsS1xc2oJB17oG9aBrJ2IND8bB9l62h7WfXojgcOO+wyb0h89ioLGu3h?= =?us-ascii?Q?55fjmHXP+hUYu65uai6V5mFBAYiSjYSpNMtLwv6to9v1BGJtO1sSfN3+kI7J?= =?us-ascii?Q?B8J6e2M7+RiHDUKSSrPVqIkBfvT+RohdOTabEgwuKW7V9tJHycGp2E5JYRxe?= =?us-ascii?Q?s4gzBjiBdUTj8LB4wpHRCtxJyGfzdc0UXEZ0RNCuodtydqDzthA5Bsfw71es?= =?us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y3fEalysp0cRNhVFo3O4wggJp7FZYJ8PCnmcoIxMaan71x/GZzsWgY2TgwkFCabkirbzexlXn8xx42rjYT9sboJM9y3ukK5fYLSsnKDA=; 5:gru4qoZottTI679q44+8dYa/RjuD32XkMxb11kOieeMBLxEu5GXLRbyVAkEKnreHJkms4eoDFPlhsCVo+xOQ+LThCFYLaNtcVGqslq5ojM7geoxL0ae37Zo5Z3Js3qQClVtSkr6F9HZvT3dfsojlJpbsMUdwNcAaU93SCIdar5k=; 24:zrLtitiAvcpokqvjhS80tDTBqMH5s6LH95LF410DJy7xe57i0zDgP4sqhCVsKzWWu/RK8ylO01PMVwq8elDwUEWzLkM57jNJAeZgHP4iGlA=; 7:byrLekcXNIvEL3btONCpV+SFZ3jEP0Cl1VbmtIVwBsuMssPNG7tMG/tO+Y0Zh6K3w3sH4UevqcNloyRr0WhVrhTxiGvEtQxPdpkaVdtpUAUjQpKGTg23ONMqDVfWrbMmpIYe4hwS3OdtYqJqYbBs08Dc52GpWPpjdWVk/UrheA8UeDOS8OpH/9fuVfFZEUlbHFb2BdiM3tSlXGstiat9nfUgXEalzX4++RfLBFS8TYyCeW2XJPYQDXWzdEgB+5la SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2018 18:17:09.0745 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 45571540-4973-4ea2-613e-08d58845783f 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: SN1PR0701MB2093 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 --- 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 69b46c8b9dd2..7fe265aca617 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -1743,7 +1743,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) &&