Skip to content

Commit 00777a6

Browse files
committed
RDMA/cm: Add some lockdep assertions for cm_id_priv->lock
These functions all touch state, so must be called under the lock. Inspection shows this is currently true. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent d1de9a8 commit 00777a6

File tree

1 file changed

+6
-0
lines changed
  • drivers/infiniband/core

1 file changed

+6
-0
lines changed

drivers/infiniband/core/cm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,8 @@ static void cm_enter_timewait(struct cm_id_private *cm_id_priv)
974974
unsigned long flags;
975975
struct cm_device *cm_dev;
976976

977+
lockdep_assert_held(&cm_id_priv->lock);
978+
977979
cm_dev = ib_get_client_data(cm_id_priv->id.device, &cm_client);
978980
if (!cm_dev)
979981
return;
@@ -1005,6 +1007,8 @@ static void cm_reset_to_idle(struct cm_id_private *cm_id_priv)
10051007
{
10061008
unsigned long flags;
10071009

1010+
lockdep_assert_held(&cm_id_priv->lock);
1011+
10081012
cm_id_priv->id.state = IB_CM_IDLE;
10091013
if (cm_id_priv->timewait_info) {
10101014
spin_lock_irqsave(&cm.lock, flags);
@@ -1823,6 +1827,8 @@ static void cm_format_rej(struct cm_rej_msg *rej_msg,
18231827
const void *private_data,
18241828
u8 private_data_len)
18251829
{
1830+
lockdep_assert_held(&cm_id_priv->lock);
1831+
18261832
cm_format_mad_hdr(&rej_msg->hdr, CM_REJ_ATTR_ID, cm_id_priv->tid);
18271833
IBA_SET(CM_REJ_REMOTE_COMM_ID, rej_msg,
18281834
be32_to_cpu(cm_id_priv->id.remote_id));

0 commit comments

Comments
 (0)