summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/core/restrack.c2
-rw-r--r--include/rdma/restrack.h3
2 files changed, 2 insertions, 3 deletions
diff --git a/drivers/infiniband/core/restrack.c b/drivers/infiniband/core/restrack.c
index ac97167da81c..076ef6475df8 100644
--- a/drivers/infiniband/core/restrack.c
+++ b/drivers/infiniband/core/restrack.c
@@ -210,13 +210,11 @@ static void rdma_restrack_add(struct rdma_restrack_entry *res)
kref_init(&res->kref);
init_completion(&res->comp);
- down_write(&dev->res.rwsem);
ret = rt_xa_alloc_cyclic(&dev->res.xa[res->type], &res->id, res,
&dev->res.next_id[res->type]);
if (!ret)
res->valid = true;
- up_write(&dev->res.rwsem);
}
/**
diff --git a/include/rdma/restrack.h b/include/rdma/restrack.h
index 44ce32cc0b51..53e1a7fb7355 100644
--- a/include/rdma/restrack.h
+++ b/include/rdma/restrack.h
@@ -58,7 +58,8 @@ struct rdma_restrack_entry;
*/
struct rdma_restrack_root {
/*
- * @rwsem: Read/write lock to protect lists
+ * @rwsem: Read/write lock to protect erase of entry.
+ * Lists and insertions are protected by XArray internal lock.
*/
struct rw_semaphore rwsem;
/**