]> git.ipfire.org Git - thirdparty/linux.git/commit
dmaengine: dw-edma: Add spinlock to protect DONE_INT_MASK and ABORT_INT_MASK
authorFrank Li <Frank.Li@nxp.com>
Thu, 21 May 2026 14:21:53 +0000 (23:21 +0900)
committerVinod Koul <vkoul@kernel.org>
Mon, 8 Jun 2026 11:32:21 +0000 (17:02 +0530)
commit8ffba0171c6bbce5f093c6dba5a02c0805b31203
tree091af11679982567bb9a65b539ae5bea3f8e95d5
parent11d7cfe0c119691b2dafbb699bbca90258c678aa
dmaengine: dw-edma: Add spinlock to protect DONE_INT_MASK and ABORT_INT_MASK

The DONE_INT_MASK and ABORT_INT_MASK registers are shared by all DMA
channels, and modifying them requires a read-modify-write sequence.
Because this operation is not atomic, concurrent calls to
dw_edma_v0_core_start() can introduce race conditions if two channels
update these registers simultaneously.

Add a spinlock to serialize access to these registers and prevent race
conditions.

Fixes: 7e4b8a4fbe2c ("dmaengine: Add Synopsys eDMA IP version 0 support")
Cc: stable@vger.kernel.org
Signed-off-by: Frank Li <Frank.Li@nxp.com>
[den: update dw_edma.lock comment]
Link: https://lore.kernel.org/dmaengine/20260109-edma_ll-v2-1-5c0b27b2c664@nxp.com/
Signed-off-by: Koichiro Den <den@valinux.co.jp>
Link: https://patch.msgid.link/20260521142153.2957432-5-den@valinux.co.jp
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/dw-edma/dw-edma-core.h
drivers/dma/dw-edma/dw-edma-v0-core.c