This is a note to let you know that I've just added the patch titled dmaengine: idxd: fix wq slot allocation index check to the 5.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: dmaengine-idxd-fix-wq-slot-allocation-index-check.patch and it can be found in the queue-5.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit afd9fe88a6f40274febf5b44a8a1f941a75db826 Author: Dave Jiang <dave.jiang@xxxxxxxxx> Date: Thu Jul 22 10:54:10 2021 -0700 dmaengine: idxd: fix wq slot allocation index check [ Upstream commit 673d812d30be67942762bb9e8548abb26a3ba4a7 ] 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: 0705107fcc80 ("dmaengine: idxd: move submission to sbitmap_queue") Signed-off-by: Dave Jiang <dave.jiang@xxxxxxxxx> Link: https://lore.kernel.org/r/162697645067.3478714.506720687816951762.stgit@xxxxxxxxxxxxxxxxxxxxxxxxxx Signed-off-by: Vinod Koul <vkoul@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/dma/idxd/submit.c b/drivers/dma/idxd/submit.c index 36c9c1a89b7e..196d6cf11965 100644 --- a/drivers/dma/idxd/submit.c +++ b/drivers/dma/idxd/submit.c @@ -67,7 +67,7 @@ struct idxd_desc *idxd_alloc_desc(struct idxd_wq *wq, enum idxd_op_type optype) if (signal_pending_state(TASK_INTERRUPTIBLE, current)) break; idx = sbitmap_queue_get(sbq, &cpu); - if (idx > 0) + if (idx >= 0) break; schedule(); }