[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <3f311a4ebfff657c3e9ccbe754baf8be6ece4306.1657301795.git.christophe.jaillet@wanadoo.fr>
Date: Fri, 8 Jul 2022 19:37:22 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Cheng Xu <chengyou@...ux.alibaba.com>,
Kai Shen <kaishen@...ux.alibaba.com>,
Jason Gunthorpe <jgg@...pe.ca>,
Leon Romanovsky <leon@...nel.org>
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
linux-rdma@...r.kernel.org
Subject: [PATCH 2/2] RDMA/erdma: Use the non-atomic bitmap API when applicable
Usages of the 'comp_wait_bitmap' bitmap is protected with a spinlock, so
non-atomic functions can be used to set/clear bits.
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
drivers/infiniband/hw/erdma/erdma_cmdq.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/erdma/erdma_cmdq.c b/drivers/infiniband/hw/erdma/erdma_cmdq.c
index 0489838d9717..e3d426668788 100644
--- a/drivers/infiniband/hw/erdma/erdma_cmdq.c
+++ b/drivers/infiniband/hw/erdma/erdma_cmdq.c
@@ -47,7 +47,7 @@ static struct erdma_comp_wait *get_comp_wait(struct erdma_cmdq *cmdq)
return ERR_PTR(-ENOMEM);
}
- set_bit(comp_idx, cmdq->comp_wait_bitmap);
+ __set_bit(comp_idx, cmdq->comp_wait_bitmap);
spin_unlock(&cmdq->lock);
return &cmdq->wait_pool[comp_idx];
@@ -60,7 +60,7 @@ static void put_comp_wait(struct erdma_cmdq *cmdq,
cmdq->wait_pool[comp_wait->ctx_id].cmd_status = ERDMA_CMD_STATUS_INIT;
spin_lock(&cmdq->lock);
- used = test_and_clear_bit(comp_wait->ctx_id, cmdq->comp_wait_bitmap);
+ used = __test_and_clear_bit(comp_wait->ctx_id, cmdq->comp_wait_bitmap);
spin_unlock(&cmdq->lock);
WARN_ON(!used);
--
2.34.1
Powered by blists - more mailing lists