]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dmaengine: xilinx: xdma: Fix data synchronisation in xdma_channel_isr()
authorLouis Chauvet <louis.chauvet@bootlin.com>
Fri, 7 Jun 2024 08:34:38 +0000 (10:34 +0200)
committerVinod Koul <vkoul@kernel.org>
Fri, 7 Jun 2024 17:11:51 +0000 (22:41 +0530)
Requests the vchan lock before using xdma->stop_request.

Fixes: 6a40fb824596 ("dmaengine: xilinx: xdma: Fix synchronization issue")
Cc: stable@vger.kernel.org
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
Link: https://lore.kernel.org/r/20240607-xdma-fixes-v2-1-0282319ce345@bootlin.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/xilinx/xdma.c

index e143a733081610c4fe80e35bddffd9c76d9b13ad..718842fdaf98ed08a0adde013b13284600c39420 100644 (file)
@@ -885,11 +885,11 @@ static irqreturn_t xdma_channel_isr(int irq, void *dev_id)
        u32 st;
        bool repeat_tx;
 
+       spin_lock(&xchan->vchan.lock);
+
        if (xchan->stop_requested)
                complete(&xchan->last_interrupt);
 
-       spin_lock(&xchan->vchan.lock);
-
        /* get submitted request */
        vd = vchan_next_desc(&xchan->vchan);
        if (!vd)