aboutsummaryrefslogtreecommitdiff
path: root/lib/test_fortify/write_overflow-strncpy-src.c
diff options
context:
space:
mode:
authorDuoming Zhou <[email protected]>2023-08-06 11:25:11 +0800
committerVinod Koul <[email protected]>2023-10-04 19:26:36 +0530
commit01f1ae2733e2bb4de92fefcea5fda847d92aede1 (patch)
treebbe74fd11ee615dbf570fa24e15205867c3a3d59 /lib/test_fortify/write_overflow-strncpy-src.c
parentc0409dd3d151f661e7e57b901a81a02565df163c (diff)
dmaengine: mediatek: Fix deadlock caused by synchronize_irq()
The synchronize_irq(c->irq) will not return until the IRQ handler mtk_uart_apdma_irq_handler() is completed. If the synchronize_irq() holds a spin_lock and waits the IRQ handler to complete, but the IRQ handler also needs the same spin_lock. The deadlock will happen. The process is shown below: cpu0 cpu1 mtk_uart_apdma_device_pause() | mtk_uart_apdma_irq_handler() spin_lock_irqsave() | | spin_lock_irqsave() //hold the lock to wait | synchronize_irq() | This patch reorders the synchronize_irq(c->irq) outside the spin_lock in order to mitigate the bug. Fixes: 9135408c3ace ("dmaengine: mediatek: Add MediaTek UART APDMA support") Signed-off-by: Duoming Zhou <[email protected]> Reviewed-by: Eugen Hristev <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions