[PATCH v3 00/13] ARM: sun5i: cryptographic engine support

2017-06-01 Thread Antoine Tenart
Hello, This series adds the cryptographic engine support to sun5i SoCs. This is based on top of v4.12-rc1 and was tested on a CHIP. The series begins with fixes and improvements. The series is available at: https://github.com/atenart/linux v4.12-rc1/sun5i-crypto The 8 first patches are reworks an

[PATCH v3 12/13] ARM: sun5i: add a cryptographic engine node

2017-06-01 Thread Antoine Tenart
Add a node for the cryptographic engine that can be found on sun5i SoCs. This cryptographic engine is compatible with the Allwinner cryptographic accelerator driver. Signed-off-by: Antoine Tenart --- arch/arm/boot/dts/sun5i.dtsi | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/a

[PATCH v3 10/13] crypto: sun4i-ss: add the CRYPTO_ALG_KERN_DRIVER_ONLY flag

2017-06-01 Thread Antoine Tenart
The CRYPTO_ALG_KERN_DRIVER_ONLY flag is set for hardware accelerated ciphers accessible through a kernel driver only. This is the case for ciphers exposed by the sun4i-ss driver. This patch sets this flag. Signed-off-by: Antoine Tenart Tested-by: Corentin Labbe Acked-by: Corentin Labbe --- dri

[PATCH v3 11/13] crypto: sun4i-ss: fix large block size support

2017-06-01 Thread Antoine Tenart
The run-time self-tests fail quite early, as soon as the input block size is larger than 64 bytes: alg: hash: Test 4 failed for sha1-sun4i-ss : b9 c9 1e 52 c0 26 d8 39 81 ff f2 3c 99 b1 27 b2 0010: 30 d6 c9 85 One thing to notice is the value of the last word, which is the one e

[PATCH v3 06/13] crypto: sun4i-ss: simplify the pad length calculation

2017-06-01 Thread Antoine Tenart
When sending the last block of data to the engine, it should be padded so that the total length of the request can be given to the engine as the last 2 words of the last 64 bytes block. Simplify the calculation of this pad offset. Signed-off-by: Antoine Tenart Tested-by: Corentin Labbe Acked-by

[PATCH v3 04/13] crypto: sun4i-ss: cannot use DMA is the request is 0 length

2017-06-01 Thread Antoine Tenart
Do not use DMA is the request is 0 length. Signed-off-by: Antoine Tenart Tested-by: Corentin Labbe Acked-by: Corentin Labbe --- drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c b/drivers/crypto/

[PATCH v3 13/13] ARM: dts: sunxi: add SoC specific compatibles for the crypto nodes

2017-06-01 Thread Antoine Tenart
Add SoC specific compatibles for all sunXi crypto nodes, in addition to the one already used (allwinner,sun4i-a10-crypto). Signed-off-by: Antoine Tenart --- arch/arm/boot/dts/sun6i-a31.dtsi | 3 ++- arch/arm/boot/dts/sun7i-a20.dtsi | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff

[PATCH v3 09/13] crypto: sun4i-ss: move from ablkcipher to skcipher API

2017-06-01 Thread Antoine Tenart
Update the sun4i-ss driver to use the skcipher API instead of the old ablkcipher one. It's a bit more tricky than s/ablkcipher/skcipher/, but still nothing special and the driver's logic stays the same. Signed-off-by: Antoine Tenart Tested-by: Corentin Labbe Acked-by: Corentin Labbe --- driver

[PATCH v3 05/13] crypto: sun4i-ss: do not dynamically set parts of the last buffer to 0

2017-06-01 Thread Antoine Tenart
Parts of the bf buffer were dynamically set to 0. Change this to set the whole buffer to 0 by default to avoid any mistake. Signed-off-by: Antoine Tenart Tested-by: Corentin Labbe Acked-by: Corentin Labbe --- drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 3 +-- 1 file changed, 1 insertion(+), 2 de

[PATCH v3 08/13] crypto: sun4i-ss: use GENMASK to generate masks

2017-06-01 Thread Antoine Tenart
Use the GENMASK helper instead of custom calculations to generate masks, It also helps the readability. Signed-off-by: Antoine Tenart Tested-by: Corentin Labbe Acked-by: Corentin Labbe --- drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) d

[PATCH v3 03/13] crypto: sun4i-ss: use lower/upper_32_bits helpers

2017-06-01 Thread Antoine Tenart
Replace custom bit shifts and masks with lower/upper_32_bits helpers. Signed-off-by: Antoine Tenart Tested-by: Corentin Labbe Acked-by: Corentin Labbe --- drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/sun

[PATCH v3 07/13] crypto: sun4i-ss: simplify the appended bit assignment

2017-06-01 Thread Antoine Tenart
A bit is appended at the end of the input buffer for sha1. Simplify the code assigning it. Signed-off-by: Antoine Tenart Tested-by: Corentin Labbe Acked-by: Corentin Labbe --- drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dr

[PATCH v3 02/13] crypto: sun4i-ss: remove conditional checks against 0

2017-06-01 Thread Antoine Tenart
Cosmetic clean up if conditional checks on 0s values. Signed-off-by: Antoine Tenart Tested-by: Corentin Labbe Acked-by: Corentin Labbe --- drivers/crypto/sunxi-ss/sun4i-ss-cipher.c | 28 +++--- drivers/crypto/sunxi-ss/sun4i-ss-core.c | 10 drivers/crypto/sunxi-ss/sun

[PATCH v3 01/13] crypto: sun4i-ss: group variable definitions in sun4i_hash()

2017-06-01 Thread Antoine Tenart
Cosmetic change to avoid having a full screen a variable definitions. It also helps to see which variables share the same type. Signed-off-by: Antoine Tenart Tested-by: Corentin Labbe Acked-by: Corentin Labbe --- drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 31 +++ 1 f

Re: [PATCH v2 01/20] staging: ccree: remove spurious blank lines

2017-06-01 Thread Joe Perches
On Thu, 2017-06-01 at 04:20 -0700, Joe Perches wrote: > On Thu, 2017-06-01 at 14:02 +0300, Gilad Ben-Yossef wrote: > > Remove spurious blanks lines from cc_crypto_ctx.h file > > unrelated trivia: > > > diff --git a/drivers/staging/ccree/cc_crypto_ctx.h > > b/drivers/staging/ccree/cc_crypto_ctx.h

Re: [PATCH v2 01/20] staging: ccree: remove spurious blank lines

2017-06-01 Thread Joe Perches
On Thu, 2017-06-01 at 14:02 +0300, Gilad Ben-Yossef wrote: > Remove spurious blanks lines from cc_crypto_ctx.h file unrelated trivia: > diff --git a/drivers/staging/ccree/cc_crypto_ctx.h > b/drivers/staging/ccree/cc_crypto_ctx.h [] > @@ -208,7 +204,6 @@ struct drv_ctx_generic { > enum drv_

[PATCH v2 01/20] staging: ccree: remove spurious blank lines

2017-06-01 Thread Gilad Ben-Yossef
Remove spurious blanks lines from cc_crypto_ctx.h file Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_crypto_ctx.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/ccree/cc_crypto_ctx.h b/drivers/staging/ccree/cc_crypto_ctx.h index ac39d34..9bfadb21 100644

[PATCH v2 03/20] staging: ccree: fix longer than 80 chars lines

2017-06-01 Thread Gilad Ben-Yossef
Clip longer than 80 chars lines in header files worked on in the patch set. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_crypto_ctx.h | 3 ++- drivers/staging/ccree/cc_regs.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/ccree/cc_cr

[PATCH v2 04/20] staging: ccree: fix operator spacing

2017-06-01 Thread Gilad Ben-Yossef
cc_crypto_ctx.h file had a few macro definitions with missing spaces around operators. Add missing spaces. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_crypto_ctx.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/ccree/cc_crypto_ctx.

[PATCH v2 02/20] staging: ccree: replace bit shift with BIT macro

2017-06-01 Thread Gilad Ben-Yossef
CC_CTX_SIZE was being defined using a hand rolled bit shift operation. Replace with use of BIT macro. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_crypto_ctx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/cc_crypto_ctx.h b/drivers/sta

[PATCH v2 05/20] staging: ccree: fix comments formatting

2017-06-01 Thread Gilad Ben-Yossef
A few of the comments in cc_crypto_ctx.h where not formatted correctly. Format according to coding style guidelines. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_crypto_ctx.h | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/staging/

[PATCH v2 09/20] staging: ccree: refactor LLI access macros

2017-06-01 Thread Gilad Ben-Yossef
The Linked List Item descriptors were being programmed via a set of macros which suffer a few problems: - Use of macros rather than inline leaves out parameter type checking and risks multiple macro parameter evaluation side effects. - Implemented via hand rolled versions of bitfield operations

[PATCH v2 08/20] staging: ccree: remove 48 bit dma addr sim

2017-06-01 Thread Gilad Ben-Yossef
Remove no longer needed code used to simulate 48 bit dma addresses on 32 bit platforms for development purposes. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c| 19 drivers/staging/ccree/ssi_buffer_mgr.c | 83 - drivers/stag

[PATCH v2 12/20] staging: ccree: remove cycle count debug support

2017-06-01 Thread Gilad Ben-Yossef
The ccree driver had support for rough performance debugging via cycle counting which has bit rotted and can easily be replcaed with perf. Remove it from the driver. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_hw_queue_defs.h | 14 drivers/staging/ccree/ssi_aead.c

[PATCH v2 15/20] staging: ccree: remove unused struct

2017-06-01 Thread Gilad Ben-Yossef
struct SepHashPrivateContext is not used anywhere in the code. Remove it. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/hash_defs.h | 17 - 1 file changed, 17 deletions(-) diff --git a/drivers/staging/ccree/hash_defs.h b/drivers/staging/ccree/hash_defs.h index 61389

[PATCH v2 14/20] staging: ccree: remove custom bitfield macros

2017-06-01 Thread Gilad Ben-Yossef
With all users removed or re-factored to use the standard kernel bit fields ops we can now drop the custom bit field macros. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_bitops.h| 39 --- drivers/staging/ccree/cc_hw_queue_defs.h | 2 +- drivers/staging/cc

[PATCH v2 19/20] staging: ccree: remove spurious blank line

2017-06-01 Thread Gilad Ben-Yossef
Remove spurious blank line from cc_regs.h Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_regs.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/ccree/cc_regs.h b/drivers/staging/ccree/cc_regs.h index e83938b..915c863 100644 --- a/drivers/staging/ccree/cc_regs.h +

[PATCH v2 17/20] staging: ccree: drop no longer used macro

2017-06-01 Thread Gilad Ben-Yossef
MSB64 macro is no longer used or needed. Drop it. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_hw_queue_defs.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/ccree/cc_hw_queue_defs.h b/drivers/staging/ccree/cc_hw_queue_defs.h index 1cbd2e1..aaa56c8 100644 -

[PATCH v2 16/20] staging: ccree: use snake_case for hash enums

2017-06-01 Thread Gilad Ben-Yossef
Hash enum were named using CamelCase, move over to snake_case. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_hw_queue_defs.h | 4 ++-- drivers/staging/ccree/hash_defs.h| 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ccree/cc_hw_queu

[PATCH v2 20/20] staging: ccree: fix wrong whitespace usage

2017-06-01 Thread Gilad Ben-Yossef
Some of the register definition files had none kernel coding style usage of tabs vs. spaces in macro definitions. This patch fixes them. Remove some unused macro definitions from hash definitions. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/dx_crys_kernel.h | 308 -

[PATCH v2 18/20] staging: ccree: remove dead code

2017-06-01 Thread Gilad Ben-Yossef
Remove some unused macro definitions from hash definitions. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/hash_defs.h | 31 +++ 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/drivers/staging/ccree/hash_defs.h b/drivers/staging/ccree/hash_d

[PATCH v2 11/20] staging: ccree: remove unused debug macros

2017-06-01 Thread Gilad Ben-Yossef
The DUMP_SGL() and DUMP_MLLI_TABLE() debug macros were defined but not used anywhere and the difference of their definitions for debug vs. none debug indicated this has not being used in a while. Remove the dead code. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c |

[PATCH v2 13/20] staging: ccree: move request_mgr to generic bitfield ops

2017-06-01 Thread Gilad Ben-Yossef
request_mgr was using custom bit field macros. move over to standard kernel bitfield ops. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_regs.h | 5 + drivers/staging/ccree/ssi_request_mgr.c | 25 +++-- 2 files changed, 20 insertions(+), 10 deletion

[PATCH v2 06/20] staging: ccree: add parentheses to macro argument

2017-06-01 Thread Gilad Ben-Yossef
Add parentheses around macro argument to guard against precedence issues. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_crypto_ctx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/cc_crypto_ctx.h b/drivers/staging/ccree/cc_crypto_ctx.h i

[PATCH v2 10/20] staging: ccree: move M/LLI defines to header file

2017-06-01 Thread Gilad Ben-Yossef
A bunch of macros used to define M/LLI descriptors where being defined in the C file. Move them over to private include file where other relevant definitions are stored. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_lli_defs.h| 8 drivers/staging/ccree/ssi_buffer_mgr.

[PATCH v2 00/20] additional driver cleanups

2017-06-01 Thread Gilad Ben-Yossef
This is another batch of clean ups for the ccree driver. Mostly comprised of: - Coding Style fixes - Move to kernel infrastructure from custom constructs - Replace macros with static inline functions - Removal of dead code Changes from v1: - Break up patches better to "do one thing" as indicated b

[-next] crypto: 842 propagate PTR_ERR value instead of -ENOMEM

2017-06-01 Thread Zhang Shengju
It is better to propagate PTR_ERR value instead of a hardcoded value(-ENOMEM here). Signed-off-by: Zhang Shengju --- crypto/842.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/842.c b/crypto/842.c index bc26dc9..6d4f7c7 100644 --- a/crypto/842.c +++ b/crypto/842.c @@