Skip to content

Commit 8d0191a

Browse files
tititiou36vinodkoul
authored andcommitted
dmaengine: idxd: Remove a useless mutex
ida_alloc()/ida_free() don't need any mutex, so remove this one. It was introduced by commit e6fd6d7 ("dmaengine: idxd: add a device to represent the file opened"). Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Fenghua Yu <[email protected]> Reviewed-by: Dave Jiang <[email protected]> Link: https://lore.kernel.org/r/e08df764e7046178ada4ec066852c0ce65410373.1730547933.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul <[email protected]>
1 parent 8a20040 commit 8d0191a

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

drivers/dma/idxd/cdev.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ struct idxd_cdev_context {
2828
* global to avoid conflict file names.
2929
*/
3030
static DEFINE_IDA(file_ida);
31-
static DEFINE_MUTEX(ida_lock);
3231

3332
/*
3433
* ictx is an array based off of accelerator types. enum idxd_type
@@ -123,9 +122,7 @@ static void idxd_file_dev_release(struct device *dev)
123122
struct idxd_device *idxd = wq->idxd;
124123
int rc;
125124

126-
mutex_lock(&ida_lock);
127125
ida_free(&file_ida, ctx->id);
128-
mutex_unlock(&ida_lock);
129126

130127
/* Wait for in-flight operations to complete. */
131128
if (wq_shared(wq)) {
@@ -284,9 +281,7 @@ static int idxd_cdev_open(struct inode *inode, struct file *filp)
284281
}
285282

286283
idxd_cdev = wq->idxd_cdev;
287-
mutex_lock(&ida_lock);
288284
ctx->id = ida_alloc(&file_ida, GFP_KERNEL);
289-
mutex_unlock(&ida_lock);
290285
if (ctx->id < 0) {
291286
dev_warn(dev, "ida alloc failure\n");
292287
goto failed_ida;

0 commit comments

Comments
 (0)