Skip to content

Commit 4fd3c46

Browse files
vcgomesvinodkoul
authored andcommitted
dmaengine: idxd: Wait for submitted operations on .device_synchronize()
When the dmaengine "core" asks the driver to synchronize, send a Drain operation to the device workqueue, which will wait for the already submitted operations to finish. 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-6-7ed70658a9d1@intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 2a93f57 commit 4fd3c46

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

drivers/dma/idxd/dma.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,13 @@ static int idxd_dma_terminate_all(struct dma_chan *c)
203203
return 0;
204204
}
205205

206+
static void idxd_dma_synchronize(struct dma_chan *c)
207+
{
208+
struct idxd_wq *wq = to_idxd_wq(c);
209+
210+
idxd_wq_drain(wq);
211+
}
212+
206213
int idxd_register_dma_device(struct idxd_device *idxd)
207214
{
208215
struct idxd_dma_dev *idxd_dma;
@@ -234,6 +241,7 @@ int idxd_register_dma_device(struct idxd_device *idxd)
234241
dma->device_alloc_chan_resources = idxd_dma_alloc_chan_resources;
235242
dma->device_free_chan_resources = idxd_dma_free_chan_resources;
236243
dma->device_terminate_all = idxd_dma_terminate_all;
244+
dma->device_synchronize = idxd_dma_synchronize;
237245

238246
rc = dma_async_device_register(dma);
239247
if (rc < 0) {

0 commit comments

Comments
 (0)