From patchwork Tue Jan 5 14:24:15 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: 7955341 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8B9E89F38D for ; Tue, 5 Jan 2016 14:24:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A614020384 for ; Tue, 5 Jan 2016 14:24:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 72D892037E for ; Tue, 5 Jan 2016 14:24:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751623AbcAEOYX (ORCPT ); Tue, 5 Jan 2016 09:24:23 -0500 Received: from mail-bn1bon0071.outbound.protection.outlook.com ([157.56.111.71]:48160 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751598AbcAEOYW (ORCPT ); Tue, 5 Jan 2016 09:24:22 -0500 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=vkg7JVve45Efxx6dQ289JLrLBeK+nTBqtbBCZOylG9E=; b=mRfKzM4/PWwdDy4tWCjXtBH/ZcCuJOEZpp2sP3+cIzZzS9XSzwmt5NhpfBabQ2xaNxjgkhp5/ok4Rh1h/2A0n6Kgq6x4BQ8uuIg+9nvIHvvYDgGQItCHIi9b3Sth7oZLCs650QWDkXIqsJLpQwkluzNXo0af/SJ89QvlWpUOZoE= Received: from BY2PR02CA0114.namprd02.prod.outlook.com (10.163.44.168) by BL2PR02MB291.namprd02.prod.outlook.com (10.141.90.148) with Microsoft SMTP Server (TLS) id 15.1.361.13; Tue, 5 Jan 2016 14:24:20 +0000 Received: from BN1BFFO11FD005.protection.gbl (2a01:111:f400:7c10::1:106) by BY2PR02CA0114.outlook.office365.com (2a01:111:e400:5261::40) with Microsoft SMTP Server (TLS) id 15.1.361.13 via Frontend Transport; Tue, 5 Jan 2016 14:24:19 +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 BN1BFFO11FD005.mail.protection.outlook.com (10.58.144.68) with Microsoft SMTP Server id 15.1.355.15 via Frontend Transport; Tue, 5 Jan 2016 14:24:17 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com ( [172.22.12.162]) by milsmgep12.sandisk.com (Symantec Messaging Gateway) with SMTP id 00.1E.02821.112DB865; Tue, 5 Jan 2016 06:24:17 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.248.2; Tue, 5 Jan 2016 06:24:17 -0800 X-AuditID: ac160a69-f797e6d000000b05-ed-568bd21134aa Received: from [10.50.231.71] ( [10.177.8.100]) by milsmgip11.sandisk.com (Symantec Messaging Gateway) with SMTP id CC.FD.08831.012DB865; Tue, 5 Jan 2016 06:24:17 -0800 (PST) Subject: [PATCH 08/15] IB/srpt: Simplify srpt_shutdown_session() To: Doug Ledford References: <568BD0FC.70207@sandisk.com> CC: Christoph Hellwig , "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: <568BD20F.7020101@sandisk.com> Date: Tue, 5 Jan 2016 15:24:15 +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+NgFnrDLMWRmVeSWpSXmKPExsWyRoxnka7gpe4wgw1f9C1env/AarFy9VEm i2eHelkcmD1232xg83i/7yqbx+dNcgHMUVw2Kak5mWWpRfp2CVwZ3z/eZCt4z1/xcNdy9gbG M7xdjJwcEgImEnv3nWCGsMUkLtxbzwZiCwmcYJSYdq+ii5ELyN7OKNF0dTEjTMPKd5eZIRKb GSUaey+BdQgLOEg8nHmCHcQWEVCT2PRqEZDNAVSkIfFuaxZImFkgXmLdpzdgc9gEjCS+vZ/J AmLzCmhJfFr1HKyVRUBFYsf7VawgtqhAhMSPDUsYIWoEJU7OfAJWzymgKfG/dRfYeGYge/0u fYjx8hLb386B+mUZq8SfrWoQv6hLnFwyn2kCo8gsJJNmIXTPQtK9gJF5FaNYbmZOcW56aoGh kV5xYl5KZnG2XnJ+7iZGcBxwZe5gXDHJ/BCjAAejEg8vx8uuMCHWxLLiytxDjBIczEoivK+P dIcJ8aYkVlalFuXHF5XmpBYfYpTmYFES57VuUQsTEkhPLEnNTk0tSC2CyTJxcEo1MM7Nvrb5 eptozKaTu77HNv7/k/t6p9+yv7fDz+748DKwbePsf05if/qD/uv2PQozsdX/s0p40kYlE+Gt Ga+KfCdfnb0k4GKl/pEX4i+NtpVrGHU99wsvj/W721v+NfrjzIarxY4LLBL29lbFv+D71Dn3 hu15o6QTu9h/M0ll8i+5v7fY389ZSUmJpTgj0VCLuag4EQBL5pIrfwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCJMWRmVeSWpSXmKPExsXCtZEjRVfwUneYwcdZihYvz39gtVi5+iiT xbNDvSwOzB67bzawebzfd5XN4/MmuQDmKC6blNSczLLUIn27BK6M7x9vshW85694uGs5ewPj Gd4uRk4OCQETiZXvLjND2GISF+6tZ+ti5OIQEtjIKHH3aTM7SEJYwEHi4cwTYLaIgJrEpleL gGwOoCINiXdbs0BMZoF4ibudTCAVbAJGEt/ez2QBsXkFtCQ+rXoO1skioCKx4/0qVhBbVCBC 4seGJYwQNYISJ2c+AavnFNCU+N+6C6yeWUBd4s+8S8wQtrzE9rdzmCcw8s9C0jILSdksJGUL GJlXMYrlZuYU56ZnFhga6hUn5qVkFmfrJefnbmIEhyNn5A7GpxPNDzEycXBKNTBqq7525bOq br1ekVmYF/9btqN1dc0mzp2fQkJ3LyleKLQlS3rXBOGf/i5lyxz9JWQP91e+2hAtbbLjzknP 5xM7Nj7Ue5LGFJeZ/Pu7wMQpacEH8ybuzJ7bcHjNv8Y1M94LGFfqrV3usW4mo4PYea2G9y8S 7efPTeipiD9/2fMVs8DcXXuXf9dVYinOSDTUYi4qTgQAgAlZ0vcBAAA= X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD005; 1:FDHWONs9M3ITeH6NraekRWLN+Gzjw7AMrHM9X58Yb609uGxGN5UT0nEcU5i4/9M1BZ49/DiTccReYynorOKLBk6t4JS9bGbmYmZbRD+V/p4fx+9YPccITO6MGzWd8aRTjT1ggofgAj2lygCeVNBOzGBSz0Zz5X/fypd2MrDRzm7CJXt44PxCKMJvtYMoS+zPW8w81KWd3V6vfS//XH5TCmI7jRfT9hxgh7WQ1t1JARQQMjwgZsa3AXVsuubdwYWzy11CAgibmZUFr+D1R+6jeHVfGrL/5xUcTl8iLqkEIEP8LsgZ2OxTgki/8GBBIbbEEQKHMTt1bz3dASj56qOWZw== X-Forefront-Antispam-Report: CIP:63.163.107.173; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(199003)(189002)(33656002)(50466002)(106466001)(110136002)(64126003)(81156007)(1220700001)(65956001)(83506001)(5001960100002)(1096002)(229853001)(97736004)(65806001)(189998001)(19580395003)(4001350100001)(36756003)(23676002)(87936001)(586003)(80316001)(86362001)(65816999)(59896002)(87266999)(5008740100001)(2950100001)(4326007)(54356999)(92566002)(77096005)(50986999)(230700001)(47776003)(76176999)(575784001)(69596002)(19580405001); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR02MB291; H:milsmgep12.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB291; 2:ea19stsAFC5n8UHDfX5LVE0pr+ty0KSzbPusAp+2EOyBLd5/xLgMyt+3gycN5QlU26KiY6EixzhAGi6+/AYi9T8Hk0OD20M2n46s4GY6YGhIshhgMUbHXMPNESya4RMflBYLTWUCJFSjiU3Xnvi8Nw==; 3:n6rLTUxw0K3JwYtGfc1E5CoqrGPHRsyjrfhyAHW/18L3St8AAQ71ed5HQsY9NkGOx5MZdQQzfSEC43wSTylXNWiYcQVKmEErO31B1xqH66Opd9iCRirhyo7zI9S3xEtvH97SVX4H3lALIqm3PxcIfGbTt/g4DZ6e/xOUdXbrrrx8nNlx01JE3Cc/yAnr+WMK83+F/ouStCeyNPT1eQy33a0ONEvF/5WsVBlevrP/HPvWJsXaqZ6qLmCwqJ7uYk6Sc0KQUOOFdYvbH5MNelf7nA==; 25:foYKR7ab9WpjSEn0EMifm27gO0igzBZYj0AjwBn+5ZD2JMZjR2R0pe2KTnmE8MbLk7SWzrfxMZgdwSM0sf0hdZ1qzCcKqWEox3WpW7iXlfY9i5hH/3dVQQF6LItjPJTUjXipdAJ9MN62ZaN1oRCHzklYVEXePe0bYCCA9TzShLepCsFHyt77TwfySnky1RY9s6PJjnovflWmtBpm+P/Guoo7suOaNUkZaHr9NX7AsqHd3L1k8utAbiOlJZ6BBAei X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501001); SRVR:BL2PR02MB291; X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB291; 20:6sbr5uX+mFPtnzdjlUlZpJ7yt75O9SSzHncUics18CMThjC/ghRiJniXeTZSWblpo4tE1kVR10+Hphg3fgB7e1Hm4n3BSiBFgLSMNtUqfjf6jKoS3TVhquitUNLgbVPe8eO4WswftTrq7RdpO0lSX6PFFanZdqOBHrzKS3Wx69FXGyywzVcExH/A749Hxh1mO/OxykPY5EWmw1yMlvYN8hyA5urUeyEah2LQ2iZ/QQJeyjE0QffMDiYIvahi1kcQtOXJy0y/58qfYhMofnOyeIcDIAGST8dB7RlDm64HrpT28rG2dKoTc9WUeYOYW/yLVpKpz24BmYGgAD+gevzuLNLqqBdsxidPJn1pF/mZbJBNRxvs02Cf4Kf5zTr0DyUTWQnueH9KNXwbtz+due85MinG4xpZuZzPJhj0kOIhAKx+m1dMZT/AZPEv/lGMl9Wr5lGpY8oLFWTuT43xxGmndXvcduGP8//O2CfFwQWvCQiQ3PDk/naKdn0N2rKA3NGG; 4:9l+Oq+GVr+3FucSY+hxNjRGkewgGbq7ni9aHZRKkmVnhSexDrfoAmsFv+cY27UM55eMeHyBYi9gcO3TDx+cMtKa5SipUpQbB+hV+yu9n8s0q578aXjXaP/DntsqJ8PfPiDj73X2h4s8WjunZnPo85LRXy/guUWmuGySBRs9zk26BfLPQPTJ+hAtgkxsDbk944sz9P2vpcMwS0TDnS+BeP6PFGdqouTP0NOQw+5ElcTB4xzc4Tl/6NDbbt3M1A+MU+xP1Y6WFv8a/XJzKfZ2wrSBzk24ZM6ydDG1S3+zdtPmHRT3UX9TWJmGWPehQMhE6/VkjmJRa6laqr08+Vut+xNo2wDUrYFNezsmwEr4ScnnO0c9tXBUToytkC8KP2iDtCa9uh44qHd2/E6o7F51R+MFyeuGSUJZDb2dPi5g t9ys= 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:BL2PR02MB291; BCL:0; PCL:0; RULEID:; SRVR:BL2PR02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w9y0Oah9pJ/1a6On6AXguQW4JP4lDtvaCrcKCWkK/+D6l23UzBYTWep99/lOIbdCnuKpFmE6y2dG78s=; 20:OEnRroUoM9SJ7+r406WjLQuD+R8k2Qg6Z3Af3Gl1ZRD5/ID3CjWYyY036sQpzuQqpTvh7zarCFHXp7V8AvifGLADSEQZBj1PBc1OXEwMe7sXpwxBR4vr4DAnGm24JBTglx4ZmLhBG9SV8KzwWdsh6mrL02Xdw4ztOgOs+V6Yjew32HLonbmKiHbirmBQzIOQNO569E+W/OlGJcTimRaonhKDQBUGI6BJ7017ix9dYf8OusprRD9t8ZOtS5IQbMhZ SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2016 14:24:17.8385 (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: BL2PR02MB291 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 The target core guarantees that shutdown_session() is only invoked once per session. This means that the ib_srpt target driver doesn't have to track whether or not shutdown_session() has been called. Additionally, ensure that target_sess_cmd_list_set_waiting() is called before target_wait_for_sess_cmds() by moving it into srpt_release_channel_work(). Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg --- drivers/infiniband/ulp/srpt/ib_srpt.c | 14 +------------- drivers/infiniband/ulp/srpt/ib_srpt.h | 1 - 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index a27414d..0ff4ed6 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -1887,19 +1887,6 @@ static void srpt_close_ch(struct srpt_rdma_ch *ch) */ static int srpt_shutdown_session(struct se_session *se_sess) { - struct srpt_rdma_ch *ch = se_sess->fabric_sess_ptr; - unsigned long flags; - - spin_lock_irqsave(&ch->spinlock, flags); - if (ch->in_shutdown) { - spin_unlock_irqrestore(&ch->spinlock, flags); - return true; - } - - ch->in_shutdown = true; - target_sess_cmd_list_set_waiting(se_sess); - spin_unlock_irqrestore(&ch->spinlock, flags); - return true; } @@ -2003,6 +1990,7 @@ static void srpt_release_channel_work(struct work_struct *w) se_sess = ch->sess; BUG_ON(!se_sess); + target_sess_cmd_list_set_waiting(se_sess); target_wait_for_sess_cmds(se_sess); transport_deregister_session_configfs(se_sess); diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.h b/drivers/infiniband/ulp/srpt/ib_srpt.h index a98b86b..d0de468 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.h +++ b/drivers/infiniband/ulp/srpt/ib_srpt.h @@ -288,7 +288,6 @@ struct srpt_rdma_ch { u8 sess_name[36]; struct work_struct release_work; struct completion *release_done; - bool in_shutdown; }; /**