* [PATCH] dmaengine: idxd: fix wq slot allocation index check
@ 2021-07-22 17:54 Dave Jiang
2021-07-28 12:28 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Dave Jiang @ 2021-07-22 17:54 UTC (permalink / raw)
To: vkoul; +Cc: dmaengine
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@intel.com>
---
drivers/dma/idxd/submit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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();
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dmaengine: idxd: fix wq slot allocation index check
2021-07-22 17:54 [PATCH] dmaengine: idxd: fix wq slot allocation index check Dave Jiang
@ 2021-07-28 12:28 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2021-07-28 12:28 UTC (permalink / raw)
To: Dave Jiang; +Cc: dmaengine
On 22-07-21, 10:54, Dave Jiang wrote:
> 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.
Applied, thanks
--
~Vinod
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-28 12:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22 17:54 [PATCH] dmaengine: idxd: fix wq slot allocation index check Dave Jiang
2021-07-28 12:28 ` Vinod Koul
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.