From patchwork Wed Mar 21 06:09:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10298633 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 53547600F6 for ; Wed, 21 Mar 2018 06:10:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 414F129716 for ; Wed, 21 Mar 2018 06:10:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 35EAA2971E; Wed, 21 Mar 2018 06:10:27 +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 9C95A29716 for ; Wed, 21 Mar 2018 06:10:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751737AbeCUGKZ (ORCPT ); Wed, 21 Mar 2018 02:10:25 -0400 Received: from mail-cys01nam02on0083.outbound.protection.outlook.com ([104.47.37.83]:44680 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751589AbeCUGKC (ORCPT ); Wed, 21 Mar 2018 02:10:02 -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=WAUSYrdMMavOieMpQtTooSHX8pgLoUY6MPtB9vyPQ2iFaT08BquB1J8AE9CynTDQEvM7X/fmO1UBPM3yZfJftKJL2nBKibD4dyUF56A4O9sdPzeSBpfHsFvVZ4+dtwRG/clf5o5ePkuFRA4W0+oeglhyvprt8IsYzR45Qroea/o= Received: from SN1PR0701CA0025.namprd07.prod.outlook.com (2a01:111:e400:5173::35) by BLUPR0701MB2084.namprd07.prod.outlook.com (2a01:111:e400:52f4::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.609.10; Wed, 21 Mar 2018 06:10:00 +0000 Received: from BL2FFO11FD022.protection.gbl (2a01:111:f400:7c09::173) by SN1PR0701CA0025.outlook.office365.com (2a01:111:e400:5173::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.609.10 via Frontend Transport; Wed, 21 Mar 2018 06:09:59 +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 BL2FFO11FD022.mail.protection.outlook.com (10.173.161.101) 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; Wed, 21 Mar 2018 06:09:59 +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; Tue, 20 Mar 2018 23:09:44 -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 w2L69hbS029543; Tue, 20 Mar 2018 23:09:43 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w2L69haV029542; Tue, 20 Mar 2018 23:09:43 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v4 10/13] qla2xxx: Fix FC-NVMe IO abort during driver reset Date: Tue, 20 Mar 2018 23:09:38 -0700 Message-ID: <20180321060941.29468-11-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180321060941.29468-1-himanshu.madhani@cavium.com> References: <20180321060941.29468-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)(396003)(376002)(39380400002)(39860400002)(346002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(106466001)(186003)(69596002)(80596001)(81156014)(8676002)(81166006)(6666003)(2950100002)(76176011)(5660300001)(26005)(6346003)(50466002)(48376002)(72206003)(51416003)(356003)(105606002)(4326008)(316002)(42186006)(16586007)(478600001)(1076002)(36756003)(59450400001)(47776003)(50226002)(2906002)(86362001)(336012)(87636003)(8936002)(305945005)(110136005)(54906003)(575784001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB2084; 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; BL2FFO11FD022; 1:y5GPylA5LfeCovvzGqb7IRKJYP/UiH555IufjU1gPBU/2FEl0RYAjUmi9pin6ATWrd7EyiNL1J7/sSJWsDMCyFpxk5qhU6APtenmSZRJvHCqRsM/zgH7OlyP0QKZoxQm X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3ebb4236-71c2-41c1-cbb4-08d58ef26090 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:BLUPR0701MB2084; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2084; 3:ApkZD4qscsSzmFpqf7cmicYfes7dysq0YDw9QC02dUqkb3Ogx0HufyEkTzeV+sLINaY5iMTfpkIbfPx29WLullLHV83LIz06L39FX6JMVoV23OMojLHkXiFOLq2cKvbt9XiW0t7T3lRMtrXtnFUeCpUmwAA4cjEhMRHCSypheZvkQbOyWoEK5XI3v4jt0x5haDddgB4xo6yed/c/FAK1H8+swJNwzUdKis4jf/1Fm6rxD5BQmVTwNcmHZzdIrtyvSuWyDnYHi0N+iTWeJKqhlyFDpPVcr4JWV202+kmOTfdrXFGwSVAJ9w35zmQT0rBCfgP2YlQ8jgrp8il47zPprgQ17CSFtNT1yNFtF9o6btc=; 25:X70zqvfp9EBGGoyvHCBMEq0vePrhAiR5wSu465ReZIxdHS4U7P9JVj/6gjvPbuQcd6FVFI5vUafQ9kWxbcLqBWhj0/INrxc+XUo2f1FuZp4n4S8zAUy41c5iAYjQYQNMdkQMnhm8yDr/e4Py/XoFIA97r5KL8GQ9ix/pmY3AgY16qEXS3Mt1wp2zZjD2t6Y0YJYsz1YQX1CRi8ghD1RdaR6+WtVNgBQ/FyXzurTakc6T0rgpC5LafZN0GkWHplAGsIUzuXk8tqU8VRBj6vUK3nHy5srCk+H7J6MZGRmkbqLpAjbFvyn0oxAd98PLMTzI2lF8vY52s8wSd8aSnS1tcg== X-MS-TrafficTypeDiagnostic: BLUPR0701MB2084: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2084; 31:biJ0+Y2MQ5eU9kwPJsFtq7GM1ubZgqksEwSYpCnw4YZB+5+ARw9VSba7JD3nhvax/BpOe1ILSV95MSHZo+NlTMzrPbgGpFE9Jm/E6zijlNDQOPo3f+FuYRFBtMzk2JdtZ+/NbzCeqJDJJMVkvLmHM4LL/VlQF31HL8eHP/MtKuaf7TTbZMEryPFKI3hC+Utj/xox7259jS7JbiZ4mYBC/oVNNBOYvLWLAkvN5CSoask=; 20:OdJxJXrQMX242/sMhHKnWJd7f3uZi3VrF0dusB02CJjdjgK/Yt2Qfe8Kf6lep4Kds032Dgh4Au3tsB32Ha44x9Ca0R5GvdzcXTAJ8LbtEo99FVyPrZmbXq8FQHXica+krRov/tMQorrOflfStuUFLpG0nrHZMPYgFkt9nlEc9kxjMDC67RxJalp4On3gES0KysjCK6LkXdYVpOgUYT+GtF8UHU5a/llHdebPisTzNwcO393Jr2ECqtYZo2sEVEk7lbT9TCSrvofMMMp7mj28ELfdrsUD1UPcMF6flgHTPMNR5lQZZYqd+dBlgqpMiSJMMk/74YkLLYS6QpgIe3PbOlU+wDA2p4CGnK/SXMyo00wdhGs1GUGpSW0UdQK0hiKAxiH6Z/Q5yIQksNZh/gBeDzjANnXKIFK1/lXh9NdSINERFPT3NdZkMMGk7Th80LZcRfBxNI5npkXAwyzHq/zw2cZo4z6dwV6KTWhR8tQAewty124/r20UnNVanrnUnloL 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)(944501319)(52105095)(10201501046)(3002001)(6041310)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:BLUPR0701MB2084; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB2084; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2084; 4:uhy9wzsqzIAY+2FQVu/2zqCWC1pgpHdYfeQObEqKG6QK255q6MZI+I1O4LqxrtJ/A64i6iVFkFrVeZhNi/ONaOK/f8u9p0H5uCeUKAb9DfoyVq7g/o2rx8T70vNRyIaQiLXGysOC2OWkGAICM6+DH0Hg/Iatl5GL83uDvEFCx4MwCllIfkr6G3wIJW612gDGMLxOo5nUoc6dVr7CkTaGzAbYZY9/eWpRzD0IzlFIei9F+sIU+fd0yhDHgftdtSGuIByma4dIcPM0MZL5B90Xnw== X-Forefront-PRVS: 0618E4E7E1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB2084; 23:JgM9XY/j13ZICcHAWbOZRlZzUbZ4neizETMSIyx?= =?us-ascii?Q?8v4jDtMD+NwnPdH29T47vPZ3O40aQxAHt4BEyDxw7H7JbW0ZcB5U5OTCVNab?= =?us-ascii?Q?E2kneDOiaZzQ5GKpvhUT9Uv6QVdKLwODF+4S7wfZC6kx8r9MvjD23AIl49xe?= =?us-ascii?Q?35JP15HTsSPrBw6CLv2Nk8Nx+ghc2rvur6zSVWhelywGfZ/R6mD52yiXPR1P?= =?us-ascii?Q?vw9R+OLT6Y4AsSwmzwtGlpycIDK1MwCXeTxmW637tTw/nuzbvUK9TVRXiMZ2?= =?us-ascii?Q?JWMHq008K6P0oDKi1aEs+rGahJu0RTCJ4YhKeSKBtUGqYTO3tLXhquvNPyr3?= =?us-ascii?Q?3BnyENWtXeshcz3EleXO6ffxPn/xlj/euFHfv1JxB7u7AG3qxIPAwLHudpWy?= =?us-ascii?Q?n6UKM4gmAb6o4iESFrjSvOm42/8C8Ay+WikLK71ykGyHkij7FjI68X0+jPB1?= =?us-ascii?Q?7MH7Rp0T3GVcvSzGLg7RUHRr3iTkdSSKs6QH/M0JhRpSJeKiPj279bV3Yyls?= =?us-ascii?Q?XHsEbHzJvzNO46/F0rGps06URJi3adsOVrALuhPxmXCjhWYsnrvSZorAKa2F?= =?us-ascii?Q?0ReBBM9MOPSu5YqX+NHa0c38w3xQaLd6I9MEq0+iGJJ0xNzoRD6xSv3cSx3h?= =?us-ascii?Q?6HQWsUaT8aiKm4H0dkoqxlUY9zXCj9Li0kS3EQF+fXzjk1KTC3KuNaLBWBxy?= =?us-ascii?Q?CAHpLJpo/7blu3NESYCdfG6jtYZATQqVhipu74NDn05IaqJbp9MB1HO32+6N?= =?us-ascii?Q?jBvOmAx54rofurRnTx/8xQEoo27UGp03oqOBSsvt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GcY/WEEQnCqVVOP9J1vFGAVMaTT/5TmwDUd3dfru+5q7Fw1BD6u2HfaCsIlYsHfEG5Hl1mTZEr7Le3yi2ZN++Ee7xaAbfQ==; 5:CCzBYw3QtmJu+YBsLbaY1Yh8wrS7iRazF1MrXLo53JvKcii4ck48+0KFrYQQXDaB3RK7zibyOaKjUG6AVkflUE1+27+3qGiQY0+qdP+5h1Td11Y/FLYvVfuDXPep8MccnXyAU6nwZoSvLaSziSIsWgNRyQiPgtI7ccJzFjwX8yw=; 24:l1IW1bc8JPuCze18W0JyO/ZA/rIrHrmN9JIWrDIV0HYqZnpfiW5+FoTUO1TQijV9sU4ODmcKXoAZ6bdq7DVv87GZK5tw4/eCSnTJ9RgTb5I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2084; 7:0TDR3XDjgCsCQiAZYr1z8cPyW2sFdwdCTfgol7e91sGuV2+t5fJqUq9isWAqtxlVq4g/JjCZpoDyDAptAeYwwJEvF/EUW9uqpYJrXqZh/LJA71ZzIRc/3LsHqY7De33z8P+cbmiwmYUOKjujUxo4hy2+1zDMzxikAChNrKj5MGtTAKGD+TcnMh2bQ6noZ2rNbhVoar05WJXlYQOq26kZHacgwjKYx9hhSvCEx7Sn830JhQGalSKpH/EbwqvVFx7t X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2018 06:09:59.2693 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ebb4236-71c2-41c1-cbb4-08d58ef26090 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: BLUPR0701MB2084 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) &&