diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-03-07 05:06:29 +0100 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2021-03-16 11:45:06 +0100 |
commit | 868833fbffbe51c487df4f95d4de9194264a4b30 (patch) | |
tree | 5a6912f8073d5ec62e6d076bfb87400455ca5bd2 /drivers/dma | |
parent | dmaengine: xilinx: dpdma: Fix descriptor issuing on video group (diff) | |
download | linux-868833fbffbe51c487df4f95d4de9194264a4b30.tar.xz linux-868833fbffbe51c487df4f95d4de9194264a4b30.zip |
dmaengine: xilinx: dpdma: Fix race condition in done IRQ
The active descriptor pointer is accessed from different contexts,
including different interrupt handlers, and its access must be protected
by the channel's lock. This wasn't done in the done IRQ handler. Fix it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20210307040629.29308-3-laurent.pinchart@ideasonboard.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/xilinx/xilinx_dpdma.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/dma/xilinx/xilinx_dpdma.c b/drivers/dma/xilinx/xilinx_dpdma.c index d504112c609e..70b29bd079c9 100644 --- a/drivers/dma/xilinx/xilinx_dpdma.c +++ b/drivers/dma/xilinx/xilinx_dpdma.c @@ -1048,13 +1048,14 @@ static int xilinx_dpdma_chan_stop(struct xilinx_dpdma_chan *chan) */ static void xilinx_dpdma_chan_done_irq(struct xilinx_dpdma_chan *chan) { - struct xilinx_dpdma_tx_desc *active = chan->desc.active; + struct xilinx_dpdma_tx_desc *active; unsigned long flags; spin_lock_irqsave(&chan->lock, flags); xilinx_dpdma_debugfs_desc_done_irq(chan); + active = chan->desc.active; if (active) vchan_cyclic_callback(&active->vdesc); else |