From patchwork Fri Feb 10 23:56:06 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: 9567621 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 A988B602B6 for ; Fri, 10 Feb 2017 23:56:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 960E3285D2 for ; Fri, 10 Feb 2017 23:56:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B2D3285F3; Fri, 10 Feb 2017 23:56:38 +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,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 1507B285D2 for ; Fri, 10 Feb 2017 23:56:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751959AbdBJX43 (ORCPT ); Fri, 10 Feb 2017 18:56:29 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:53437 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750940AbdBJX4U (ORCPT ); Fri, 10 Feb 2017 18:56:20 -0500 X-IronPort-AV: E=Sophos;i="5.33,348,1477929600"; d="scan'208";a="83251597" Received: from unknown (HELO milsmgep15.sandisk.com) ([63.163.107.21]) by ob1.hgst.iphmx.com with ESMTP; 11 Feb 2017 07:56:18 +0800 Received: from MILHUBIP03.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 0B.5A.57638.2235E985; Fri, 10 Feb 2017 15:56:18 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Fri, 10 Feb 2017 15:56:14 -0800 X-AuditID: 0ac94369-26dee9800001e126-4f-589e5322d481 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id FD.A4.11415.E135E985; Fri, 10 Feb 2017 15:56:14 -0800 (PST) From: Bart Van Assche To: Doug Ledford CC: , Bart Van Assche , Israel Rukshin , Max Gurtovoy , Laurence Oberman Subject: [PATCH 3/8] IB/srp: Document locking conventions Date: Fri, 10 Feb 2017 15:56:06 -0800 Message-ID: <20170210235611.3243-4-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170210235611.3243-1-bart.vanassche@sandisk.com> References: <20170210235611.3243-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRmVeSWpSXmKPExsXCddJ5ka5S8LwIgzM7JC1env/AanFj8VoW i2eHelkszn94xWRx+tEBdgdWj2fTDzN5vN93lc3j8ya5AOYoLpuU1JzMstQifbsEroyeJ90s BQ1cFQ8W7GFsYNzB0cXIySEhYCJx7MgW5i5GLg4hgaVMEove/GSEcHYwSnw8sp4JpmrrthXs EInNjBLXtq1mBUmwCRhJfHs/kwXEFhFQk9j0ahFYEbPAYUaJ999nM4IkhAUsJS4tewqU4OBg EVCVWHCnGiTMK2AncXPfUlaIBfISu9ougtmcAvYS35dNA7OFgGrefP3ECjJTQqCLVeLZ1D2M EM2CEidnPgFbzCwgIXHwxQtmiAZ1iZNL5jNNYBSahaRsFpKyBYxMqxjFcjNzinPTUwsMTfWK E/NSMouz9ZLzczcxQoI7cwfj3SfehxgFOBiVeHgTjs+NEGJNLCuuzD3EKMHBrCTCm+Q6L0KI NyWxsiq1KD++qDQntfgQozQHi5I47zmZqRFCAumJJanZqakFqUUwWSYOTqkGxp3OsTPlZma3 K/F9OR94aVGu7eyzK5Qem/x54PlouvUOnoC3u+0sH/3b9LBl0h8pmYm3IubcSeVSkt25Oit6 zvol/6q8vLX/LNsv8TT1kcir40Eux3dIGprzVH3UsBawaK/6ZigZqpe590Txmnphi53tyn8U TwkHMS967/bo0YVpdvtSYizaeJVYijMSDbWYi4oTAaE50kFqAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKJMWRmVeSWpSXmKPExsXCtZEjRVcueF6EwbZ2a4uDP9sYLV6e/8Bq cWPxWhaLZ4d6WSzOf3jFZHH60QF2BzaPZ9MPM3m833eVzWPamvNMHp83yQWwRHHZpKTmZJal FunbJXBl9DzpZilo4Kp4sGAPYwPjDo4uRk4OCQETia3bVrB3MXJxCAlsZJR4/nENG0iCTcBI 4tv7mSwgtoiAmsSmV4vYQWxmgaOMEnM+coPYwgKWEpeWPQWKc3CwCKhKLLhTDRLmFbCTuDJ/ NxPEfHmJXW0XWUFsTgF7ie/LpoHZQkA1b75+Yp3AyL2AkWEVo1huZk5xbnpmgaGhXnFiXkpm cbZecn7uJkZwQHBG7mB8OtH8ECMTB6dUA2OhyOb7R+7ZvC50Krd9ciTC+Pss9+v+16xXhRha lW6aUmOy41P6wfxsV9ZNJx4e7PmYdG/bO88VVdpJ2bU5UydNi2Q94vJMOWLhzchXX48mKbzW mb/R30EtvLZQdcGSPtH9c3u5I/+3Hl3f77VRsYwjrTE7SIldXHjRGc3Y9MApbIt/rd2XtUyJ pTgj0VCLuag4EQA+Jv76uAEAAA== MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use lockdep_assert_held() statements to verify at run-time whether the proper locks are held. Signed-off-by: Bart Van Assche Cc: Israel Rukshin Cc: Max Gurtovoy Cc: Laurence Oberman --- drivers/infiniband/ulp/srp/ib_srp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 511eb4b2e6e0..a43db9d6b399 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -1804,6 +1805,8 @@ static struct srp_iu *__srp_get_tx_iu(struct srp_rdma_ch *ch, s32 rsv = (iu_type == SRP_IU_TSK_MGMT) ? 0 : SRP_TSK_MGMT_SQ_SIZE; struct srp_iu *iu; + lockdep_assert_held(&ch->lock); + ib_process_cq_direct(ch->send_cq, -1); if (list_empty(&ch->free_tx)) @@ -1834,6 +1837,8 @@ static void srp_send_done(struct ib_cq *cq, struct ib_wc *wc) return; } + lockdep_assert_held(&ch->lock); + list_add(&iu->list, &ch->free_tx); }