summaryrefslogtreecommitdiff
path: root/drivers/crypto/atmel-sha.c
diff options
context:
space:
mode:
authorTudor Ambarus <tudor.ambarus@microchip.com>2019-12-13 09:54:42 +0000
committerHerbert Xu <herbert@gondor.apana.org.au>2019-12-20 14:58:34 +0800
commit0e69378940eafe386464679a84856d1b63e1bac2 (patch)
treef2e10f30595cc313c2103cbb1c2c131ae4a1e8d5 /drivers/crypto/atmel-sha.c
parent7d07de2c18abd95f72efb28f78a4825e0fc1aa6a (diff)
crypto: atmel-{aes,sha} - Fix incorrect use of dmaengine_terminate_all()
device_terminate_all() is used to abort all the pending and ongoing transfers on the channel, it should be used just in the error path. Also, dmaengine_terminate_all() is deprecated and one should use dmaengine_terminate_async() or dmaengine_terminate_sync(). The method is not used in atomic context, use dmaengine_terminate_sync(). A secondary aspect of this patch is that it luckily avoids a deadlock between atmel_aes and at_hdmac.c. While in tasklet with the lock held, the dma controller invokes the client callback (dmaengine_terminate_all), which tries to get the same lock. The at_hdmac fix would be to drop the lock before invoking the client callback, a fix on at_hdmac will follow. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/atmel-sha.c')
-rw-r--r--drivers/crypto/atmel-sha.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
index ebf500153700..7cf4ec9ed93a 100644
--- a/drivers/crypto/atmel-sha.c
+++ b/drivers/crypto/atmel-sha.c
@@ -1429,7 +1429,6 @@ static void atmel_sha_dma_callback2(void *data)
struct scatterlist *sg;
int nents;
- dmaengine_terminate_all(dma->chan);
dma_unmap_sg(dd->dev, dma->sg, dma->nents, DMA_TO_DEVICE);
sg = dma->sg;