From patchwork Tue Mar 26 07:38:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saurav Kashyap X-Patchwork-Id: 10870543 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 5D4F715AC for ; Tue, 26 Mar 2019 07:40:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A8132907D for ; Tue, 26 Mar 2019 07:40:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F59C290AC; Tue, 26 Mar 2019 07:40:21 +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 DE5132907D for ; Tue, 26 Mar 2019 07:40:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731226AbfCZHkU (ORCPT ); Tue, 26 Mar 2019 03:40:20 -0400 Received: from mail-eopbgr720072.outbound.protection.outlook.com ([40.107.72.72]:31328 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726042AbfCZHkU (ORCPT ); Tue, 26 Mar 2019 03:40:20 -0400 Received: from DM5PR07CA0030.namprd07.prod.outlook.com (2603:10b6:3:16::16) by SN2PR07MB2543.namprd07.prod.outlook.com (2603:10b6:804:7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.16; Tue, 26 Mar 2019 07:40:18 +0000 Received: from DM3NAM05FT029.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::207) by DM5PR07CA0030.outlook.office365.com (2603:10b6:3:16::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.18 via Frontend Transport; Tue, 26 Mar 2019 07:40:17 +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 DM3NAM05FT029.mail.protection.outlook.com (10.152.98.140) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1750.4 via Frontend Transport; Tue, 26 Mar 2019 07:40:17 +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, 26 Mar 2019 00:40:06 -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 x2Q7e5ic027005; Tue, 26 Mar 2019 00:40:05 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x2Q7e5hQ027004; Tue, 26 Mar 2019 00:40:05 -0700 From: Saurav Kashyap To: CC: , Subject: [PATCH v2 22/26] qedf: Check for tm_flags instead of cmd_type during cleanup. Date: Tue, 26 Mar 2019 00:38:54 -0700 Message-ID: <20190326073858.26792-23-skashyap@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190326073858.26792-1-skashyap@marvell.com> References: <20190326073858.26792-1-skashyap@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131980596177933065;(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)(376002)(39860400002)(396003)(136003)(346002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(87636003)(97736004)(6862004)(48376002)(4326008)(2906002)(68736007)(53936002)(51416003)(105606002)(76176011)(476003)(5660300002)(2616005)(126002)(336012)(14444005)(486006)(26005)(4744005)(36756003)(42186006)(81166006)(8676002)(36906005)(106466001)(16586007)(54906003)(356004)(2351001)(6666004)(316002)(85426001)(446003)(86362001)(69596002)(80596001)(50466002)(305945005)(8936002)(81156014)(47776003)(50226002)(1076003)(26826003)(498600001)(11346002);DIR:OUT;SFP:1101;SCL:1;SRVR:SN2PR07MB2543;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7a9bf897-7e17-418e-c4fe-08d6b1be4ae4 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600127)(711020)(4605104)(2017052603328);SRVR:SN2PR07MB2543; X-MS-TrafficTypeDiagnostic: SN2PR07MB2543: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 09888BC01D X-Microsoft-Antispam-Message-Info: MqYrbb+ZztTfRaojYHbcAnN2AUtNC22s4Wtjd67MerLGPM9ItrvpfP53mg30hAEd1cKgVrs7T9KmxLqu7wDr0HW5Gu+umAUziiihBtZ5k+qkRWULEclYb1JCpEleii2HL8C1Hn0x1IW3HhnxslVUut96JGiKXSE0XuILb4yrouK9aaw3Dv9TXNQwn7/pLq1e6ypoXm/wnbw69DG+7ornkhcPHdTjBLyDMgmQXLUKkuQCbRZ84RUdVCMxCInTWWs4ViaUu9lxTFM4MFtFcorqqMuuS7AUMRZxnF1Tw8+Xi92Ko1TeykjTSBxvFdTPbCSyaN5pkvRj21MQGoPUHiHhbYdWqQdMAYva4sw4DFISGbl0dNHvVXV3WgNKuoTXLx/Yo7o8Xyo9lxfZYGxL+mEk0USpmweCVrPX1DOO/wAOia0= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2019 07:40:17.4490 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7a9bf897-7e17-418e-c4fe-08d6b1be4ae4 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: SN2PR07MB2543 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 cmd_type is over written to QEDF_CLEANUP during cleanup, so check for tm_flags. Signed-off-by: Saurav Kashyap --- drivers/scsi/qedf/qedf_io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c index 4a792ea..ca7ca8c 100644 --- a/drivers/scsi/qedf/qedf_io.c +++ b/drivers/scsi/qedf/qedf_io.c @@ -2174,7 +2174,8 @@ int qedf_initiate_cleanup(struct qedf_ioreq *io_req, /* If it TASK MGMT handle it, reference will be decreased * in qedf_execute_tmf */ - if (io_req->cmd_type == QEDF_TASK_MGMT_CMD) { + if (io_req->tm_flags == FCP_TMF_LUN_RESET || + io_req->tm_flags == FCP_TMF_TGT_RESET) { clear_bit(QEDF_CMD_OUTSTANDING, &io_req->flags); io_req->sc_cmd = NULL; complete(&io_req->tm_done);