Skip to content

Commit

Permalink
dmaengine: idxd: fix wq slot allocation index check
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/162697645067.3478714.506720687816951762.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
davejiang authored and vinodkoul committed Jul 28, 2021
1 parent 568b212 commit 673d812
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/dma/idxd/submit.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,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();
}
Expand Down

0 comments on commit 673d812

Please sign in to comment.