aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/apm821xx/patches-4.14/022-0001-crypto-Use-zeroing-memory-allocator-instead-of-alloc.patch
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@gmail.com>2018-04-28 22:08:09 +0200
committerJohn Crispin <john@phrozen.org>2018-05-18 09:14:09 +0200
commit16e39624b728264bd4759580f6292bffefcae466 (patch)
tree1023cbd038a9f71d8b9be71b3ac6411e714313d2 /target/linux/apm821xx/patches-4.14/022-0001-crypto-Use-zeroing-memory-allocator-instead-of-alloc.patch
parente6e51ce87fac2d6b9d082336f8d767f12154d79b (diff)
downloadupstream-16e39624b728264bd4759580f6292bffefcae466.tar.gz
upstream-16e39624b728264bd4759580f6292bffefcae466.tar.bz2
upstream-16e39624b728264bd4759580f6292bffefcae466.zip
apm821xx: backport and reassign crypto4xx patches
This patch backports several patches that went upstream into Herbert Xu's cryptodev-2.6 tree: crypto: Use zeroing memory allocator instead of allocator/memset crypto: crypto4xx - performance optimizations crypto: crypto4xx - convert to skcipher crypto: crypto4xx - avoid VLA use crypto: crypto4xx - add aes-ctr support crypto: crypto4xx - properly set IV after de- and encrypt crypto: crypto4xx - extend aead fallback checks crypto: crypto4xx - put temporary dst sg into request ctx The older, outstanding patches from 120-wxyz series have been upstreamed as well and therefore they have been reassigned to fit into the series. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Diffstat (limited to 'target/linux/apm821xx/patches-4.14/022-0001-crypto-Use-zeroing-memory-allocator-instead-of-alloc.patch')
-rw-r--r--target/linux/apm821xx/patches-4.14/022-0001-crypto-Use-zeroing-memory-allocator-instead-of-alloc.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/target/linux/apm821xx/patches-4.14/022-0001-crypto-Use-zeroing-memory-allocator-instead-of-alloc.patch b/target/linux/apm821xx/patches-4.14/022-0001-crypto-Use-zeroing-memory-allocator-instead-of-alloc.patch
new file mode 100644
index 0000000000..57823fad0c
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/022-0001-crypto-Use-zeroing-memory-allocator-instead-of-alloc.patch
@@ -0,0 +1,39 @@
+From 75d68369b544acc5d14c18a827654dfff248d09d Mon Sep 17 00:00:00 2001
+From: Himanshu Jha <himanshujha199640@gmail.com>
+Date: Sun, 31 Dec 2017 17:54:23 +0530
+Subject: [PATCH 1/8] crypto: Use zeroing memory allocator instead of
+ allocator/memset
+
+Use dma_zalloc_coherent for allocating zeroed
+memory and remove unnecessary memset function.
+
+Done using Coccinelle.
+Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci
+0-day tested with no failures.
+
+Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_core.c | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -282,14 +282,12 @@ static u32 crypto4xx_put_pd_to_pdr(struc
+ */
+ static u32 crypto4xx_build_gdr(struct crypto4xx_device *dev)
+ {
+- dev->gdr = dma_alloc_coherent(dev->core_dev->device,
+- sizeof(struct ce_gd) * PPC4XX_NUM_GD,
+- &dev->gdr_pa, GFP_ATOMIC);
++ dev->gdr = dma_zalloc_coherent(dev->core_dev->device,
++ sizeof(struct ce_gd) * PPC4XX_NUM_GD,
++ &dev->gdr_pa, GFP_ATOMIC);
+ if (!dev->gdr)
+ return -ENOMEM;
+
+- memset(dev->gdr, 0, sizeof(struct ce_gd) * PPC4XX_NUM_GD);
+-
+ return 0;
+ }
+