Tudor Ambarus 078a650614 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>
2020-02-25 11:27:27 +05:30
..
2020-02-07 12:51:54 -08:00
2020-01-29 18:53:37 -08:00
2020-02-06 06:11:50 +00:00
2020-02-08 14:04:19 -08:00
2020-02-08 14:04:19 -08:00
2020-02-08 14:17:27 -08:00
2020-02-08 14:17:27 -08:00
2020-02-08 14:04:19 -08:00
2020-02-08 14:04:19 -08:00
2020-02-25 11:27:27 +05:30
2020-01-27 13:03:00 -08:00
2020-02-08 14:04:19 -08:00
2020-02-09 16:05:50 -08:00
2020-01-30 08:04:01 -08:00
2020-02-08 14:04:19 -08:00
2020-02-04 07:17:41 +00:00
2020-01-31 14:40:36 -08:00
2020-02-05 17:49:54 +00:00
2020-02-04 13:06:46 +00:00
2020-02-04 07:17:41 +00:00
2020-01-16 10:45:44 -08:00
2020-02-04 07:17:41 +00:00
2020-01-27 13:03:00 -08:00
2020-02-06 06:15:23 +00:00
2020-02-08 14:04:19 -08:00
2020-01-27 13:03:00 -08:00
2020-02-06 14:17:38 +00:00
2020-02-08 13:55:25 -08:00
2020-02-03 14:51:57 +00:00
2020-02-04 07:17:41 +00:00
2020-02-08 17:24:41 -08:00
2020-02-08 14:04:19 -08:00
2020-01-29 18:16:16 -08:00
2020-01-31 11:28:31 -08:00
2020-02-08 14:04:19 -08:00
2020-02-09 16:05:50 -08:00
2020-02-03 22:22:05 +00:00
2020-02-09 16:05:50 -08:00
2020-01-29 10:35:54 -08:00
2020-01-29 10:35:54 -08:00
2020-02-07 12:30:16 -08:00
2020-02-05 17:44:14 +00:00
2020-02-09 16:05:50 -08:00