Skip to content

Commit 48271d1

Browse files
davejianggregkh
authored andcommitted
dmaengine: idxd: fix wq slot allocation index check
[ Upstream commit 673d812 ] The sbitmap wait and allocate routine checks the index that is returned from sbitmap_queue_get(). It should be idxd >= 0 as 0 is also a valid index. This fixes issue where submission path hangs when WQ size is 1. Fixes: 0705107 ("dmaengine: idxd: move submission to sbitmap_queue") Signed-off-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162697645067.3478714.506720687816951762.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 777344d commit 48271d1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/dma/idxd/submit.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct idxd_desc *idxd_alloc_desc(struct idxd_wq *wq, enum idxd_op_type optype)
4545
if (signal_pending_state(TASK_INTERRUPTIBLE, current))
4646
break;
4747
idx = sbitmap_queue_get(sbq, &cpu);
48-
if (idx > 0)
48+
if (idx >= 0)
4949
break;
5050
schedule();
5151
}

0 commit comments

Comments
 (0)