diff options
author | Tudor Ambarus <tudor.ambarus@microchip.com> | 2020-01-23 15:03:11 +0100 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2020-02-25 06:57:27 +0100 |
commit | 078a6506141a4ce76bee6c257e9b14f5c606ee4c (patch) | |
tree | 03227350ce44872ded5f4aa3c138c933e11c99ae /block/ioprio.c | |
parent | dmaengine: at_hdmac: Switch atomic allocations to GFP_NOWAIT (diff) | |
download | linux-078a6506141a4ce76bee6c257e9b14f5c606ee4c.tar.xz linux-078a6506141a4ce76bee6c257e9b14f5c606ee4c.zip |
dmaengine: at_hdmac: Fix deadlocks
Fix the following deadlocks:
1/ atc_handle_cyclic() and atc_chain_complete() called
dmaengine_desc_get_callback_invoke() while wrongly holding the
atchan->lock. Clients can set the callback to dmaengine_terminate_sync()
which will end up trying to get the same lock, thus a deadlock occurred.
2/ dma_run_dependencies() was called with the atchan->lock held, but the
method calls device_issue_pending() which tries to get the same lock,
and so a deadlock occurred.
The driver must not hold the lock when invoking the callback or when
running dependencies. Releasing the spinlock within a called function
before calling the callback is not a nice thing to do -> called functions
become non-atomic when called within an atomic region. Thus the lock is
now taken in the child routines whereever is needed.
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Link: https://lore.kernel.org/r/20200123140237.125799-6-tudor.ambarus@microchip.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'block/ioprio.c')
0 files changed, 0 insertions, 0 deletions