Skip to content

Commit 2a93f57

Browse files
vcgomesvinodkoul
authored andcommitted
dmaengine: idxd: Flush all pending descriptors
When used as a dmaengine, the DMA "core" might ask the driver to terminate all pending requests, when that happens, flush all pending descriptors. In this context, flush means removing the requests from the pending lists, so even if they are completed after, the user is not notified. Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Link: https://patch.msgid.link/20260121-idxd-fix-flr-on-kernel-queues-v3-v3-5-7ed70658a9d1@intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent f019d78 commit 2a93f57

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

drivers/dma/idxd/dma.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,15 @@ static void idxd_dma_release(struct dma_device *device)
194194
kfree(idxd_dma);
195195
}
196196

197+
static int idxd_dma_terminate_all(struct dma_chan *c)
198+
{
199+
struct idxd_wq *wq = to_idxd_wq(c);
200+
201+
idxd_wq_flush_descs(wq);
202+
203+
return 0;
204+
}
205+
197206
int idxd_register_dma_device(struct idxd_device *idxd)
198207
{
199208
struct idxd_dma_dev *idxd_dma;
@@ -224,6 +233,7 @@ int idxd_register_dma_device(struct idxd_device *idxd)
224233
dma->device_issue_pending = idxd_dma_issue_pending;
225234
dma->device_alloc_chan_resources = idxd_dma_alloc_chan_resources;
226235
dma->device_free_chan_resources = idxd_dma_free_chan_resources;
236+
dma->device_terminate_all = idxd_dma_terminate_all;
227237

228238
rc = dma_async_device_register(dma);
229239
if (rc < 0) {

0 commit comments

Comments
 (0)