From patchwork Tue May 23 23:48:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9744489 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 73B2E6037F for ; Tue, 23 May 2017 23:50:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 668F728818 for ; Tue, 23 May 2017 23:50:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AB9628854; Tue, 23 May 2017 23:50:09 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 C2B7428818 for ; Tue, 23 May 2017 23:50:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757828AbdEWXuH (ORCPT ); Tue, 23 May 2017 19:50:07 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:48616 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031801AbdEWXty (ORCPT ); Tue, 23 May 2017 19:49:54 -0400 X-IronPort-AV: E=Sophos;i="5.38,383,1491235200"; d="scan'208";a="21096499" Received: from mail-cys01nam02lp0050.outbound.protection.outlook.com (HELO NAM02-CY1-obe.outbound.protection.outlook.com) ([207.46.163.50]) by ob1.hgst.iphmx.com with ESMTP; 24 May 2017 07:49:12 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=2Hsk5AhFm6F1Soflgud/76LF74xckMQdRjIRbwAIGQ0=; b=V0SoLNPlseWKrRnGdVNBnKVDTf45sCWu4FUQ+rbsJOE13zzo0DSVHoSRPw7sxtwcysDv1B0JQSuyuIfyvuERu51hud/B/96e8t92almGjduYRU2rzkKzFpgitQtuFcte+uLZNl1pUgGPzm34rwsJPKkSFtE2KUD1d0RCNFrO36M= Received: from BN3PR04CA0032.namprd04.prod.outlook.com (10.166.70.170) by BN6PR04MB0500.namprd04.prod.outlook.com (10.173.201.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16; Tue, 23 May 2017 23:49:08 +0000 Received: from CO1NAM04FT045.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::200) by BN3PR04CA0032.outlook.office365.com (2a01:111:e400:7a4f::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14 via Frontend Transport; Tue, 23 May 2017 23:49:07 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; cavium.com; dkim=none (message not signed) header.d=none;cavium.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by CO1NAM04FT045.mail.protection.outlook.com (10.152.91.195) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1075.5 via Frontend Transport; Tue, 23 May 2017 23:49:06 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 9D.D1.45291.07AC4295; Tue, 23 May 2017 16:49:04 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.9.6) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Tue, 23 May 2017 16:48:59 -0700 X-AuditID: 0ac94369-166ac9800001b0eb-0e-5924ca70e083 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 76.03.18148.B6AC4295; Tue, 23 May 2017 16:48:59 -0700 (PDT) From: Bart Van Assche To: Nicholas Bellinger CC: , Bart Van Assche , Himanshu Madhani , Quinn Tran , Hannes Reinecke , Christoph Hellwig , Andy Grover , "David Disseldorp" Subject: [PATCH 33/33] tcm_qla2xxx: Simplify the code for handling aborted commands Date: Tue, 23 May 2017 16:48:54 -0700 Message-ID: <20170523234854.21452-34-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170523234854.21452-1-bart.vanassche@sandisk.com> References: <20170523234854.21452-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBLMWRmVeSWpSXmKPExsXCddJ5kW7BKZVIg96FZhb7Zz1jsvj6fzqL xYI3e9ksVq4+ymRxYU83o0Xb6jOMFj/bXzNatC59y+TA4THj9yIWj/vbjzB57L7ZwObxft9V No/1W66yeGw+Xe3xeZNcAHsUl01Kak5mWWqRvl0CV8a5HdOYCnZKVDxcdJepgfGiSBcjJ4eE gInElZVHmbsYuTiEBJYySSw+vQfK2cYoserNakaYquZDcxkhEhsZJX7M2wSWYBMwkvj2fiYL iC0ioCMx6+4LdpAiZoGNTBJfFq5iB0kICwRLbD/SAdbAIqAqMWnNLaAVHBy8Ag4SMxtTIBbI S5zdspMZxOYECq/csw2sREjAXuLyd2WQkRIC21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ZbijERDLeai4kQAI1DNF9sBAAA= MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39450400003)(39850400002)(39400400002)(39840400002)(39410400002)(39860400002)(2980300002)(438002)(199003)(189002)(9170700003)(110136004)(6916009)(356003)(77096006)(81166006)(2950100002)(50986999)(76176999)(8936002)(50226002)(36756003)(4326008)(1076002)(478600001)(8676002)(106466001)(38730400002)(189998001)(6666003)(305945005)(50466002)(2906002)(86362001)(47776003)(48376002)(54906002)(5003940100001)(5660300001)(33646002)(72206003)(53936002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR04MB0500; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT045; 1:EWBdcpWzMftPLLCPqAc4bI1rPnPJOZh1kA4ITRfpHjUfg9WfcV/ED6e7hm2LXdmz7p4qAgZ7HbyrLXyH6RTuOIq+NwWCv/qL/JHlfgp56T1NTl/cfK51pOKs3mViddktzRuXbgsjLCBgo5qKqvEFzij8AIJs5hghuOKjQclrx9kcjlcuZuNzEIgkl4tCIAgVrkdv7Gows6GvkSURDci/ZR2waqXoN9hbTYWdDk2qOlqMbZMV7HG/7DZU9xZZY3ECkgOX2Do0cIaBesbY8ypfwOikhvZ0dVuFQnlm0v0AjwuluLFHRY9JR3Z3an6W0Bz5KsIDJw4GxmfHp8o0fiOs6NkUkJLudqad3K42QG0LLnHDSRqo2wwRtGaI1oRde21y06A7lSLb4a+0Un4lIzTVrXtwF3nmIAU10YgHaH1fsPt6oYZBp8ymCjVaTiAh9EZtXGhEhiTc4I4Ia5efu3/rWCVQDso8Ux1tT8J03tkuaZ+4ER541sPcL5oWyi0eNwf0q2eyeLtYXELWkzGx2x/6EfMrtJf6crycLxQq8MDM+xk= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3e70e5d6-91e8-48e3-7711-08d4a2364d43 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:BN6PR04MB0500; X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0500; 3:OGLqzW/2H3mknfRksKg1iWgCXuDiH886pw4TPOSrhABsrd9OS67Szv00exOKH0ExFftuLWkGc4uGVc9VzHGxkVN0GZnFP9h8hog3m6+sSusOQe2K6ZvMnsA5J0xuCMhnxuSuN0GdrpgPZMISqEFKJ5O4VlwIw4ryN8ZunO/31v+eGh41V+wSliCBVGZnkVAp1b2WofbpDfMzUvS5XksIJ+z88i6wCuUGWDCbdAta2HKoRVzDo20JTM6daVvzYRPitub1XV+not1+3mNyWSf+5mpVAjkJnaah6wb82dw0vYpZH3SZ2QcS7pHO7n+oM1+x+dYjJNdzgFbxLA/L5jbDpOpU8KwdteogKLQrIN7HIw8eI2AYpaX7ld2GsX9aE0uwofru9Y3kCIHG88rckndbh4UVNHH3Gp9Xj6fk7Ln0BW+r7gZg3Ux4siazXpervFjljxSsemh9p/ZrpcEa7i3UzKtpgyZm8Rt3sRafCQsQhq1jMt2Tp4hwy4xrcBSLE4pn X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0500; 25:m4LN2HQ2UZE1IR4G5E3ZuQ7IZSB0UjkSxGKRTKpZWxQCxe9ksb3g+Q0v+f9ei/5aMuEV42v8A+kTNxlS7DWyUyY3/gOX+tfvOgWfPIm19DZ0M08Jot+yuMTZ1qtQzmfEd5TZ8bitakmJHEGOL6AEqcSIY2E08/PkhIjYLnoolHjl1f9s0ZH0LK7jyoljbEyocAKsoFXdXSJIhnSRAhEgceE5TSY9R3t8g1zfQsGgBknIpxOiIzJkNxgRq31jNeG8+BjRdAo1mFjkb3l027RJkXRstuc81XxU3qSku1doHXnhPzQSf+oylCU19rIRrqcpBxL4mVEsXHh90d1+pjVn6sE0gLsDqy28083O3ahxlRQI4JbafuY7XDPr1ZoTX+PbP7RTP1zfJIj8sxYRuICrMlg0c+mpYQaZS4Bk4VXcl7AheSdxZmHaaumfurUY4brTF9eVtedrtPEO6hIYK+8DVNxDA078Yga5q9Rnsst/6nM=; 31:+r75IZSEPf33/vnWS4Z5OutDGOQZjO8Ap19it+5k4zK90vUADlCuP8vS+kvAhW9aJN2tRDF7IrydwwU9CbdlqMOOZRfAi4X4j4ziNdkDRjQHfu0n9LLKdR65d3EkThUfrnl3TKPxjEJJsLG0MAoSn3HiSml5P7cyEnshvI9tLAzuJKGde84pF1UG+ojmGVoXZje0oaErnx7+gaeCZuxdTzQoKpo7OojxuHFSGI8hz/3PNpbwQ9dAD6xr4oO+2p8207PbPkFZDgmKNuj57Ql5sA== WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0500; 20:G8B6If69xMhqNsXyTL6NTtO5Oh26vmM8hWvupcNlSras60yMYrR+jwX5sXmwI2CploXAnQbhct9pH5TrzpgLxbM6wEuBX733clwJIpEmgXcGN1zXSxKubLJVgkhdTXG99Z8srxYB7yJK6FSrtdXkkovu1P6Y0V8QO4lLdM91eTiNKkw+4PyU0d/U7TzGW4cq4jO5yJ7TA7l/4hWZMuBNqxjMDnxoWIp9KlvzNi1WklfrmQpeJL4Vr3CDMxBH5EVTOmVUX9plQXc6m7hNQTPEamM7469jQDTrq6AyzP/S+/Hz4xkfk5132kBRE8twWjv4/QIw+Z1FViVZyf6xGi4bKemHZPTM05crQlMavuZAGQVycI6nZcjTOtYqhVDsDN7sqw6Aseut7sbguRj9E1OXFp7Ha8ZSl07dcBrfgCasFYjHmC+Kj0XM6kEhMIBIBcahlSQJgHPiIC9XS1MJDswLtYbuvKlFsaOBHbeKg4AlPdgZZmFkb702x4lfPid4EqD2 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700051)(100105000095)(100000701051)(100105300095)(100000702051)(100105100095)(6040450)(601004)(2401047)(13018025)(13016025)(5005006)(8121501046)(10201501046)(93006095)(93004095)(3002001)(100000703051)(100105400095)(6055026)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123560025)(20161123555025)(6072148)(100000704051)(100105200095)(100000705051)(100105500095); SRVR:BN6PR04MB0500; BCL:0; PCL:0; RULEID:(100000800051)(100110000095)(100000801051)(100110300095)(100000802051)(100110100095)(100000803051)(100110400095)(100000804051)(100110200095)(100000805043)(100110500095); SRVR:BN6PR04MB0500; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR04MB0500; 4:dyanltn0Ufc7c2s1aHLUlY3w496W/M+U+JLy/lCu8t?= =?us-ascii?Q?BKZaYCf9v6UHiBD5iCfZmMjj+gYSPdLnva6OBORbqgxDeRcCb0vCgcxAeA5A?= =?us-ascii?Q?h6ycy0Xj9YqCnV8Kqku4NC5iFKHpBGF4HHsP8S5wxzcv0PtoR2CzHbLT8NWL?= =?us-ascii?Q?YmwY2cN5dLacIRug0ZcSgMagpZtsSPVopRTQJcbmuuuhu4nbEYWUl25umeMd?= =?us-ascii?Q?x3Wtpe3SUNUMO+bmIh5UkrnYYkmCK4wKrdkRZX8VLwEYE8wJgp1o0PrlHvVk?= =?us-ascii?Q?8fojOVyOvXbEfQwKWGQV4ez2EG/vAKYcIsSTRWfkdPNsme4WyrQpfriGQpVI?= =?us-ascii?Q?I40wkuYjlGgwuUTZgJn2dIRXUQtSP1iW4uxoqSESPbRjhf2xYOo298mjj17G?= =?us-ascii?Q?y7eADMqpxqKHclKuY1UF4+0b4108597Q4yiilkNsAgQy8WVq2mEaJAFOY/J3?= =?us-ascii?Q?xkixpyBP9AbmrCyeTYnoNc4+aXCW10aOK6kvxAeGIF3vks+3G+OPciiqV+F6?= =?us-ascii?Q?gZ+ILZ6dym6S/4xui4YenZs2GJRKm0O0MhXcFDQ+xpDWp+2Y3RSRXOnKBJRI?= =?us-ascii?Q?x9ZyZZ7vlsPbsydV8WSRg+sh0mTuJdpCeFoP4bBO4VjCVfwBU4nJy+GKFgwf?= =?us-ascii?Q?tz+qvBCD3nKgN0JY5m4s7OP5U5VAtHeEmwk1mfzxpHIoKe58pUaN4d31oOgH?= =?us-ascii?Q?SNaiJFXdTBCJTwwg+b6S1A9vvGbMYM1x6jsdTLCfSm+/9MsBec6RYsHIhYqI?= =?us-ascii?Q?lXjsDdX7NrOFBt9XokvBIvynfKtXg481FK8kP4fQiojB7b/S+N2Fgj4AjU1P?= =?us-ascii?Q?8igcRDy+wkyIi+gMM1gbuyIjTrvYHls9pk7mDOHkBq9QO6WsMNFMHDUdiNIf?= =?us-ascii?Q?jbiXFG94a111BoBYEzhiDRsSOWxUENFu35cTrdGSjCXeB4cj5SbzcjPzkVK+?= =?us-ascii?Q?pNSYVFp3vJsbVNKAD4cZF01mZNlOXJl/ef8WCFPdrBFcucjHylPey8iXqvsT?= =?us-ascii?Q?wBqxMkDTiFCdrvk8l+81VcAKcmw2gFuy9l335W8cKtBAIbJQ489mG14I6F3N?= =?us-ascii?Q?SNGCnaoekdBmta9uRybIlVvEDmqt3TE/0HdIn5v91cxZtH8bHRN9rXAHDlYS?= =?us-ascii?Q?FfubXiaccMzarMRIkEvbB+7Jc8/lpjPgmiE5MJgk3RjkW+Wnow2BOYebOjpl?= =?us-ascii?Q?2FPiarISMBtdJDwk8tvmlXwVW1K3jvzT4Eij9IKuWyAQTiKzoEesQAiFXT+0?= =?us-ascii?Q?wTl4Wfky91Qxeuhc8=3D?= X-Forefront-PRVS: 0316567485 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR04MB0500; 23:A2lKJU/QxdmzrnH2U43c516bLF/UinQWXUvmQIDUB?= =?us-ascii?Q?Epr8C0xW5bHVwme11ElJKQtUkKXcgllesv7q+pT43V4PU7Ig9eYKqFRM6fVq?=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pfCALBiQ7K5m6kFe8lvGIDhvWeyn0TEk9c60flV9EDTky/aRMyVNUIwzLIPEMmN6kZibNNCSAao2nknb5spu3PoqmbvUVU8GV/aCA8cYR6eNSHKFDt/AekPiz1ptoXq0MOULs/8rPqgQ+dwDSzF8a1R/HdRVl/6R2ZafxFc/cpr1tiVjT4ygZBwhR2FCbo0KLbzDbuIgzNQMFe3WZ85tlMPS1EDGgDOoiZhobL10cczsnlWdczqBU1exvNZJkTO; 24:bhjnmsOp9OluTA4dHbRiESz7H9Mpn9EMmW/sCKQYT8pbVBaRBevzaJw+xiXjD7ohQqn31rNpqCKuM0nSQip1/GGQpyBe3dtwUy20YQBsG/c= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0500; 7:IieRVCrLSzHYoZnwHofreoeG2A+gPB21TJkZpeR+JGX65ub4so3p/yNumwYvxMMQNTO5Jr6vN6/Bi6rHoENYS3tnLixbATfKNVwD1Mx0eFmNOhroFE7HrXemf+A+w6C1qqAlpPPAxurz8DDgiTtLX2V6Qih2Q+Bt1t+LyDORRz4M84RKu7/XpB7Gr5/Zg0JD5IjGDYfWwC7cDmaruOSwJxkdZ9S7epyF5SYwxzJb4KCFn5VAQ5NrCndQozF9DIBavtSstI5G1dUQF9nQZzHrKwUcHGzgME4fuIskgGyfS01k9X1vCHTzyUP64M2jFq8ORrK+SUr2j5/FjWQ+0NDDSg==; 20:gXBxFeSv/0tPAgT7gpLUIXkfdr3723F+oeucPe8PUNbDDOhKXdv9tCzLbGGs/GgYcAgKHAmM+6VLc7L7+XGakwNA0vjcn1E5xDSoz/YFKVlbAJyBZdhlfDw6mtDfCrml+HBd72WDQhvG2wGsEoGSYgxRVpZnX/V3iPMTm7Fyol8= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2017 23:49:06.9436 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR04MB0500 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since the target core waits anyway until a target driver has finished processing a command, remove similar waiting code from the tcm_qla2xxx driver. With this change applied command abortion works as follows: * tcm_qla2xxx receives an ABTS and calls target_submit_tmr(). * The target core calls core_tmr_abort_task(). That function sets the CMD_T_ABORTED flag and next calls transport_wait_for_tasks(). * If CMD_T_ACTIVE is still set, __transport_wait_for_tasks() sets CMD_T_STOP and waits for t_transport_stop_comp. * When tcm_qla2xxx_handle_data_work() gets called, it either invokes transport_generic_request_failure() or target_execute_cmd(). * Both functions start with calling __transport_check_aborted_status() and return 1 if CMD_T_ABORTED was set. Otherwise the command that is being executed is completed and target_complete_cmd() completes t_transport_stop_comp. * Once transport_wait_for_tasks() returns the target core considers the TMF as finished. Signed-off-by: Bart Van Assche Cc: Himanshu Madhani Cc: Quinn Tran Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Andy Grover Cc: David Disseldorp --- drivers/scsi/qla2xxx/tcm_qla2xxx.c | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index 22fedbd55166..57a684231048 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -397,21 +397,14 @@ static int tcm_qla2xxx_write_pending(struct se_cmd *se_cmd) static int tcm_qla2xxx_write_pending_status(struct se_cmd *se_cmd) { unsigned long flags; - /* - * Check for WRITE_PENDING status to determine if we need to wait for - * CTIO aborts to be posted via hardware in tcm_qla2xxx_handle_data(). - */ + bool wp; + spin_lock_irqsave(&se_cmd->t_state_lock, flags); - if (se_cmd->t_state == TRANSPORT_WRITE_PENDING || - se_cmd->t_state == TRANSPORT_COMPLETE_QF_WP) { - spin_unlock_irqrestore(&se_cmd->t_state_lock, flags); - wait_for_completion_timeout(&se_cmd->t_transport_stop_comp, - 50); - return 0; - } + wp = se_cmd->t_state == TRANSPORT_WRITE_PENDING || + se_cmd->t_state == TRANSPORT_COMPLETE_QF_WP; spin_unlock_irqrestore(&se_cmd->t_state_lock, flags); - return 0; + return wp; } static void tcm_qla2xxx_set_default_node_attrs(struct se_node_acl *nacl) @@ -502,15 +495,6 @@ static void tcm_qla2xxx_handle_data_work(struct work_struct *work) cmd->vha->tgt_counters.qla_core_ret_ctio++; if (!cmd->write_data_transferred) { - /* - * Check if se_cmd has already been aborted via LUN_RESET, and - * waiting upon completion in tcm_qla2xxx_write_pending_status() - */ - if (cmd->se_cmd.transport_state & CMD_T_ABORTED) { - complete(&cmd->se_cmd.t_transport_stop_comp); - return; - } - switch (cmd->dif_err_code) { case DIF_ERR_GRD: cmd->se_cmd.pi_err =