- 21 9月, 2015 1 次提交
-
-
由 Thomas Petazzoni 提交于
The mv_cesa_queue_req() function calls crypto_enqueue_request() to enqueue a request. In the normal case (i.e the queue isn't full), this function returns -EINPROGRESS. The current Marvell CESA crypto driver takes this into account and cleans up the request only if an error occured, i.e if the return value is not -EINPROGRESS. Unfortunately this causes problems with CRYPTO_TFM_REQ_MAY_BACKLOG-flagged requests. When such a request is passed to crypto_enqueue_request() and the queue is full, crypto_enqueue_request() will return -EBUSY, but will keep the request enqueued nonetheless. This situation was not properly handled by the Marvell CESA driver, which was anyway cleaning up the request in such a situation. When later on the request was taken out of the backlog and actually processed, a kernel crash occured due to the internal driver data structures for this structure having been cleaned up. To avoid this situation, this commit adds a mv_cesa_req_needs_cleanup() helper function which indicates if the request needs to be cleaned up or not after a call to crypto_enqueue_request(). This helper allows to do the cleanup only in the appropriate cases, and all call sites of mv_cesa_queue_req() are fixed to use this new helper function. Reported-by: NVincent Donnefort <vdonnefort@gmail.com> Fixes: db509a45 ("crypto: marvell/cesa - add TDMA support") Cc: <stable@vger.kernel.org> # v4.2+ Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Tested-by: NVincent Donnefort <vdonnefort@gmail.com> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
- 19 6月, 2015 6 次提交
-
-
由 Arnaud Ebalard 提交于
Add support for SHA256 operations. Signed-off-by: NArnaud Ebalard <arno@natisbad.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Arnaud Ebalard 提交于
Add support for MD5 operations. Signed-off-by: NArnaud Ebalard <arno@natisbad.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Arnaud Ebalard 提交于
Add support for Triple-DES operations. Signed-off-by: NArnaud Ebalard <arno@natisbad.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Boris BREZILLON 提交于
Add support for DES operations. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NArnaud Ebalard <arno@natisbad.org> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Boris BREZILLON 提交于
The CESA IP supports CPU offload through a dedicated DMA engine (TDMA) which can control the crypto block. When you use this mode, all the required data (operation metadata and payload data) are transferred using DMA, and the results are retrieved through DMA when possible (hash results are not retrieved through DMA yet), thus reducing the involvement of the CPU and providing better performances in most cases (for small requests, the cost of DMA preparation might exceed the performance gain). Note that some CESA IPs do not embed this dedicated DMA, hence the activation of this feature on a per platform basis. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NArnaud Ebalard <arno@natisbad.org> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Boris BREZILLON 提交于
The existing mv_cesa driver supports some features of the CESA IP but is quite limited, and reworking it to support new features (like involving the TDMA engine to offload the CPU) is almost impossible. This driver has been rewritten from scratch to take those new features into account. This commit introduce the base infrastructure allowing us to add support for DMA optimization. It also includes support for one hash (SHA1) and one cipher (AES) algorithm, and enable those features on the Armada 370 SoC. Other algorithms and platforms will be added later on. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NArnaud Ebalard <arno@natisbad.org> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-