diff options
author | Tudor Ambarus <tudor.ambarus@microchip.com> | 2020-01-23 14:03:11 +0000 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2020-02-25 11:27:27 +0530 |
commit | 078a6506141a4ce76bee6c257e9b14f5c606ee4c (patch) | |
tree | 03227350ce44872ded5f4aa3c138c933e11c99ae /fs/xfs/xfs_reflink.h | |
parent | 247b4d83d6525d04278333cf201d6e3b066c9ca5 (diff) |
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 'fs/xfs/xfs_reflink.h')
0 files changed, 0 insertions, 0 deletions