]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dmaengine: idxd: Wait for submitted operations on .device_synchronize()
authorVinicius Costa Gomes <vinicius.gomes@intel.com>
Wed, 21 Jan 2026 18:34:32 +0000 (10:34 -0800)
committerVinod Koul <vkoul@kernel.org>
Wed, 25 Feb 2026 11:09:18 +0000 (16:39 +0530)
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>
drivers/dma/idxd/dma.c

index e4f9788aa63515a0f647a335b106895318b1704d..9937b671f63763f38dd8622b66b331d821c5db55 100644 (file)
@@ -203,6 +203,13 @@ static int idxd_dma_terminate_all(struct dma_chan *c)
        return 0;
 }
 
+static void idxd_dma_synchronize(struct dma_chan *c)
+{
+       struct idxd_wq *wq = to_idxd_wq(c);
+
+       idxd_wq_drain(wq);
+}
+
 int idxd_register_dma_device(struct idxd_device *idxd)
 {
        struct idxd_dma_dev *idxd_dma;
@@ -234,6 +241,7 @@ int idxd_register_dma_device(struct idxd_device *idxd)
        dma->device_alloc_chan_resources = idxd_dma_alloc_chan_resources;
        dma->device_free_chan_resources = idxd_dma_free_chan_resources;
        dma->device_terminate_all = idxd_dma_terminate_all;
+       dma->device_synchronize = idxd_dma_synchronize;
 
        rc = dma_async_device_register(dma);
        if (rc < 0) {