From patchwork Tue Jan 5 14:24:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 7955351 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 673E1BEEE5 for ; Tue, 5 Jan 2016 14:25:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 668882014A for ; Tue, 5 Jan 2016 14:25:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B2D9201C7 for ; Tue, 5 Jan 2016 14:25:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751663AbcAEOY7 (ORCPT ); Tue, 5 Jan 2016 09:24:59 -0500 Received: from mail-bn1bon0064.outbound.protection.outlook.com ([157.56.111.64]:45216 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751601AbcAEOY6 (ORCPT ); Tue, 5 Jan 2016 09:24:58 -0500 Received: from BN1PR0201MB0819.namprd02.prod.outlook.com (10.160.170.151) by BN1PR0201MB0547.namprd02.prod.outlook.com (10.160.169.140) with Microsoft SMTP Server (TLS) id 15.1.361.13; Tue, 5 Jan 2016 14:24:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=CNFPlJK4pUPnN7wG6pwYsBso4xQ8Latu4XI2o13c8wU=; b=WIWxkgHJmGxV9KRSCHVODOK06StxqEUFJpFqfAH7Fn7v07OZaLxZg/+yXZmAs49fNp8bXbt0829h9LQl4qv7MziI00jcByN1SAgphklZXBLxrp+LB2Uu3xBJX800fFc842ZZXvlgaAsDvkpd10j2/gHKp4GnXAK1WO+FQAchsT8= Received: from BY1PR0201CA0010.namprd02.prod.outlook.com (10.160.191.148) by BN1PR0201MB0819.namprd02.prod.outlook.com (10.160.170.151) with Microsoft SMTP Server (TLS) id 15.1.361.13; Tue, 5 Jan 2016 14:24:53 +0000 Received: from BN1BFFO11FD032.protection.gbl (2a01:111:f400:7c10::1:137) by BY1PR0201CA0010.outlook.office365.com (2a01:111:e400:4814::20) with Microsoft SMTP Server (TLS) id 15.1.361.13 via Frontend Transport; Tue, 5 Jan 2016 14:24:52 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.173) smtp.mailfrom=sandisk.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.173 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.173; helo=milsmgep12.sandisk.com; Received: from milsmgep12.sandisk.com (63.163.107.173) by BN1BFFO11FD032.mail.protection.outlook.com (10.58.144.95) with Microsoft SMTP Server id 15.1.355.15 via Frontend Transport; Tue, 5 Jan 2016 14:24:51 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com ( [172.22.12.162]) by milsmgep12.sandisk.com (Symantec Messaging Gateway) with SMTP id 21.1E.02821.332DB865; Tue, 5 Jan 2016 06:24:51 -0800 (PST) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.248.2; Tue, 5 Jan 2016 06:24:51 -0800 X-AuditID: ac160a69-f797e6d000000b05-f7-568bd233419b Received: from [10.50.231.71] ( [10.177.8.100]) by milsmgip12.sandisk.com (Symantec Messaging Gateway) with SMTP id 8A.EE.20697.132DB865; Tue, 5 Jan 2016 06:24:50 -0800 (PST) Subject: [PATCH 09/15] IB/srpt: Fix srpt_close_session() To: Doug Ledford References: <568BD0FC.70207@sandisk.com> CC: Christoph Hellwig , "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: <568BD231.10205@sandisk.com> Date: Tue, 5 Jan 2016 15:24:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <568BD0FC.70207@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrDLMWRmVeSWpSXmKPExsWyRoxnka7xpe4wg9ZFnBYvz39gtVi5+iiT xbNDvSwOzB67bzawebzfd5XN4/MmuQDmKC6blNSczLLUIn27BK6Mr6uOMBVcEqn4e1OtgXGj YBcjJ4eEgInEsZPz2SBsMYkL99aD2UICJxglrm5g72LkArK3M0p82NfPDNNwaMoZRojEZkaJ hhd/WEESwgIWEkcXLwcrEhFQk9j0ahFQNwdQkYbEu61ZIGFmgXiJdZ/eMILYbAJGEt/ez2QB sXmBSiYv2wJmswioSOw9O48dxBYViJD4sWEJI0SNoMTJmU/AajgFNCX+t+4CG88MZK/fpQ8x Xl5i+9s5zCCnSQgsYpX4+WAeE8Qz6hInl8xnmsAoMgvJqFkI7bOQtC9gZF7FKJabmVOcm55a YGikV5yYl5JZnK2XnJ+7iREcB1yZOxhXTDI/xCjAwajEw8vxsitMiDWxrLgy9xCjBAezkgjv 6yPdYUK8KYmVValF+fFFpTmpxYcYpTlYlMR5rVvUwoQE0hNLUrNTUwtSi2CyTBycUg2M6WuO qTa8fHlI72Ah6/X9q0/k9wrMZAzcpsF7wCZGtvAl2/6KeWUbWbUlty17JX/7gXlxxaqgZ91+ Z0N3nOIXvX2h6Enu2r/aIgeq5K1K1zXuPzYv9TZfhPrb/g2G36bPOM52STWpjvWNm3bZoYh7 Hm8i/XTEbtfvn77EYUUx15Jj/dyKrwUeKLEUZyQaajEXFScCANzUJwF/AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMJMWRmVeSWpSXmKPExsXCtZEjRdfoUneYwdG1JhYvz39gtVi5+iiT xbNDvSwOzB67bzawebzfd5XN4/MmuQDmKC6blNSczLLUIn27BK6Mr6uOMBVcEqn4e1OtgXGj YBcjJ4eEgInEoSlnGCFsMYkL99azdTFycQgJbGSU+NexjhkkISxgIXF08XIwW0RATWLTq0Xs XYwcQEUaEu+2ZoGYzALxEnc7mUAq2ASMJL69n8kCYvMCVUxetgXMZhFQkdh7dh47iC0qECHx Y8MSRogaQYmTM5+A1XAKaEr8b90FVsMsoC7xZ94lZghbXmL72znMExj5ZyFpmYWkbBaSsgWM zKsYxXIzc4pz0zMLDI30ihPzUjKLs/WS83M3MYKDkTNqB+P1ieaHGJk4OKUaGIvuBCvW8Dio 3V3q8HO/nZ7lB7l2yYbb2w+WrjhlfIq9M+LOl+PSPnLpvUG3/vy6ea8x/MDpUK4IBZb1dlmH FFkXJ9a9ey3E9on/yH6FxODQqUEbds3SMGA4snfLbdUjN94lys8TeKrjELn9ocOn8xHacXwe 7s59HDv8y/hvPYg8faK1Wc9zrRJLcUaioRZzUXEiANnIa1P2AQAA X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD032; 1:QQkqV3Rg94kkD7//RpmSFqlFQmQLoXEXD2mHvxgs9/QSilQFHGnJ2UB9adL0UB+7fC8o+G1jzUEeTWiRF8hbLgrv2jB6su67UsEjoQ/d1BjBnyV1vqlhkIosKcNAPoCsYhP4nYcEwyBmMLQs20f+yGP6kO2zGojPSHjovyt3eSWzaj9G+w3+gGWAe+6dqcDP4TkaGAOw1oXQBPUy+bFt/KkwMptCGgxKbSQPs6b3DS19HbaPyhAeH+gpfchGDSO1ICSPAKqcgMhaj96w33fyBKVSfeIX/l3JtS72T8gUnevBb+TA1CGjgDxPJVspCQD19ukf0B8fJ0ztht5CHqrreA== X-Forefront-Antispam-Report: CIP:63.163.107.173; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(50466002)(81156007)(50986999)(230700001)(23676002)(586003)(64126003)(36756003)(1220700001)(106466001)(83506001)(4001350100001)(1096002)(92566002)(86362001)(19580405001)(33656002)(69596002)(54356999)(65816999)(97736004)(19580395003)(65956001)(47776003)(229853001)(5001960100002)(2950100001)(87936001)(189998001)(65806001)(4326007)(110136002)(5008740100001)(77096005)(76176999); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0201MB0819; H:milsmgep12.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0819; 2:aGDoqesPydnq0M30nFWlyPWJBpsaf/NhvXbWwyhq1DiAkdbE7DABrd8/3S7tbTriSoTPb+Xusuutuz81+Qs9cHJ+fUibKxeiSubuTlSCAqkH9i+j66JzXEV4BCA/T4V2It4kuIeY1RaCH7BYsg3Hfw==; 3:l91AbJ3Zrh1h7QNk2Hnzbl7G9o+gS8xDBwVE1+YaUaldrWKDkVj5BjnLsVeO6FhSIDHMLMgh6DgDuoUXRK0hFXFbDB15Q7VYJoUsaAz3Q/dSR4rwBea30Ui36tv0TKyAvy8nKjh2uUJjzDaFTjxgESb3uCpKXuyBPjfg3ZUEE1610GLoUrua5isY2+XBLMA/TwF75hrAXlYkQ6u8kAOQK/5f7ht60SXbj7voK5xa7UZL4BjDHMwCXKieYIIfXisnzfxKcPbxbpX3XUenEmBsXA==; 25:knlYLKjUfQOgqsqRwUF8jDAcAJfB48K6DW4jFo4aqizLZkqrej0h9hMADdRIAO0dIHE5bBkLcvntvkLKhbyHpOYtEvOD09+6r4EbzODiGBirl+vaQ+UBReZcezJNoox2SQAJ/Z3kVVJfV8eOTmVm64G0rscDukZFKLvzHyBuSSqdCU0NsLsUzQdOT+K8yN6uIhMrm5/qbycsQphzhXUWY9Ymg3xStYFYdYXA3sHURgH7T6nG7KniAzOYRzsSatlez0mIS6kOdNqltGUuUK78gA== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501001); SRVR:BN1PR0201MB0819; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0819; 20:Z0TL/+eRk+azizMxsF97zPcMlPe6cmYerBKGMzKTrm26Tw8dAHDSJ6//kiV5L4AKYyl/EVPaii/ceZNxPEpFuGD7aXzCwbVbATLOrzqD7WXef5YmQlrGegrW8pjzDxnDwd20a2QcN2IaXp2hBxA2IOOhWaoIhfqVYgDpQULn7Va4ob35uwzONGsRQJ+/GPiHJCwtE7Xjs05dpPU013DApX6Lh2iy9Z6aVCxdUvZF1GGVoD/JhhNEPIIDPbM4cvAcda99ck3zd99oUfYYHLmM08Uz7wSBiUS0i7qX5PpFPotCYCYFupeyB2n22PYulpFRIGfhDZxPU9nGxTp96plgLm7qcWMxyVRhzEZusoijZzQ5+SgyWNiL6jBbgC8B5y+jVroM0lWv4zgCOW0YTZRVKpumjU3AfeAkagvWJu+xiS8bjf6m5DHwULgqRdkkv+X4q0zlQO18NAKKpv5BPspN/VEB949XSWWA1XhIcABs+KWIbYQbCk2UGDO1UwjFSCJg; 4:SrmRcG84enIUO7FQEmaPd88/csUbLfOg1Exzjq7UAqjotHodoFNsCldrhoU6KIA9mv2YoZEOZBMzn2YhdSdLVtoSVn1WMxSGgsv0vhF02HG0kovuoZItiEDENj/jBfNRqmVSNUMSzef1bPaNThv7765PIzg5B52IiCbaMz+EKYwjtrdsl8C15FGRxFLtzeId0A5GctMhf+UhHIwYtQdSXXFKuNsh8WZLZcjL4bPD9EKxljxp3KIDZD+whLxqZi2c61IQA+gI3z68HXc4aOVymaWTdIeZYDFkBVFCBoj0Z0YVDfLsTFEpChbUobziy9I5s4GzVOZ+96dGIh3g5KmIJzzHRIX3WZEsqHS60D5GD6zUejXu2Srnetl26KqIDMvafSV51eSYlMlawY3zBia0i4FagfpleEZfPyIr mbaC5ot5jPUtAnQ4pC71qazx4rSh X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(8121501046)(5005006)(10201501046)(3002001); SRVR:BN1PR0201MB0819; BCL:0; PCL:0; RULEID:; SRVR:BN1PR0201MB0819; X-Forefront-PRVS: 0812095267 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjFQUjAyMDFNQjA4MTk7MjM6ZlA0MUk2SVJORVoxSzBLaVUybjVLVDBP?= =?utf-8?B?a0w4bWxlK0M5NWZIZXU1eThpQlBicjdMOTNsRktFb1J1SW9YSG1oYThQNGJw?= =?utf-8?B?eG8yWGNQQk9abTZjK2ZvcndiRTZsTzFubTF0elhUTUtGdDlNa2d2SzMyaU5H?= =?utf-8?B?WEtJVGEwK1h3UzZVU3JRV3BMNlJweGpNeVRGOTR0QnpmTC83RjNSQzF5YXJ1?= =?utf-8?B?SzhzSHVlVUpUN3JBL2l2ajN2b0Z5NVNPZTdjc1RkM3RIa3hHVGFuMzhPMXJG?= =?utf-8?B?L2xQb2tDNzR4Z2JRdkJTbVJZdGFSV240LzUwK09WcWl1NnlHWWpMREp0TUc0?= =?utf-8?B?OGpNZHBzSDQ5Uy80S1hJVkxyTUVzS0s3YjdRL2FoQ1dhcHBtb0tYMWVoTnU2?= =?utf-8?B?OHZlRWlETjF1dy9RbTRQdElJbHpnOEtnWERKM1FxYW56ZWVuelVjWXFUaGhW?= =?utf-8?B?dVJPZDQwaktQa09acTJ6VUlUVW94ODFVOWp5OUlvK1R6TTcwZjVrek8weHRL?= =?utf-8?B?T0tjN0sxRStWUVpTYlNMOFJGRFpMZ29FNFp2L29tckdDMFQwSkZ3OTNMMi9C?= =?utf-8?B?SjIwRVNLTmhBUXZINlNMTGxPMHJPZzdpb0JEQWt0d2hlWmtnSU8rcm1sWU1O?= =?utf-8?B?V0psbWpQb2d2Z1VQODRhL3ZWYzJlaWxyUDBSTHZVVTNlbDRhNnMvT2ZvcFJ3?= =?utf-8?B?YzNJQzJuN1ZQUlhWVU0rR3JlRW5iS3RzUTdDZ1MwSGwrdEFyRGtOenRlYzlo?= =?utf-8?B?SDVZNkhWTHZacjJVTGE2RURibEZDcEZ5RXE0aDZlN2kyNVhrODl3SE1uY1hW?= =?utf-8?B?QlMrUU44a0t4RWVxbTB4eUNKWENtRm5RMjlIVlVnVWtGYUhDQ0NWZlpySFRz?= =?utf-8?B?TjIyMmpvd2tzK2dEWnlSZ0F2ZTlSenF4NytoY2g2TDd2aC9vZTUrQUVvK28y?= =?utf-8?B?L1RmcUtKeDNFMUI5eDg1TmpTQ3c1bWhxSitBZ09sZWNjeEVaT1RMekNKdHgr?= =?utf-8?B?d1p5U0YwV3VJQmQrcE9nQitUM1RiYVZ5SlZ1QmtrZlU3Uko2SEFuZ1lGeWs4?= =?utf-8?B?T1Bld09kMWVJMjdLdmt3ZjI2WlhHeWdPckRRSlpOVXlqcTBEZTRmSS9TdUU4?= =?utf-8?B?S09LRzZ1ZERUMi81K0t3SjZkMDVZc0NOOEcyMEl6a0dEL1ExUUxock9waUJy?= =?utf-8?B?RGZuM29sUEdHVUNhTDN0cnQrQlN2UXZiRUdhckdzempNUnA1dVhEVjZDT1h4?= =?utf-8?B?cHBuNFR3MmorUmtsNS95dzl6SFZjdkxjOG9WelhtbjA1bFhrcnpJWjZLYzdt?= =?utf-8?B?Rm50eHowWGlyeVdWdGNNUDhnUVZ3WHFPcC9qZ1NZV1Z0UWtOdkJ5QzFQTWtJ?= =?utf-8?B?ZUpkcHgxbTBzMVFTbGZYRjlJcHdrYzJHR3FzeFhGMVppbzN2N0VHeFpDK3Fu?= =?utf-8?Q?jWJ1zrWU=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0819; 5:Urg6vx5w9MQYLv9dzeWpy2guB18J9yKjrzBWNh217U1SrTnjd6WxE2KZbP/wE3H7Qcfp/VdqsASFWk2ybswImthLsb3n1LGGcwktlJaat2usBnfTJheEtsGI1xSzjCK57yzBMcoBcsxPWpLn0vE3lg==; 24:HjNoqDVy7/Xf6v0O8FInodl2aqFZ+fdkNsg3Dki17BlyU+6qIN+nHdIfGUc7Tfc1pfodE0tjTauRsIf7uGKnTERK8ie7Ah9tiaqkiV97ag4=; 20:UQC4yH3FmCW++IQyYE1EefF0Kzo4wzs+UZ4lw3KUPwgdwaGM9Lx2xdo8AnR7woNyyE6IJRohaeE/ckK6dS/vAjevKbRm761c2iKlcaRPfC8krlBihEZH9W3Byx3nuSdpUP5hll7WsMF5KxNIMKWzpYUJxKiBtaycdPxRZW1YwFvN3h6Y/Pv1zhao6BRAEeUIQi+rmEeIwmWOqGhX2SCqufMP9eTuwwk4vozRF86bg+yLZNxdZNXQef3FYFGcwAdQ SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2016 14:24:51.5297 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.173]; Helo=[milsmgep12.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR0201MB0819 X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0547; 2:Krd9nEGJk7S5+dtJlLMU8vnGbp+WJHbdfhV9swfdG0kNeEPY+GIgdlQtKARxolLjnKGS1ggnGLkMpolwwBBSuFaECVSOCj2xRQ5ZP+9Gou0lxmoq46xHzt2KuQV4O+DY2AUOpbe7nCF3kdrXsRFuUA==; 23:THIQJs8AkvFhIKc3xICCq/0+bSv2j1AWyvJwsoAi1jnQ/3/WoFIP3wSQomDXACWm7jRQwzhzWy9l7PJFa/Z7lhMfxdKuOfsr6W/GtfAD0cDopyRPHL98gPHgiWRvBFqVozDm3P0oWdR+g1TMFcuGApxq/juyiow0scyV19Dpph1Jeb7XxUx9HFc/o0Vm9pRs X-OriginatorOrg: sandisk.com Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Avoid that srpt_close_session() waits if it doesn't have to wait. Additionally, increase the time during which srpt_close_session() waits until closing a session has finished. This makes it easier to detect session shutdown bugs. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Reviewed-by: Christoph Hellwig --- drivers/infiniband/ulp/srpt/ib_srpt.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 0ff4ed6..1857d17 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -1981,8 +1981,8 @@ static void srpt_release_channel_work(struct work_struct *w) struct se_session *se_sess; ch = container_of(w, struct srpt_rdma_ch, release_work); - pr_debug("ch = %p; ch->sess = %p; release_done = %p\n", ch, ch->sess, - ch->release_done); + pr_debug("%s: %s-%d; release_done = %p\n", __func__, ch->sess_name, + ch->qp->qp_num, ch->release_done); sdev = ch->sport->sdev; BUG_ON(!sdev); @@ -2006,11 +2006,10 @@ static void srpt_release_channel_work(struct work_struct *w) ch->rsp_size, DMA_TO_DEVICE); spin_lock_irq(&sdev->spinlock); - list_del(&ch->list); - spin_unlock_irq(&sdev->spinlock); - + list_del_init(&ch->list); if (ch->release_done) complete(ch->release_done); + spin_unlock_irq(&sdev->spinlock); wake_up(&sdev->ch_releaseQ); @@ -3033,24 +3032,26 @@ static void srpt_release_cmd(struct se_cmd *se_cmd) static void srpt_close_session(struct se_session *se_sess) { DECLARE_COMPLETION_ONSTACK(release_done); - struct srpt_rdma_ch *ch; - struct srpt_device *sdev; - unsigned long res; - - ch = se_sess->fabric_sess_ptr; - WARN_ON(ch->sess != se_sess); + struct srpt_rdma_ch *ch = se_sess->fabric_sess_ptr; + struct srpt_device *sdev = ch->sport->sdev; + bool wait; - pr_debug("ch %p state %d\n", ch, ch->state); + pr_debug("ch %s-%d state %d\n", ch->sess_name, ch->qp->qp_num, + ch->state); - sdev = ch->sport->sdev; spin_lock_irq(&sdev->spinlock); BUG_ON(ch->release_done); ch->release_done = &release_done; + wait = !list_empty(&ch->list); __srpt_close_ch(ch); spin_unlock_irq(&sdev->spinlock); - res = wait_for_completion_timeout(&release_done, 60 * HZ); - WARN_ON(res == 0); + if (!wait) + return; + + while (wait_for_completion_timeout(&release_done, 180 * HZ) == 0) + pr_info("%s(%s-%d state %d): still waiting ...\n", __func__, + ch->sess_name, ch->qp->qp_num, ch->state); } /**