Re: [PATCH][next] crypto: sun8i-ss: Fix memory leak of pad

2021-04-02 Thread Corentin Labbe
418a917 ("crypto: sun8i-ss - support hash algorithms") > Signed-off-by: Colin Ian King > --- Hello Acked-by: Corentin Labbe Tested-by: Corentin Labbe Tested-on: sun8i-a83t-bananapi-m3 Thanks

[PATCH] crypto: allwinner: add missing CRYPTO_ prefix

2021-03-29 Thread Corentin Labbe
Some CONFIG select miss CRYPTO_. Reported-by: Chen-Yu Tsai Fixes: 56f6d5aee88d1 ("crypto: sun8i-ce - support hash algorithms") Fixes: d9b45418a9177 ("crypto: sun8i-ss - support hash algorithms") Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 14 ++

Re: [PATCH] crypto: sun8i-ss: Fix memory leak of object d when dma_iv fails to map

2021-03-08 Thread Corentin Labbe
te(struct crypto_rng *tfm, const > u8 *src, > memcpy(ctx->seed, d + dlen, ctx->slen); > } > memzero_explicit(d, todo); > +err_free: > kfree(d); > > return err; > -- > 2.30.0 > Hello Tested-by: Corentin Labbe Acked-by: Corentin Labbe Thanks

Re: [PATCH] crypto: allwinner: sun8i-ce: fix error return code in sun8i_ce_prng_generate()

2021-03-08 Thread Corentin Labbe
, DMA_TO_DEVICE); > if (dma_mapping_error(ce->dev, dma_iv)) { > dev_err(ce->dev, "Cannot DMA MAP IV\n"); > + err = -EFAULT; > goto err_iv; > } > > -- > 2.17.1 > Hello Tested-by: Corentin Labbe Acked-by: Corentin Labbe Thanks

[PATCH] crypto: sun8i-ss: fix result memory leak on error path

2021-03-02 Thread Corentin Labbe
This patch fixes a memory leak on an error path. Fixes: d9b45418a917 ("crypto: sun8i-ss - support hash algorithms") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 2 +- 1 file changed, 1

Re: [PATCH] crypto: sun8i-ss: Fix memory leak of object d when dma_iv fails to map

2021-03-02 Thread Corentin Labbe
s free'd before the return. > > Addresses-Coverity: ("Resource leak") > Fixes: ac2614d721de ("crypto: sun8i-ss - Add support for the PRNG") > Signed-off-by: Colin Ian King > --- Acked-by: Corentin Labbe Thanks!

[PATCH] crypto: sun8i-ss: fix result memory leak on error path

2021-02-12 Thread Corentin Labbe
This patch fixes a memory leak on an error path. Fixes: d9b45418a917 ("crypto: sun8i-ss - support hash algorithms") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 2 +- 1 file changed, 1

Re: [PATCH 4/4] crypto: allwinner - Fix the parameter of dma_unmap_sg()

2021-02-10 Thread Corentin Labbe
changed, 16 insertions(+), 8 deletions(-) > Hello Acked-by: Corentin LABBE Tested-by: Corentin LABBE Tested-on: sun8i-a83t-bananapi-m3 Tested-on: sun50i-h6-pine-h64 Tested-on: sun50i-h6-orangepi-one-plus Thanks

[PATCH v4 4/8] crypto: sun4i-ss: handle BigEndian for cipher

2020-12-14 Thread Corentin Labbe
Ciphers produce invalid results on BE. Key and IV need to be written in LE. Fixes: 6298e948215f2 ("crypto: sunxi-ss - Add Allwinner Security System crypto accelerator") Cc: Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c | 12 ++-- 1 fi

[PATCH v4 3/8] crypto: sun4i-ss: IV register does not work on A10 and A13

2020-12-14 Thread Corentin Labbe
Signed-off-by: Corentin Labbe --- .../allwinner/sun4i-ss/sun4i-ss-cipher.c | 34 +++ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c index f4979758832

[PATCH v4 7/8] crypto: sun4i-ss: enabled stats via debugfs

2020-12-14 Thread Corentin Labbe
This patch enable to access usage stats for each algorithm. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 9 .../allwinner/sun4i-ss/sun4i-ss-cipher.c | 20 +++ .../crypto/allwinner/sun4i-ss/sun4i-ss-core.c | 52 +++ .../crypto

[PATCH v4 8/8] crypto: sun4i-ss: add SPDX header and remove blank lines

2020-12-14 Thread Corentin Labbe
This patchs fixes some remaining style issue. Signed-off-by: Corentin Labbe Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c | 3 --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-prng.c | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a

[PATCH v4 6/8] crypto: sun4i-ss: fix kmap usage

2020-12-14 Thread Corentin Labbe
t place. Fixes: 6298e948215f ("crypto: sunxi-ss - Add Allwinner Security System crypto accelerator") Signed-off-by: Corentin Labbe --- .../allwinner/sun4i-ss/sun4i-ss-cipher.c | 109 +++--- 1 file changed, 65 insertions(+), 44 deletions(-) diff --git a/drivers/crypto/al

[PATCH v4 5/8] crypto: sun4i-ss: initialize need_fallback

2020-12-14 Thread Corentin Labbe
The need_fallback is never initialized and seem to be always true at runtime. So all hardware operations are always bypassed. Fixes: 0ae1f46c55f87 ("crypto: sun4i-ss - fallback when length is not multiple of blocksize") Cc: Signed-off-by: Corentin Labbe --- drivers/crypto/allwinne

[PATCH v4 2/8] crypto: sun4i-ss: checking sg length is not sufficient

2020-12-14 Thread Corentin Labbe
rypto accelerator") Cc: Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-ciph

[PATCH v4 0/8] crypto: sun4i-ss: prevent always fallback for ciphers

2020-12-14 Thread Corentin Labbe
since v1: - patch #4 is sufficient to fix BE problem (removed todo) Corentin Labbe (8): crypto: sun4i-ss: linearize buffers content must be kept crypto: sun4i-ss: checking sg length is not sufficient crypto: sun4i-ss: IV register does not work on A10 and A13 crypto: sun4i-ss: handle BigEnd

[PATCH v4 1/8] crypto: sun4i-ss: linearize buffers content must be kept

2020-12-14 Thread Corentin Labbe
educe stack usage") Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c | 12 drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h| 2 ++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-c

Re: crypto: sun4i-ss: error with kmap

2020-12-07 Thread Corentin Labbe
On Mon, Dec 07, 2020 at 01:15:49AM +0100, Thomas Gleixner wrote: > On Sun, Dec 06 2020 at 22:40, Corentin Labbe wrote: > > On Sat, Dec 05, 2020 at 08:48:15PM +0100, Thomas Gleixner wrote: > >> So this maps two pages and unmaps the first one. That's all called from > >&

Re: crypto: sun4i-ss: error with kmap

2020-12-06 Thread Corentin Labbe
On Sat, Dec 05, 2020 at 08:48:15PM +0100, Thomas Gleixner wrote: > Corentin, > > On Sat, Dec 05 2020 at 19:43, Corentin Labbe wrote: > > On Fri, Dec 04, 2020 at 09:58:21PM +0100, Thomas Gleixner wrote: > >> Can you please replace the debug patch with the one below and tr

Re: crypto: sun4i-ss: error with kmap

2020-12-05 Thread Corentin Labbe
On Fri, Dec 04, 2020 at 09:58:21PM +0100, Thomas Gleixner wrote: > On Fri, Dec 04 2020 at 20:27, Corentin Labbe wrote: > > On Fri, Dec 04, 2020 at 04:08:27PM +0100, Thomas Gleixner wrote: > >> On Fri, Dec 04 2020 at 14:26, Corentin Labbe wrote: > >> > On Fri, De

Re: crypto: sun4i-ss: error with kmap

2020-12-04 Thread Corentin Labbe
On Fri, Dec 04, 2020 at 04:08:27PM +0100, Thomas Gleixner wrote: > On Fri, Dec 04 2020 at 14:26, Corentin Labbe wrote: > > On Fri, Dec 04, 2020 at 12:34:05AM +0100, Thomas Gleixner wrote: > >> The unmap comes from sg_miter_stop() and looking at the previous > >> map/u

Re: crypto: sun4i-ss: error with kmap

2020-12-04 Thread Corentin Labbe
On Fri, Dec 04, 2020 at 12:34:05AM +0100, Thomas Gleixner wrote: > On Thu, Dec 03 2020 at 18:38, Corentin Labbe wrote: > > On Wed, Dec 02, 2020 at 09:59:36PM +0100, Thomas Gleixner wrote: > >> On Wed, Dec 02 2020 at 20:55, Corentin Labbe wrote: > >> > On Tue, De

Re: crypto: sun4i-ss: error with kmap

2020-12-03 Thread Corentin Labbe
On Wed, Dec 02, 2020 at 09:59:36PM +0100, Thomas Gleixner wrote: > On Wed, Dec 02 2020 at 20:55, Corentin Labbe wrote: > > On Tue, Dec 01, 2020 at 04:15:08PM +0100, Thomas Gleixner wrote: > > > > The result could be seen at http://kernel.montjoie.ovh/129768.log > > The

Re: crypto: sun4i-ss: error with kmap

2020-12-02 Thread Corentin Labbe
On Tue, Dec 01, 2020 at 04:15:08PM +0100, Thomas Gleixner wrote: > On Tue, Dec 01 2020 at 15:45, Corentin Labbe wrote: > > On Tue, Dec 01, 2020 at 03:16:36PM +0100, Thomas Gleixner wrote: > > In fact the warn was a bit later so I added: > >preempt_disab

Re: crypto: sun4i-ss: error with kmap

2020-12-01 Thread Corentin Labbe
On Tue, Dec 01, 2020 at 03:16:36PM +0100, Thomas Gleixner wrote: > On Tue, Dec 01 2020 at 14:52, Corentin Labbe wrote: > > On Tue, Dec 01, 2020 at 02:28:54PM +0100, Thomas Gleixner wrote: > > The patch made the board too busy logging and fail to boot until the test. > > Stup

Re: crypto: sun4i-ss: error with kmap

2020-12-01 Thread Corentin Labbe
On Tue, Dec 01, 2020 at 02:28:54PM +0100, Thomas Gleixner wrote: > On Tue, Dec 01 2020 at 14:01, Corentin Labbe wrote: > > +[ 213.050152] [ cut here ] > > +[ 213.050207] WARNING: CPU: 0 PID: 18430 at mm/highmem.c:581 > > kunmap_loca

crypto: sun4i-ss: error with kmap

2020-12-01 Thread Corentin Labbe
Hello When testing 20201130, I hit this problem: +[ 213.050152] [ cut here ] +[ 213.050207] WARNING: CPU: 0 PID: 18430 at mm/highmem.c:581 kunmap_local_indexed+0x194/0x1d4 +[ 213.050214] Modules linked in: sm4_generic authenc vmac xcbc hmac streebog_generic sm3_generi

[PATCH v3 3/7] crypto: sun4i-ss: IV register does not work on A10 and A13

2020-11-16 Thread Corentin Labbe
Signed-off-by: Corentin Labbe --- .../allwinner/sun4i-ss/sun4i-ss-cipher.c | 34 +++ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c index 4dd736ee5a4

[PATCH v3 6/7] crypto: sun4i-ss: enabled stats via debugfs

2020-11-16 Thread Corentin Labbe
This patch enable to access usage stats for each algorithm. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 9 +++ .../allwinner/sun4i-ss/sun4i-ss-cipher.c | 20 +++ .../crypto/allwinner/sun4i-ss/sun4i-ss-core.c | 56 +++ .../crypto

[PATCH v3 0/7] crypto: sun4i-ss: prevent always fallback for ciphers

2020-11-16 Thread Corentin Labbe
- patch #1: move buf/bufo out of function for reducing stack usage - patch #4: use writesl() - patch #6: use IS_ENABLED instead of #ifdef Changes since v1: - patch #4 is sufficient to fix BE problem (removed todo) Corentin Labbe (7): crypto: sun4i-ss: linearize buffers content must be kept

[PATCH v3 7/7] crypto: sun4i-ss: add SPDX header and remove blank lines

2020-11-16 Thread Corentin Labbe
This patchs fixes some remaining style issue. Signed-off-by: Corentin Labbe Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c | 3 --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-prng.c | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a

[PATCH v3 5/7] crypto: sun4i-ss: initialize need_fallback

2020-11-16 Thread Corentin Labbe
The need_fallback is never initialized and seem to be always true at runtime. So all hardware operations are always bypassed. Fixes: 0ae1f46c55f87 ("crypto: sun4i-ss - fallback when length is not multiple of blocksize") Cc: Signed-off-by: Corentin Labbe --- drivers/crypto/allwinne

[PATCH v3 2/7] crypto: sun4i-ss: checking sg length is not sufficient

2020-11-16 Thread Corentin Labbe
rypto accelerator") Cc: Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-ciph

[PATCH v3 4/7] crypto: sun4i-ss: handle BigEndian for cipher

2020-11-16 Thread Corentin Labbe
Ciphers produce invalid results on BE. Key and IV need to be written in LE. Fixes: 6298e948215f2 ("crypto: sunxi-ss - Add Allwinner Security System crypto accelerator") Cc: Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c | 12 ++-- 1 fi

[PATCH v3 1/7] crypto: sun4i-ss: linearize buffers content must be kept

2020-11-16 Thread Corentin Labbe
educe stack usage") Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c | 12 drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h| 2 ++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-c

[PATCH] crypto: allwinner: sun8i-ce: fix two error path's memory leak

2020-11-15 Thread Corentin Labbe
was an error. Fixes: 56f6d5aee88d ("crypto: sun8i-ce - support hash algorithms") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Corentin Labbe --- .../crypto/allwinner/sun8i-ce/sun8i-ce-hash.c | 20 +++ 1 file changed, 12 insertions(+), 8 dele

Re: [PATCH 2/2] crypto: sun8x-ce*: update entries to its documentation

2020-10-09 Thread Corentin Labbe
/arm/sunxi/README > + * You could find a link for the datasheet in Documentation/arm/sunxi.rst > */ > #include "sun8i-ce.h" > #include > -- > 2.26.2 > Hello Acked-by: Corentin Labbe Thanks

Re: [v2 PATCH] crypto: sun4i-ss - Fix sparse endianness markers

2020-10-07 Thread Corentin Labbe
On Thu, Oct 08, 2020 at 04:52:38PM +1100, Herbert Xu wrote: > On Thu, Sep 24, 2020 at 03:27:38PM +0200, Corentin Labbe wrote: > > > > This is an example on next-20200923+BigEndian > > alg: ahash: sha1 test failed (wrong result) on test vector \"random: > > p

Re: WARNING: at kernel/workqueue.c:1473 __queue_work+0x3b8/0x3d0

2020-10-07 Thread Corentin Labbe
On Mon, Oct 05, 2020 at 01:09:10PM -0400, Daniel Jordan wrote: > On Thu, Oct 01, 2020 at 07:50:22PM +0200, Corentin Labbe wrote: > > On Tue, Mar 03, 2020 at 04:30:17PM -0500, Daniel Jordan wrote: > > > Barring other ideas, Corentin, would you be willing to boot with > >

Re: [PATCH][next] crypto: sun8i-ss - Fix memory leak in sun8i_ss_prng_generate()

2020-10-02 Thread Corentin Labbe
> Hello The label could be better placed just before the kfree. In error case, there are no need to memzero the not used "d". But a patch with it, was already sent to the ML. Anyway if you fix it, you could add "Acked-by: Corentin Labbe " Regards

Re: WARNING: at kernel/workqueue.c:1473 __queue_work+0x3b8/0x3d0

2020-09-25 Thread Corentin Labbe
On Tue, Mar 03, 2020 at 04:31:11PM -0500, Daniel Jordan wrote: > On Tue, Mar 03, 2020 at 08:48:19AM +0100, Corentin Labbe wrote: > > The patch fix the issue. Thanks! > > Thanks for trying it! > > > So you could add: > > Reported-by: Corentin Labbe > > Test

Re: [v2 PATCH] crypto: sun4i-ss - Fix sparse endianness markers

2020-09-24 Thread Corentin Labbe
On Thu, Sep 24, 2020 at 01:08:59PM +1000, Herbert Xu wrote: > On Mon, Sep 14, 2020 at 12:40:58PM +0200, Corentin Labbe wrote: > > > > I got this on next-20200910/multi_v7_defconfig BigEndian > > [ 12.137856] alg: hash: skipping comparison tests for md5-sun4i-ss >

[PATCH v2 7/7] crypto: sun4i-ss: add SPDX header and remove blank lines

2020-09-20 Thread Corentin Labbe
This patchs fixes some remaining style issue. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c | 3 --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-prng.c | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/crypto/allwinner/sun4i-ss

[PATCH v2 6/7] crypto: sun4i-ss: enabled stats via debugfs

2020-09-20 Thread Corentin Labbe
This patch enable to access usage stats for each algorithm. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 9 .../allwinner/sun4i-ss/sun4i-ss-cipher.c | 21 .../crypto/allwinner/sun4i-ss/sun4i-ss-core.c | 54 +++ .../crypto

[PATCH v2 5/7] crypto: sun4i-ss: initialize need_fallback

2020-09-20 Thread Corentin Labbe
The need_fallback is never initialized and seem to be always true at runtime. So all hardware operations are always bypassed. Fixes: 0ae1f46c55f87 ("crypto: sun4i-ss - fallback when length is not multiple of blocksize") Cc: Signed-off-by: Corentin Labbe --- drivers/crypto/allwinne

[PATCH v2 2/7] crypto: sun4i-ss: checking sg length is not sufficient

2020-09-20 Thread Corentin Labbe
rypto accelerator") Cc: Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-ciph

[PATCH v2 4/7] crypto: sun4i-ss: handle BigEndian for cipher

2020-09-20 Thread Corentin Labbe
Ciphers produce invalid results on BE. Key and IV need to be written in LE. Fixes: 6298e948215f2 ("crypto: sunxi-ss - Add Allwinner Security System crypto accelerator") Cc: Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c | 12 ++-- 1 fi

[PATCH v2 0/7] crypto: sun4i-ss: prevent always fallback for ciphers

2020-09-20 Thread Corentin Labbe
1: - patch #4 is sufficient to fix BE problem (removed todo) Corentin Labbe (7): crypto: sun4i-ss: linearize buffers content must be kept crypto: sun4i-ss: checking sg length is not sufficient crypto: sun4i-ss: IV register does not work on A10 and A13 crypto: sun4i-ss: handle BigEndian for cipher

[PATCH v2 3/7] crypto: sun4i-ss: IV register does not work on A10 and A13

2020-09-20 Thread Corentin Labbe
Signed-off-by: Corentin Labbe --- .../allwinner/sun4i-ss/sun4i-ss-cipher.c | 34 +++ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c index 2614640231d

[PATCH v2 1/7] crypto: sun4i-ss: linearize buffers content must be kept

2020-09-20 Thread Corentin Labbe
When running the non-optimized cipher function, SS produce partial random output. This is due to linearize buffers being reseted after each loop. Fixes: 8d3bcb9900ca ("crypto: sun4i-ss - reduce stack usage") Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-s

[PATCH v7 01/17] crypto: sun8i-ss: Add SS_START define

2020-09-18 Thread Corentin Labbe
Instead of using an hardcoded value, let's use a defined value for SS_START. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 2 +- drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --

[PATCH v7 10/17] crypto: sun8i-ce: handle different error registers

2020-09-18 Thread Corentin Labbe
Error registers are different across SoCs. This patch handle those difference. Signed-off-by: Corentin Labbe --- .../crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 62 --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h | 8 +++ 2 files changed, 62 insertions(+), 8 deletions

[PATCH v7 15/17] crypto: sun8i-ce: Add support for the TRNG

2020-09-18 Thread Corentin Labbe
-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 8 ++ drivers/crypto/allwinner/sun8i-ce/Makefile| 1 + .../crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 18 +++ .../crypto/allwinner/sun8i-ce/sun8i-ce-trng.c | 127 ++ drivers/crypto/allwinner/sun8i-ce

[PATCH v7 00/17] crypto: allwinner: add xRNG and hashes

2020-09-18 Thread Corentin Labbe
since v6: - fix sparse error in sun8i-ce-cipher.c Corentin Labbe (17): crypto: sun8i-ss: Add SS_START define crypto: sun8i-ss: Add support for the PRNG crypto: sun8i-ss: support hash algorithms crypto: sun8i-ss: fix a trivial typo crypto: sun8i-ss: Add more comment on some structures

[PATCH v7 08/17] crypto: sun8i-ce: move iv data to request context

2020-09-18 Thread Corentin Labbe
Instead of storing IV data in the channel context, store them in the request context. Storing them in the channel structure was conceptualy wrong since they are per request related. Signed-off-by: Corentin Labbe --- .../allwinner/sun8i-ce/sun8i-ce-cipher.c | 27 +-- drivers

[PATCH v7 11/17] crypto: sun8i-ce: rename has_t_dlen_in_bytes to cipher_t_dlen_in_bytes

2020-09-18 Thread Corentin Labbe
Hash algorithms will need also a spetial t_dlen handling, but since the meaning will be different, rename the current flag to specify it apply only on ciphers algorithms. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c | 2 +- drivers/crypto/allwinner/sun8i

[PATCH v7 09/17] crypto: sun8i-ce: split into prepare/run/unprepare

2020-09-18 Thread Corentin Labbe
This patch split the do_one_request into three. Prepare will handle all DMA mapping and initialisation of the task structure. Unprepare will clean all DMA mapping. And the do_one_request will be limited to just executing the task. Signed-off-by: Corentin Labbe --- .../allwinner/sun8i-ce/sun8i

[PATCH v7 17/17] crypto: sun8i-ss: fix comparison of integer expressions of different signedness

2020-09-18 Thread Corentin Labbe
This patch fixes the warning: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 7 --- 1 file changed, 4 insert

[PATCH v7 13/17] crypto: sun8i-ce: Add stat_bytes debugfs

2020-09-18 Thread Corentin Labbe
This patch adds a new stat_bytes counter in the sun8i-ce debugfs. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h

[PATCH v7 03/17] crypto: sun8i-ss: support hash algorithms

2020-09-18 Thread Corentin Labbe
The SS support multiples hash algorithms, this patch adds support for MD5, SHA1, SHA224 and SHA256. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 9 + drivers/crypto/allwinner/sun8i-ss/Makefile| 1 + .../crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 155

[PATCH v7 16/17] crypto: sun8i-ce: fix comparison of integer expressions of different signedness

2020-09-18 Thread Corentin Labbe
This patch fixes the warning: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 7 --- 1 file changed, 4 insert

[PATCH v7 07/17] crypto: sun8i-ce: handle endianness of t_common_ctl

2020-09-18 Thread Corentin Labbe
t;) Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c index 138759dc8190..08ed1ca12baf 10

[PATCH v7 12/17] crypto: sun8i-ce: support hash algorithms

2020-09-18 Thread Corentin Labbe
The CE support multiples hash algorithms, this patch adds support for MD5, SHA1, SHA224, SHA256, SHA384 and SHA512. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 10 + drivers/crypto/allwinner/sun8i-ce/Makefile| 1 + .../crypto/allwinner/sun8i-ce/sun8i

[PATCH v7 05/17] crypto: sun8i-ss: Add more comment on some structures

2020-09-18 Thread Corentin Labbe
This patch adds some comment on structures used by sun8i-ss. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h index

[PATCH v7 06/17] crypto: sun8i-ss: better debug printing

2020-09-18 Thread Corentin Labbe
This patch reworks the way debug info are printed. Instead of printing raw numbers, let's add a bit of context. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/allw

[PATCH v7 14/17] crypto: sun8i-ce: Add support for the PRNG

2020-09-18 Thread Corentin Labbe
This patch had support for the PRNG present in the CE. The output was tested with rngtest without any failure. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 8 + drivers/crypto/allwinner/sun8i-ce/Makefile| 1 + .../crypto/allwinner/sun8i-ce/sun8i-ce

[PATCH v7 04/17] crypto: sun8i-ss: fix a trivial typo

2020-09-18 Thread Corentin Labbe
This fixes a trivial typo. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h index 377ea7acb54d

[PATCH v7 02/17] crypto: sun8i-ss: Add support for the PRNG

2020-09-18 Thread Corentin Labbe
This patch had support for the PRNG present in the SS. The output was tested with rngtest without any failure. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 8 + drivers/crypto/allwinner/sun8i-ss/Makefile| 1 + .../crypto/allwinner/sun8i-ss/sun8i-ss

[PATCH] crypto: procfs: Removing some useless only space lines

2020-09-17 Thread Corentin Labbe
Some line got only spaces, remove them Signed-off-by: Corentin Labbe --- crypto/proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/proc.c b/crypto/proc.c index 08d8c2bc7e62..12fccb9c5205 100644 --- a/crypto/proc.c +++ b/crypto/proc.c @@ -36,7 +36,7 @@ static

[PATCH 0/7] crypto: sun4i-ss: prevent always fallback for ciphers

2020-09-17 Thread Corentin Labbe
k which is "init" as true everytime. So basicly, since the patch introduced it, this probem hidden some bugs. This serie fixes all hidden problems, then fix the initialization of "need_fallback" and then add the stats like other allwinner drivers. Corentin Labbe (7): crypto

[PATCH 3/7] crypto: sun4i-ss: IV register does not work on A10 and A13

2020-09-17 Thread Corentin Labbe
Signed-off-by: Corentin Labbe --- .../allwinner/sun4i-ss/sun4i-ss-cipher.c | 34 +++ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c index 2614640231d

[PATCH 2/7] crypto: sun4i-ss: checking sg length is not sufficient

2020-09-17 Thread Corentin Labbe
rypto accelerator") Cc: Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-ciph

[PATCH 6/7] crypto: sun4i-ss: enabled stats via debugfs

2020-09-17 Thread Corentin Labbe
This patch enable to access usage stats for each algorithm. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 9 .../allwinner/sun4i-ss/sun4i-ss-cipher.c | 21 .../crypto/allwinner/sun4i-ss/sun4i-ss-core.c | 54 +++ .../crypto

[PATCH 1/7] crypto: sun4i-ss: linearize buffers content must be kept

2020-09-17 Thread Corentin Labbe
When running the non-optimized cipher function, SS produce partial random output. This is due to linearize buffers being reseted after each loop. Fixes: 8d3bcb9900ca ("crypto: sun4i-ss - reduce stack usage") Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-s

[PATCH 4/7] crypto: sun4i-ss: handle BigEndian for cipher

2020-09-17 Thread Corentin Labbe
t;) Cc: Signed-off-by: Corentin Labbe --- .../crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c ind

[PATCH 5/7] crypto: sun4i-ss: initialize need_fallback

2020-09-17 Thread Corentin Labbe
The need_fallback is never initialized and seem to be always true at runtime. So all hardware operations are always bypassed. Fixes: 0ae1f46c55f87 ("crypto: sun4i-ss - fallback when length is not multiple of blocksize") Cc: Signed-off-by: Corentin Labbe --- drivers/crypto/allwinne

[PATCH 7/7] crypto: sun4i-ss: add SPDX header and remove blank lines

2020-09-17 Thread Corentin Labbe
This patchs fixes some remaining style issue. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c | 3 --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-prng.c | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/crypto/allwinner/sun4i-ss

Re: [PATCH v2 4/4] crypto: allwinner/sun8i - Simplify with dev_err_probe()

2020-09-16 Thread Corentin Labbe
) { > - if (PTR_ERR(ss->reset) == -EPROBE_DEFER) > - return PTR_ERR(ss->reset); > - dev_err(&pdev->dev, "No reset control found\n"); > - return PTR_ERR(ss->reset); > - } > + if (IS_ERR(ss->reset)) > + return dev_err_probe(&pdev->dev, PTR_ERR(ss->reset), > + "No reset control found\n"); > > mutex_init(&ss->mlock); > > -- > 2.17.1 > Hello Acked-by: Corentin Labbe Tested-by: Corentin Labbe Thanks

Re: [v2 PATCH] crypto: sun4i-ss - Fix sparse endianness markers

2020-09-14 Thread Corentin Labbe
On Fri, Sep 11, 2020 at 02:13:55PM +1000, Herbert Xu wrote: > On Thu, Sep 10, 2020 at 02:22:48PM +0200, Corentin Labbe wrote: > > > > I get some md5 error on both A20+BE: > > alg: ahash: md5 test failed (wrong result) on test vector \"random: > > psize=129

Re: [v2 PATCH] crypto: sun4i-ss - Fix sparse endianness markers

2020-09-14 Thread Corentin Labbe
On Fri, Sep 11, 2020 at 02:13:55PM +1000, Herbert Xu wrote: > On Thu, Sep 10, 2020 at 02:22:48PM +0200, Corentin Labbe wrote: > > > > I get some md5 error on both A20+BE: > > alg: ahash: md5 test failed (wrong result) on test vector \"random: > > psize=129

Re: [v2 PATCH] crypto: sun4i-ss - Fix sparse endianness markers

2020-09-10 Thread Corentin Labbe
On Tue, Sep 08, 2020 at 03:00:36PM +1000, Herbert Xu wrote: > On Mon, Sep 07, 2020 at 06:00:29PM +0200, Corentin Labbe wrote: > > > > The put_unaligned should be _le32. > > > > This fix the modprobe tcrypt fail. > > Thanks. Yes the original code was correct

[PATCH v3] dt-bindings: crypto: Specify that allwinner,sun8i-a33-crypto needs reset

2020-09-07 Thread Corentin Labbe
When adding allwinner,sun8i-a33-crypto, I forgot to add that it needs reset. Furthermore, there are no need to use items to list only one compatible in compatible list. Fixes: f81547ba7a98 ("dt-bindings: crypto: add new compatible for A33 SS") Signed-off-by: Corentin Labbe --- Chang

Re: [PATCH] crypto: sun4i-ss - Fix SHA1 hash on A33-variant with BE CPU

2020-09-07 Thread Corentin Labbe
On Mon, Sep 07, 2020 at 04:24:00PM +1000, Herbert Xu wrote: > On Sun, Sep 06, 2020 at 04:52:24PM +0800, kernel test robot wrote: > > > > >> drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c:483:35: sparse: > > >> sparse: incorrect type in assignment (different base types) @@ > > >> expected u

Re: [PATCH] crypto: sun4i-ss - Fix SHA1 hash on A33-variant with BE CPU

2020-09-07 Thread Corentin Labbe
On Mon, Sep 07, 2020 at 04:24:00PM +1000, Herbert Xu wrote: > On Sun, Sep 06, 2020 at 04:52:24PM +0800, kernel test robot wrote: > > > > >> drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c:483:35: sparse: > > >> sparse: incorrect type in assignment (different base types) @@ > > >> expected u

Re: [linux-sunxi] Re: [PATCH v6 18/18] crypto: sun8i-ce: fix some style issue

2020-09-07 Thread Corentin Labbe
On Fri, Sep 04, 2020 at 12:37:19PM -0700, Joe Perches wrote: > On Fri, 2020-09-04 at 11:10 +0000, Corentin Labbe wrote: > > This patch fix a double empty line issue reported by checkpatch. > > While at it, since now the maximum line length is now 100, reorder some > > wrappe

[PATCH v6 11/18] crypto: sun8i-ce: rename has_t_dlen_in_bytes to cipher_t_dlen_in_bytes

2020-09-04 Thread Corentin Labbe
Hash algorithms will need also a spetial t_dlen handling, but since the meaning will be different, rename the current flag to specify it apply only on ciphers algorithms. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c | 2 +- drivers/crypto/allwinner/sun8i

[PATCH v6 05/18] crypto: sun8i-ss: Add more comment on some structures

2020-09-04 Thread Corentin Labbe
This patch adds some comment on structures used by sun8i-ss. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h index

[PATCH v6 06/18] crypto: sun8i-ss: better debug printing

2020-09-04 Thread Corentin Labbe
This patch reworks the way debug info are printed. Instead of printing raw numbers, let's add a bit of context. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/allw

[PATCH v6 04/18] crypto: sun8i-ss: fix a trivial typo

2020-09-04 Thread Corentin Labbe
This fixes a trivial typo. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h index 377ea7acb54d

[PATCH v6 15/18] crypto: sun8i-ce: Add support for the TRNG

2020-09-04 Thread Corentin Labbe
-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 8 ++ drivers/crypto/allwinner/sun8i-ce/Makefile| 1 + .../crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 18 +++ .../crypto/allwinner/sun8i-ce/sun8i-ce-trng.c | 127 ++ drivers/crypto/allwinner/sun8i-ce

[PATCH v6 16/18] crypto: sun8i-ce: fix comparison of integer expressions of different signedness

2020-09-04 Thread Corentin Labbe
This patch fixes the warning: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 7 --- 1 file changed, 4 insert

[PATCH v6 07/18] crypto: sun8i-ce: handle endianness of t_common_ctl

2020-09-04 Thread Corentin Labbe
t;) Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c index 138759dc8190..08ed1ca12baf 10

[PATCH v6 14/18] crypto: sun8i-ce: Add support for the PRNG

2020-09-04 Thread Corentin Labbe
This patch had support for the PRNG present in the CE. The output was tested with rngtest without any failure. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 8 + drivers/crypto/allwinner/sun8i-ce/Makefile| 1 + .../crypto/allwinner/sun8i-ce/sun8i-ce

[PATCH v6 17/18] crypto: sun8i-ss: fix comparison of integer expressions of different signedness

2020-09-04 Thread Corentin Labbe
This patch fixes the warning: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 7 --- 1 file changed, 4 insert

[PATCH v6 10/18] crypto: sun8i-ce: handle different error registers

2020-09-04 Thread Corentin Labbe
Error registers are different across SoCs. This patch handle those difference. Signed-off-by: Corentin Labbe --- .../crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 62 --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h | 8 +++ 2 files changed, 62 insertions(+), 8 deletions

[PATCH v6 12/18] crypto: sun8i-ce: support hash algorithms

2020-09-04 Thread Corentin Labbe
The CE support multiples hash algorithms, this patch adds support for MD5, SHA1, SHA224, SHA256, SHA384 and SHA512. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 10 + drivers/crypto/allwinner/sun8i-ce/Makefile| 1 + .../crypto/allwinner/sun8i-ce/sun8i

[PATCH v6 18/18] crypto: sun8i-ce: fix some style issue

2020-09-04 Thread Corentin Labbe
This patch fix a double empty line issue reported by checkpatch. While at it, since now the maximum line length is now 100, reorder some wrapped line. Signed-off-by: Corentin Labbe --- .../allwinner/sun8i-ce/sun8i-ce-cipher.c | 34 ++- .../crypto/allwinner/sun8i-ce/sun8i-ce

[PATCH v6 13/18] crypto: sun8i-ce: Add stat_bytes debugfs

2020-09-04 Thread Corentin Labbe
This patch adds a new stat_bytes counter in the sun8i-ce debugfs. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h

[PATCH v6 09/18] crypto: sun8i-ce: split into prepare/run/unprepare

2020-09-04 Thread Corentin Labbe
This patch split the do_one_request into three. Prepare will handle all DMA mapping and initialisation of the task structure. Unprepare will clean all DMA mapping. And the do_one_request will be limited to just executing the task. Signed-off-by: Corentin Labbe --- .../allwinner/sun8i-ce/sun8i

[PATCH v6 08/18] crypto: sun8i-ce: move iv data to request context

2020-09-04 Thread Corentin Labbe
Instead of storing IV data in the channel context, store them in the request context. Storing them in the channel structure was conceptualy wrong since they are per request related. Signed-off-by: Corentin Labbe --- .../allwinner/sun8i-ce/sun8i-ce-cipher.c | 27 +-- drivers

  1   2   3   4   5   6   >