From patchwork Thu Mar 15 03:35:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10283883 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 D74D6602BD for ; Thu, 15 Mar 2018 03:35:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C810F287AD for ; Thu, 15 Mar 2018 03:35:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC7BF287FD; Thu, 15 Mar 2018 03:35:34 +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 480BF28806 for ; Thu, 15 Mar 2018 03:35:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752020AbeCODfc (ORCPT ); Wed, 14 Mar 2018 23:35:32 -0400 Received: from mail-sn1nam02on0046.outbound.protection.outlook.com ([104.47.36.46]:36041 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751959AbeCODfU (ORCPT ); Wed, 14 Mar 2018 23:35:20 -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=KJv4YvEwMkpCXHE7gA9z6FLDtGSpUa5JZosy3kG1aNw=; b=D5MXaN08/mCxXiZ2ZMJfippGlRKc40U8G1SuXpkynLbzQCZwDPQEmljMhEo4XNS5CETd9X8oChfO6xiz59pXDz9LGOkChqkDHqS6MyyC0qOu5RScTEQ25sYV7CRWydIJ7WA4lmD+3D1tamZQCs8s9heARzgpsZf0wrXMnMr7ACI= Received: from DM5PR07CA0051.namprd07.prod.outlook.com (2603:10b6:4:ad::16) by BN7PR07MB4212.namprd07.prod.outlook.com (2603:10b6:406:b2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.567.14; Thu, 15 Mar 2018 03:35:19 +0000 Received: from BY2FFO11FD011.protection.gbl (2a01:111:f400:7c0c::179) by DM5PR07CA0051.outlook.office365.com (2603:10b6:4:ad::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.588.14 via Frontend Transport; Thu, 15 Mar 2018 03:35:18 +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 BY2FFO11FD011.mail.protection.outlook.com (10.1.14.129) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.506.19 via Frontend Transport; Thu, 15 Mar 2018 03:35:18 +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; Wed, 14 Mar 2018 20:35:07 -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 w2F3Z7rg012703; Wed, 14 Mar 2018 20:35:07 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w2F3Z79a012702; Wed, 14 Mar 2018 20:35:07 -0700 From: Himanshu Madhani To: , , , , CC: , Subject: [PATCH v2 10/13] qla2xxx: Fix FC-NVMe IO abort during driver reset Date: Wed, 14 Mar 2018 20:35:01 -0700 Message-ID: <20180315033504.12628-11-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180315033504.12628-1-himanshu.madhani@cavium.com> References: <20180315033504.12628-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)(979002)(376002)(39860400002)(39380400002)(346002)(396003)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(4326008)(59450400001)(54906003)(356003)(305945005)(85426001)(87636003)(47776003)(105606002)(478600001)(69596002)(316002)(336012)(42186006)(76176011)(26005)(16586007)(1076002)(2906002)(72206003)(80596001)(186003)(81166006)(8936002)(86362001)(50226002)(50466002)(6666003)(110136005)(2201001)(48376002)(51416003)(36756003)(106466001)(2950100002)(5660300001)(8676002)(81156014)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR07MB4212; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Fail; PTR:50-232-66-26-static.hfc.comcastbusiness.net; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD011; 1:pYLeVYdquqPxjgqKMo9ShfaUaVUSsOxsVE5+nK5GumyHAHgcvtHOOcYgAYLS6NO9OMY9N/forYCriB6C56VP4oX9/uj2taNzp6lcCmTgWIjTxKSmfPN+gMWnoauqFqr8 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 95e56511-dca2-4942-4805-08d58a25c638 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:BN7PR07MB4212; X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4212; 3:PhH+PGzgE1IcxY3hlV1IKUqV1M+qmyUdKZDc46PSS1kSHI9h3lT4GEZyGNT5IXYD5Cd+5e5osr7kb9WTu4UberugjROm9lcLo/X279eWInOuBMUyzz/E8yYYpwALJ/J8CHWBJZlVw6B4gOp+93+kiAraGGX2uIt2R8W8qvW1b5O86zWHIlnHteXfLtHxRuokBVEQV6qg2zx3QPZgeab160aBUjcFJTi3UQPky8zh7lk01XZ0XnY1PU0Fo2ncy9OQzU02XDwvF/n3g6Vd74Mm7ibZMwl3tFkARlN0ZTnZm3cMj5MucFfh7Y/B87w3kvbyA6ftgIfMq//bZPoTJqpNA2kpg9lzMhgiKN6vUljVb7Y=; 25:Z3Aswg8CiBxaxM32GvRXI/4Y5y931f+ZAelesxs4Zfc+ul/oNPyNzJXE7xGbPw1jwnpRFjNlH5twlazQ6+Z1RtWLUr7DQAf3TA/USeC777mjfbLarV4iPcQNRWOHjolRZUdFcKtHYlskKRuCeh7IFISaAwAslsLOABH8zzADVpD7ozMY2E0J7Rs1Fe8/aefIUxavyEdnY/NnhNxDS8X97tpvyaULCnutboTGfKUZigbs7Hzz+imnUcmj99oHnO3JH3VriPN8SBMqWU9P+M+VczpAZ8vi6vg5at4sP0GWfo9kGgsgZNdsf/CKcyz+yzD8Cx73YjDXQw69yvNbV1Osbg== X-MS-TrafficTypeDiagnostic: BN7PR07MB4212: X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4212; 31:nRM8uIh5rK9M7kFpgkWAO7jAhj1gZLKcuiRmkrGyJ4kb697mBfKRf9Cazrnj8z3cGkj2wLvRQNvax1P27axbI1vuwU6bCqKltqH1iaRVFLArDU+C0S0aAFo9FcscuADFV8um32BI4QQeA1fWqlgr01KBJFg3V5zi9i2thwU95JLii5QXfJNiHIoyv0hicTuV6FgbuGxnpEAeVORBpZuEkfwjVN7+Kvn4G1bIdfTna5Q=; 20:mZmGTmebFRAqx5eD8nRLQMavtt1xF/f0L5P2SWh9fZ72TUrDD/dND8NjRkah0Fx50tg6cCmxbZmVDooMZa2nhIJt3nBUuE3lTHTdvyxLhmKM+XYtHD6tMhiab4ki8qdvKIgisnK+KzmNeuP/cdEJCpGpgPWimMVE5c1oXW60U1HR5fRNzZxxFUnKX7RAwjfvqYKfW4rUKl6DKlu9UV0vYFyXG+Xs2pbjEEpeL1N6QJs42sXNCqMwkM6wuDbCzFCIdiPdtFROKBkHpgQBWethslMUY/6aCydzmkvlpkxZRMI+Wzs+WqKwdLwjcSZl5vdQMoDwDO81uq1OhGminILCY7gQ/KAbF4qCfvPa1NT8Y2H1imqKuRGUsIGa7x/tN7uuR0bDLhyrSa+M99juN2KM8Fxs6LJdbFGDPw8gYetktnAkESypWWJS7vJG6n1KIujNnhRKhPoze7pLf1GZB9bm3hBT3xIkrW0Txj5mPho+g7YTfcGMMW1IgHZ0Fe4M/cBE 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)(10201501046)(3002001)(93006095)(93001095)(3231221)(944501244)(52105095)(6041310)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011); SRVR:BN7PR07MB4212; BCL:0; PCL:0; RULEID:; SRVR:BN7PR07MB4212; X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4212; 4:BzK4afCATSa/uf1hTshSQT+G/43TijY6v/i53k7EvoD6YupyzV2Vb1bpsqY7gKCh9dUWhelUdi/hnvdvqdA+3u15B8cmm8M1edsgV++NnfL+K0Zx1Ac/F3yE0aZL6ZOO0H05uFWih89fZ24MiVMCzjlrY8DaTvs5weTLhpAVFgJ8mMstUmP87g/QY1uhfwu5XKkYjW1xv4FfWN139WfOJMMrzb3LFR8/NMPD+w02IDdZ2utDEwCG0ZvR5lGrBipogL/vBSglpykFGFBkdleICQ== X-Forefront-PRVS: 0612E553B4 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN7PR07MB4212; 23:oz6yLnYpoLjTq47qQFEM2vrKTg/8qFOGBprh3JwMM?= =?us-ascii?Q?xLaQ/RcltuMDq6r3LUnEk+PFtJI+L4mNwaDTXjsPFzMoZ9uwTiTKz24Lfmm9?= =?us-ascii?Q?BDB6iy2UeV0fYiQMahP86FExbrL84iYFSL3ZoThtvm0dUPUcWgCYjh5Cy8X0?= =?us-ascii?Q?RbdrPqJ25EOrJmQrsTgGBmZU1NYq5lnkFfBOe9NIJ19sUptgfS/cYV4RzLfQ?= =?us-ascii?Q?XEhjtlkAIu81bzUqrzHYI173/UDfj52dke4nj7TY7MuauKazjgKLGuY2Yy7l?= =?us-ascii?Q?F9wJcAyMuqAtaFQt+ymksWMR/mmnAyWUEJpQwaQx/nQtlfwkQZXYh3IWG4mm?= =?us-ascii?Q?RLo2dT2TVc1j0d4EhDZnMhx/a3mVFGYb8TpvWydKlwkxs8ElHFHhCTnMfeS7?= =?us-ascii?Q?Dpk58xAwUk7G9p+0U87SFbNXV0DQdWpA+E9Lx0ZgahgtZrGQtV+5BIt01gIt?= =?us-ascii?Q?mBVe+cCZxzIAl4P1lCWVRxciO3K3iCwp9Zj/AKbJA15TB8oXhRzZBZtR8l9L?= =?us-ascii?Q?f+BNKEYtncEiXFwlaubwZ5n7AdDIq2KoC10RpiSzvdE83ZBr5KKN96BtVCCs?= =?us-ascii?Q?2CUOubptwLMcR4gLBgYl9K4Qf6SYmUW4O0nmzsZyOyBitjDcf5TZF6ciD9hL?= =?us-ascii?Q?+/2pGmMIZPUAYS1W111X5nESiZLFUA40a3q/gb5UHJYb2DifxT50uXre/a1P?= =?us-ascii?Q?uHnTK2KY2yhENoT6YFcPLYJInlgAo9S8hSr/9iMkU228DVOz/UWQ503wKTHu?= =?us-ascii?Q?g2vXpYci5H1iNSBFwsXvJYIXovpwMqrdYM1JkJDKnJutSrKNOfegIAqSRTf9?= =?us-ascii?Q?S80YJdEL4Fih6Xp/Mz2/mDG4KROFUIAnAQdIPKqwqfBkp6fQ1BaLtRk6xRg6?= =?us-ascii?Q?m8a9YRJT3Mnmmrr0PausxYKeYHcp6qjJL7TX4erSppIp/7LJbRDWVhf9l9RA?= =?us-ascii?Q?jYQpFjBdXEIyTeIxiOliulrD2d7kdwrvD5eZJJr8PCmshtArEAMzuo+m90Hh?= =?us-ascii?Q?osEkC82I7yWorJ2CT40zFJ4jqQFfQYZCmT9i4mk1Zp5BjIJm/mPC5jUqiOiu?= =?us-ascii?Q?8Hmfst4UP3FkpBX+mUmp39h4o/rLsIrG2nh9QuvGg7ihY3v87PSWxn+NmiVI?= =?us-ascii?Q?84J3BsgMOurk0TTRVq/P344a0Soy3JFMYvteHjEN3Wm1v+xz1cFp707JimQ7?= =?us-ascii?Q?yxkU86xeCoekjTPvfYAe9oH8Fhpcb9fsAalSceD2F06/yPjUQbqLqhnTFiIY?= =?us-ascii?Q?VqjrKUcwdBWE3/xxBc=3D?= X-Microsoft-Antispam-Message-Info: PNoV2fzSsoG3RCI8FxqVomZpRHEoKpjKMhW6VnKzw+6K0S8+Kvs90LqCtwl+sogdbLtEra/jWEo3vFqisSagvZgHWHDZ3diqm4w1+VI9zWSpzSsdqzbJ9dCu52fyK1NTrtA168ZFSPdSnZzcludCNP35VqlyGfCCvN8J+e64ZlqihN8GXQ/hMxqiLEtI4DOd X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4212; 6:bkM+5hdguTHrnePnqWtpJ5P+fvMDxMbpC78xdh9ZKJl+rl+M0just8p101xtvaou4SM1UFtaU2Svlfq0sUlL891cdMAohwBo2UQDdboJ5rztp4erTgbRl9u6/oo1FfWTMj8d3dNeylM3hadNTmMqkUy14LU+1uvl96d6dOKL09sh4afBqCUicYnne3mq17CTrSYfDq+8zjXgjmxUdZDPSsVW2cNNSTEYlMCW+KFc5kYVNd8Cfk/15r190CIBlARbOXYT2HCL86Kj6HQvQIBx97HOhPhCrz9t1rfANqk3sbAOmZYkSCghA45Cn7JB5YZ5xIgVnfHIRYkEstKbBwgrYzAcTch3XQfl0C8Mz6fP1FQ=; 5:HGr0YcNRIdXktsoYgy08atDHgXF+PhoPSQRqSiQgRSSQ+ln/6xui/nbYm2MFdbyHlpwKBrO3ZarewfOzQBKnCdhxO3Vjo2iYjQraJlLjg09VudPjC7GbNfjsLSfiV3ZWBBZJ9hNHX1d6EPzUB1HNQDBLVvSFWdC3yTd/YYR79eE=; 24:atl/j+tmxWBuAWC97xoNP+pthSIRdWPPq33UGdLulgroBqAzVToDFmxLEYAQN8RB0gCuSOthc62qkPXkMtFiZWbXmUUCdHvje0DNHtXdAQM=; 7:0MhcfkMTKhb/4wi2yWKjUU7l070+OgbWRNRwgG2T+m/Mw2QBR42NtNgdoF+oEZfsF8Rd0AyVD4K9Gi6dw3N6R6RDibjBTOntsKyB9Wjxsm1iS+FfThI9fBVQC94pLix+p6youBmHUoTv1Z6dxZ4m9ooaz4/53TPG35+JzxNDtZ3Vyu4sGoXrUBDs2Dhmm5hAD8wBaKJkHIOk/5Zq7aw4JDIu1OWY0fhR7Y1ZdTBVzPoLUOkd0IqBJGiXlhqHOM9T SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2018 03:35:18.4609 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 95e56511-dca2-4942-4805-08d58a25c638 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: BN7PR07MB4212 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 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) &&