From patchwork Tue Feb 14 18:56:32 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: 9572521 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 60C8F601E7 for ; Tue, 14 Feb 2017 18:56:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3994027DCD for ; Tue, 14 Feb 2017 18:56:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E7E02845E; Tue, 14 Feb 2017 18:56:49 +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 D1FA827DCD for ; Tue, 14 Feb 2017 18:56:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752515AbdBNS4r (ORCPT ); Tue, 14 Feb 2017 13:56:47 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:26520 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752861AbdBNS4p (ORCPT ); Tue, 14 Feb 2017 13:56:45 -0500 X-IronPort-AV: E=Sophos;i="5.33,348,1477929600"; d="scan'208";a="86579456" Received: from unknown (HELO milsmgep14.sandisk.com) ([63.163.107.225]) by ob1.hgst.iphmx.com with ESMTP; 15 Feb 2017 02:56:43 +0800 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 77.9B.18895.BE253A85; Tue, 14 Feb 2017 10:56:43 -0800 (PST) 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, 14 Feb 2017 10:56:40 -0800 X-AuditID: 0ac94371-0fadb980000049cf-89-58a352eb6b9a Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id E1.D6.18148.8E253A85; Tue, 14 Feb 2017 10:56:40 -0800 (PST) From: Bart Van Assche To: Doug Ledford CC: , Bart Van Assche , Israel Rukshin , Max Gurtovoy , Laurence Oberman Subject: [PATCH v2 4/8] IB/srp: Document locking conventions Date: Tue, 14 Feb 2017 10:56:32 -0800 Message-ID: <20170214185636.29250-5-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170214185636.29250-1-bart.vanassche@sandisk.com> References: <20170214185636.29250-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRmVeSWpSXmKPExsXCddJ5ke7roMURBlvfKli8PP+B1eLG4rUs Fs8O9bJYnP/wisni9KMD7A6sHs+mH2byeL/vKpvH501yAcxRXDYpqTmZZalF+nYJXBn/Z15i KWjgqnh0zKSBcQdHFyMnh4SAicTsuy/Zuhi5OIQEljJJXFx6hQkkISSwjVHi5kJ3mKKDJ74y QhRtZJRo/3+OBSTBJmAk8e39TDBbREBNYtOrRewgRcwChxkl3n+fzQiSEBawkVh99imYzSKg KrFk3guwDbwC9hKPGm4wQWyQl9jVdpEVxOYUcJCY+W0hK8QV9hJn++eADZUQaGOVON17jQWi WVDi5MwnYDazgITEwRcvmCEa1CVOLpnPNIFRaBaSsllIyhYwMq1iFMvNzCnOTU8tMDTRK07M S8ksztZLzs/dxAgJ7cIdjK9vex9iFOBgVOLhPSG7OEKINbGsuDL3EKMEB7OSCK+GA1CINyWx siq1KD++qDQntfgQozQHi5I4b5bs1AghgfTEktTs1NSC1CKYLBMHp1QDY+KEqOc7LxiGrbu9 e8HulVdLQ6/I5itaG3qG3mNnPxL53/UIv8MG0YSewCcuF7Wdriw/qiH+4oDg6SpGZs8F1to7 /J7umXJFcMljWatjfobc149brr3LzWBsYm4jwSvNFmlzYuraNQ/FmUXbZjkcvC7mIpfJvCxk U0Sf5ZP350SkfeIkG3S0lViKMxINtZiLihMBv5Pr7GkCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKJMWRmVeSWpSXmKPExsXCtZGTTfdF0OIIg90ruSwO/mxjtHh5/gOr xY3Fa1ksnh3qZbE4/+EVk8XpRwfYHdg8nk0/zOTxft9VNo9pa84zeXzeJBfAEsVlk5Kak1mW WqRvl8CV8X/mJZaCBq6KR8dMGhh3cHQxcnJICJhIHDzxlbGLkYtDSGA9o8S9Qz3MIAk2ASOJ b+9nsoDYIgJqEpteLWIHsZkFjjJKzPnIDWILC9hIrD77lBHEZhFQlVgy7wUTiM0rYC+x9s10 NogF8hK72i6ygticAg4SM78tBLOFgGrO9s9hn8DIvYCRYRWjWG5mTnFuemaBoZFecWJeSmZx tl5yfu4mRkhARO1gvD7R/BAjEwenVAOjWfXlaQbWi1RmqETF3Nr0VnW9BqP27Ud8i23/WFRl lGRrzW1fFLNKmelqzV/fo4r5PmtMfz4zNNjzw6nhV6TNJrnW/MeVn5W7//bG/ZnmcWhjXYmy RM2J+v0xS3if36n/uE7/jMaHz4f4lRnP3rEydFGp6CzfytDAYstje+F09tqc0HpDm3wlluKM REMt5qLiRABOiPJ+uAEAAA== 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 8d6ce03da1e8..01da4400f5bb 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 @@ -1799,6 +1800,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)) @@ -1829,6 +1832,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); }