Re: [PATCH] staging: ccree: remove ccree staging copy

2018-03-12 Thread Gilad Ben-Yossef
On Thu, Mar 8, 2018 at 9:14 AM, Greg Kroah-Hartman wrote: > On Thu, Mar 08, 2018 at 08:44:38AM +0000, Gilad Ben-Yossef wrote: >> Now when the ccree driver has been accepted into the cryptodev tree >> we can remove the staging tree copy. > > Yeah! Nice job. > >> &

Re: [PATCH] staging: ccree: remove ccree staging copy

2018-03-08 Thread Gilad Ben-Yossef
ext meet :-) It's worth mentioning I'll be giving a presentation next week at Embedded Linux Conference US about some of the surprising benefits we got from the process - https://elciotna18.sched.com/event/d47bcefac0cd7dd456ad35d0f6ec9159 Come say hi if you're there. Gilad -- Gila

[PATCH] staging: ccree: remove ccree staging copy

2018-03-08 Thread Gilad Ben-Yossef
trivial. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/Kconfig |2 - drivers/staging/Makefile |1 - drivers/staging/ccree/Kconfig| 27 - drivers/staging/ccree/Makefile |7 - drivers/staging/ccree/TODO | 10

[PATCH v2 5/7] crypto: ccree: add AEAD support

2018-01-22 Thread Gilad Ben-Yossef
Add CryptoCell AEAD support Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/Makefile|2 +- drivers/crypto/ccree/cc_aead.c | 2702 ++ drivers/crypto/ccree/cc_aead.h | 109 ++ drivers/crypto/ccree/cc_buffer_mgr.c | 882

[PATCH v2 4/7] crypto: ccree: add ahash support

2018-01-22 Thread Gilad Ben-Yossef
Add CryptoCell async. hash and HMAC support. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/Makefile|2 +- drivers/crypto/ccree/cc_buffer_mgr.c | 261 +++- drivers/crypto/ccree/cc_driver.c | 13 + drivers/crypto/ccree/cc_driver.h |1 + drivers/crypto/ccree

[PATCH v2 6/7] crypto: ccree: add FIPS support

2018-01-22 Thread Gilad Ben-Yossef
Add FIPS mode support to CryptoCell driver Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/Makefile| 1 + drivers/crypto/ccree/cc_driver.c | 29 +- drivers/crypto/ccree/cc_driver.h | 1 + drivers/crypto/ccree/cc_fips.c | 111

[PATCH v2 3/7] crypto: ccree: add skcipher support

2018-01-22 Thread Gilad Ben-Yossef
Add CryptoCell skcipher support Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/Makefile|2 +- drivers/crypto/ccree/cc_buffer_mgr.c | 125 drivers/crypto/ccree/cc_buffer_mgr.h |8 + drivers/crypto/ccree/cc_cipher.c | 1130

[PATCH v2 2/7] crypto: ccree: introduce CryptoCell driver

2018-01-22 Thread Gilad Ben-Yossef
Introduce basic low level Arm TrustZone CryptoCell HW support. This first patch doesn't actually register any Crypto API transformations, these will follow up in the next patch. This first revision supports the CC 712 REE component. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/Kc

[PATCH v2 7/7] MAINTAINERS: update ccree entry

2018-01-22 Thread Gilad Ben-Yossef
Update Arm TrustZone CryptoCell driver entry move into drivers/crypto/ Signed-off-by: Gilad Ben-Yossef --- MAINTAINERS | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 1082846..560e068 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3273,12

[PATCH v2 0/7] crypto: ccree: Introduce Arm TrustZone CryptoCell

2018-01-22 Thread Gilad Ben-Yossef
functionality (ivgen and secure HW keys), which will be added later. Signed-off-by: Gilad Ben-Yossef Changes from v1: - Use KConfig directive to stop staging tree version to not collide during link time as opposed to deleting it as indicated by Greg KH. - Switched from legacy ablkcipher to

[PATCH v2 1/7] staging: ccree: rename staging ver and mark as broken

2018-01-22 Thread Gilad Ben-Yossef
Rename the Kconfig var of the staging tree version of the driver in preparation of introducing the final version of the driver into the cryptodev tree to avoid link time symbol collisions. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/Kconfig | 4 ++-- drivers/staging/ccree

Re: [PATCH][next] staging: ccree: fix memory leaks in cc_ivgen_init

2018-01-21 Thread Gilad Ben-Yossef
rvdata *drvdata) > goto out; > } > > - drvdata->ivgen_handle = ivgen_ctx; > - > return cc_init_iv_sram(drvdata); > > out: > -- > 2.15.1 > Good catch! Acked-by: Gilad Ben-Yossef Thanks,

Re: [PATCH 3/7] crypto: ccree: add ablkcipher support

2018-01-21 Thread Gilad Ben-Yossef
On Thu, Jan 11, 2018 at 12:03 PM, Stephan Mueller wrote: > Am Donnerstag, 11. Januar 2018, 10:17:10 CET schrieb Gilad Ben-Yossef: > > Hi Gilad, > >> + // verify weak keys >> + if (ctx_p->flow_mode == S_DIN_to_DES) { >> +

Re: [PATCH 3/7] crypto: ccree: add ablkcipher support

2018-01-21 Thread Gilad Ben-Yossef
Hi Corentin, On Thu, Jan 11, 2018 at 12:01 PM, Corentin Labbe wrote: > On Thu, Jan 11, 2018 at 09:17:10AM +0000, Gilad Ben-Yossef wrote: >> Add CryptoCell ablkcipher support >> > > Hello > > I have some minor comments: > > ablkcipher is deprecated, so you need t

Re: Getting the ccree driver out of staging

2018-01-21 Thread Gilad Ben-Yossef
ctx_p->user.key_dma_addr, >370 max_key_buf_size, DMA_TO_DEVICE); >371 ctx_p->keylen = keylen; > 372 > 373 dev_dbg(dev, "return safely"); > ^ > One extra space. > >374 ret

Re: [PATCH -next] staging: ccree: remove redundant dev_err call in init_cc_resources()

2018-01-18 Thread Gilad Ben-Yossef
_drvdata->cc_base)) { > - dev_err(dev, "Failed to ioremap registers"); > + if (IS_ERR(new_drvdata->cc_base)) > return PTR_ERR(new_drvdata->cc_base); > - } > > dev_dbg(dev, "Got MEM resource (%s): %pR\n", req

Re: [PATCH 1/7] staging: ccree: remove ccree from staging tree

2018-01-18 Thread Gilad Ben-Yossef
On Sat, Jan 13, 2018 at 3:21 PM, Greg Kroah-Hartman wrote: > On Thu, Jan 11, 2018 at 09:17:08AM +0000, Gilad Ben-Yossef wrote: >> Remove the ccree driver from the staging tree in preparation to >> introducing it in the crypto tree. >> >> Signed-off-by: Gilad Ben-Yosse

[PATCH 7/7] MAINTAINERS: update ccree entry

2018-01-11 Thread Gilad Ben-Yossef
Update Arm TrustZone CryptoCell driver entry move into drivers/crypto/ Signed-off-by: Gilad Ben-Yossef --- MAINTAINERS | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 1082846..560e068 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3273,12

[PATCH 5/7] crypto: ccree: add AEAD support

2018-01-11 Thread Gilad Ben-Yossef
Add CryptoCell AEAD support Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/Makefile|2 +- drivers/crypto/ccree/cc_aead.c | 2702 ++ drivers/crypto/ccree/cc_aead.h | 109 ++ drivers/crypto/ccree/cc_buffer_mgr.c | 882

[PATCH 6/7] crypto: ccree: add FIPS support

2018-01-11 Thread Gilad Ben-Yossef
Add FIPS mode support to CryptoCell driver Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/Makefile| 1 + drivers/crypto/ccree/cc_driver.c | 29 +- drivers/crypto/ccree/cc_driver.h | 1 + drivers/crypto/ccree/cc_fips.c | 112

[PATCH 2/7] crypto: ccree: introduce CryptoCell driver

2018-01-11 Thread Gilad Ben-Yossef
Introduce basic low level Arm TrustZone CryptoCell HW support. This first patch doesn't actually register any Crypto API transformations, these will follow up in the next patch. This first revision supports the CC 712 REE component. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/Kc

[PATCH 4/7] crypto: ccree: add ahash support

2018-01-11 Thread Gilad Ben-Yossef
Add CryptoCell async. hash and HMAC support. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/Makefile|2 +- drivers/crypto/ccree/cc_buffer_mgr.c | 257 drivers/crypto/ccree/cc_driver.c | 13 + drivers/crypto/ccree/cc_driver.h |1 + drivers/crypto/ccree

[PATCH 3/7] crypto: ccree: add ablkcipher support

2018-01-11 Thread Gilad Ben-Yossef
Add CryptoCell ablkcipher support Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/Makefile|2 +- drivers/crypto/ccree/cc_buffer_mgr.c | 125 drivers/crypto/ccree/cc_buffer_mgr.h | 10 + drivers/crypto/ccree/cc_cipher.c | 1167

[PATCH 1/7] staging: ccree: remove ccree from staging tree

2018-01-11 Thread Gilad Ben-Yossef
Remove the ccree driver from the staging tree in preparation to introducing it in the crypto tree. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/Kconfig|2 - drivers/staging/Makefile |1 - .../devicetree/bindings/crypto/arm

[PATCH 0/7] Introduce Arm TrustZone CryptoCell

2018-01-11 Thread Gilad Ben-Yossef
ity (ivgen and secure HW keys). Signed-off-by: Gilad Ben-Yossef Gilad Ben-Yossef (7): staging: ccree: remove ccree from staging tree crypto: ccree: introduce CryptoCell driver crypto: ccree: add ablkcipher support crypto: ccree: add ahash support crypto: ccree: add AEAD support cry

Re: Getting the ccree driver out of staging

2018-01-10 Thread Gilad Ben-Yossef
On Wed, Jan 10, 2018 at 6:39 PM, Greg Kroah-Hartman wrote: > On Wed, Jan 10, 2018 at 08:54:55AM +0200, Gilad Ben-Yossef wrote: >> Hi folks, >> >> With the enormous help of people in the to and CCed lists I've gotten >> the ccree driver to a point I believe it is

Re: [PATCH v4 2/2] staging: ccree: fixed sparse pointer signedness warnings.

2018-01-10 Thread Gilad Ben-Yossef
pes. > > Signed-off-by: Jeremy Sowden > --- Please run scripts/checkpatch.pl on patches before submission. They have multiple coding style errors. You should probably also read Documentation/process/submitting-patches.rst Thanks, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker "

Re: [PATCH v3] staging: ccree: fixed sparse pointer signedness warnings.

2018-01-10 Thread Gilad Ben-Yossef
On Wed, Jan 10, 2018 at 3:08 PM, Jeremy Sowden wrote: > On 2018-01-10, at 15:03:01 +0200, Gilad Ben-Yossef wrote: >> On Wed, Jan 10, 2018 at 1:53 PM, Jeremy Sowden wrote: >> > The driver uses a mixture of signed and unsigned integer variables >> > for holding arrays

Re: [PATCH v3] staging: ccree: fixed sparse pointer signedness warnings.

2018-01-10 Thread Gilad Ben-Yossef
number of index and length variables from > signed to unsigned integer types. > > * changed the return-types of a couple of functions that return length > values which are assigned to one of these variables from signed to > unsigned integer types. > Other that th

Getting the ccree driver out of staging

2018-01-09 Thread Gilad Ben-Yossef
esult of tcrypt tests. - It works :-) There are obviously more things todo, but I believe they are out of scope for staging. So, if you see something that still needs work, kindly let me know. Alternatively, will you accept a patch moving it to drivers/crypto/? Many thanks, Gilad -- Gilad Ben-Y

[PATCH 5/5] staging: ccree: dma mask is type u64

2018-01-09 Thread Gilad Ben-Yossef
The dma mask var was defined as dma_addr_t but should be u64. This showed as a sparse warning when building for 32 bit. Fix it by changing type to u64 and drop the cast. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH 4/5] staging: ccree: make stub function static inline

2018-01-09 Thread Gilad Ben-Yossef
The debugfs interface defines stub function if debugfs is not enabled, which were missing the 'static inline' qualifiers causing sparse warnings. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_debugfs.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) di

[PATCH 1/5] staging: ccree: use a consistent file naming convention

2018-01-09 Thread Gilad Ben-Yossef
The ccree driver source files were using an inconsistent naming convention stemming from what the company was called when they were added. Move to a single consistent naming convention for better code readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/Makefile

[PATCH 3/5] staging: ccree: add missing include

2018-01-09 Thread Gilad Ben-Yossef
Add the missing include of include file with function declarations. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_debugfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/ccree/cc_debugfs.c b/drivers/staging/ccree/cc_debugfs.c index f927a73..08f8db4 100644

[PATCH 0/5] more cleanups

2018-01-09 Thread Gilad Ben-Yossef
File name consistency renames, include files diet and address some sparse warnings. Gilad Ben-Yossef (5): staging: ccree: use a consistent file naming convention staging: ccree: remove unneeded includes staging: ccree: add missing include staging: ccree: make stub function static inline

[PATCH 2/5] staging: ccree: remove unneeded includes

2018-01-09 Thread Gilad Ben-Yossef
Remove include files not needed for compilation. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_aead.c| 7 --- drivers/staging/ccree/cc_buffer_mgr.c | 6 -- drivers/staging/ccree/cc_cipher.c | 4 drivers/staging/ccree/cc_driver.c | 31

Re: [PATCH v3 24/27] staging: ccree: use a consistent file naming convention

2018-01-08 Thread Gilad Ben-Yossef
On Mon, Jan 8, 2018 at 5:28 PM, Greg Kroah-Hartman wrote: > On Sun, Jan 07, 2018 at 12:14:35PM +0000, Gilad Ben-Yossef wrote: >> The ccree driver source files were using an inconsistent >> naming convention stemming from what the company was called >> when they were added. &

[PATCH v3 27/27] staging: ccree: add missing include

2018-01-07 Thread Gilad Ben-Yossef
Add the missing include of include file with function declarations. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_debugfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/ccree/cc_debugfs.c b/drivers/staging/ccree/cc_debugfs.c index f927a73..08f8db4 100644

[PATCH v3 26/27] staging: ccree: update TODO

2018-01-07 Thread Gilad Ben-Yossef
Update TODO to reflect work done Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/TODO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/TODO b/drivers/staging/ccree/TODO index 6d8702b..b8e163d 100644 --- a/drivers/staging/ccree/TODO +++ b

[PATCH v3 22/27] staging: ccree: put pointer next to var name

2018-01-07 Thread Gilad Ben-Yossef
Put pointer next to var name as per coding style. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_request_mgr.c b/drivers/staging/ccree/ssi_request_mgr.c index 78f25e5

[PATCH v3 25/27] staging: ccree: remove unneeded includes

2018-01-07 Thread Gilad Ben-Yossef
Remove include files not needed for compilation. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_aead.c| 7 --- drivers/staging/ccree/cc_buffer_mgr.c | 6 -- drivers/staging/ccree/cc_cipher.c | 4 drivers/staging/ccree/cc_driver.c | 31

[PATCH v3 20/27] staging: ccree: fix indentation of func params

2018-01-07 Thread Gilad Ben-Yossef
Fix indentation of some function params in hash code for better readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 46 +--- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c b

[PATCH v3 21/27] staging: ccree: fold common code into service func

2018-01-07 Thread Gilad Ben-Yossef
Fold common code in hash call into service functions. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 339 ++- 1 file changed, 116 insertions(+), 223 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree

[PATCH v3 23/27] stating: ccree: fix allocation of void sized buf

2018-01-07 Thread Gilad Ben-Yossef
We were allocating buffers using sizeof(*struct->field) where field was type void. Fix it by having a local variable with the real type. Cc: sta...@vger.kernel.org Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_ivgen.c| 9 - drivers/staging/ccree/ssi_sram_mgr.c

[PATCH v3 17/27] staging: ccree: use array for double buffer

2018-01-07 Thread Gilad Ben-Yossef
The ccree hash code is using a double buffer to hold data for processing but manages the buffers and their associated data count in two separate fields and uses a predicate to chose which to use. Move to using a proper 2 members array for a much cleaner code. Signed-off-by: Gilad Ben-Yossef

[PATCH v3 18/27] staging: ccree: allocate hash bufs inside req ctx

2018-01-07 Thread Gilad Ben-Yossef
Move to allocating the buffers needed for requests as part of the request structure instead of malloc'ing each one on it's own, making for simpler (and more efficient) code. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_h

[PATCH v3 19/27] staging: ccree: do not map bufs in ahash_init

2018-01-07 Thread Gilad Ben-Yossef
API op. This also properly deals with hash_import() not knowing if hash_init was called or not as it now no longer matters. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 192 +-- 1 file changed, 103 insertions(+), 89 deletions(-) diff

[PATCH v3 16/27] staging: ccree: remove unused field

2018-01-07 Thread Gilad Ben-Yossef
Remove unused struct field. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c index ee7370c..efea792 100644 --- a/drivers/staging/ccree/ssi_hash.c +++ b

[PATCH v3 14/27] staging: ccree: handle end of sg list gracefully

2018-01-07 Thread Gilad Ben-Yossef
If we are asked for number of entries of an offset bigger than the sg list we should not crash. Cc: sta...@vger.kernel.org Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree

[PATCH v3 15/27] staging: ccree: use Makefile to include PM code

2018-01-07 Thread Gilad Ben-Yossef
Replace ugly ifdefs with some inline macros and Makefile magic for optionally including power management related code for better readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/Makefile | 3 ++- drivers/staging/ccree/ssi_pm.c | 9 +--- drivers

[PATCH v3 13/27] staging: ccree: check DMA pool buf !NULL before free

2018-01-07 Thread Gilad Ben-Yossef
If we ran out of DMA pool buffers, we get into the unmap code path with a NULL before. Deal with this by checking the virtual mapping is not NULL. Cc: sta...@vger.kernel.org Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH v3 11/27] stating: ccree: revert "staging: ccree: fix leak of import() after init()"

2018-01-07 Thread Gilad Ben-Yossef
me at the time. Cc: sta...@vger.kernel.org Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c index ff05ac8..ee7370c 100644 -

[PATCH v3 12/27] staging: ccree: failing the suspend is not an error

2018-01-07 Thread Gilad Ben-Yossef
PM suspend returning a none zero value is not an error. It simply indicates a suspend is not advised right now so don't treat it as an error. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --

[PATCH v3 10/27] staging: ccree: add backlog processing

2018-01-07 Thread Gilad Ben-Yossef
Crypto API tfm providers are required to provide a backlog service, if so indicated, that queues up requests in the case of the provider being busy and processing them later. The ccree driver did not provide this facility. Add it now. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree

[PATCH v3 06/27] staging: ccree: copy larval digest from RAM

2018-01-07 Thread Gilad Ben-Yossef
The ccree driver was using a DMA operation to copy larval digest from the ccree SRAM to RAM. Replace it with a simple memcpy. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_driver.c | 2 + drivers/staging/ccree/ssi_hash.c | 121 - drivers

[PATCH v3 09/27] staging: ccree: break send_request and fix ret val

2018-01-07 Thread Gilad Ben-Yossef
common internal service function and return error instead of sleeping for the asynchronous case. The next patch will complete the fix by implementing proper backlog handling. Fixes: abefd6741d ("staging: ccree: introduce CryptoCell HW driver"). Signed-off-by: Gilad Ben-Yossef --- drive

[PATCH v3 07/27] staging: ccree: tag debugfs init/exit func properly

2018-01-07 Thread Gilad Ben-Yossef
The debugfs global init and exit functions were missing __init and __exit tags, potentially wasting memory. Fix it by properly tagging them. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH v3 08/27] staging: ccree: remove unused leftover field

2018-01-07 Thread Gilad Ben-Yossef
Remove the unused monitor_desc field. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_request_mgr.c b/drivers/staging/ccree/ssi_request_mgr.c index 7686e14..e1c01da 100644 --- a/drivers

[PATCH v3 04/27] staging: ccree: remove GFP_DMA flag from mem allocs

2018-01-07 Thread Gilad Ben-Yossef
Remove bogus GFP_DMA flag from memory allocations. ccree driver does not operate over an ISA or similar limited bus. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_cipher.c | 2 +- drivers/staging/ccree/ssi_hash.c | 15 ++- 2 files changed, 7 insertions(+), 10

[PATCH v3 03/27] staging: ccree: fold reg common defines into driver

2018-01-07 Thread Gilad Ben-Yossef
Fold the 2 macro defined in dx_reg_common.h into the file they are used in and delete the file. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_crypto_ctx.h | 4 ++-- drivers/staging/ccree/dx_reg_common.h | 13 - drivers/staging/ccree/ssi_driver.h| 5 +++-- 3

[PATCH v3 05/27] staging: ccree: pick alloc mem flags based on req flags

2018-01-07 Thread Gilad Ben-Yossef
The ccree driver was allocating memory using GFP_KERNEL flag always, ignoring the flags set in the crypto request. Fix it by choosing gfp flags based on crypto request flags. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 19 +++-- drivers/staging/ccree

[PATCH v3 01/27] staging: ccree: SPDXify driver

2018-01-07 Thread Gilad Ben-Yossef
Replace verbatim GPL v2 copy with SPDX tag. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/Kconfig| 2 ++ drivers/staging/ccree/Makefile | 2 ++ drivers/staging/ccree/cc_crypto_ctx.h| 17 ++--- drivers/staging/ccree/cc_debugfs.c | 17

[PATCH v3 02/27] staging: ccree: fold hash defs into queue defs

2018-01-07 Thread Gilad Ben-Yossef
Fold the two remaining enum in hash defs into the queue defs that are using them and delete the hash defs include file. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_hw_queue_defs.h | 13 + drivers/staging/ccree/hash_defs.h| 23 --- drivers

[PATCH v3 00/27] staging: ccree: fixes and cleanups

2018-01-07 Thread Gilad Ben-Yossef
know about that keeps it from moving out of staging to the best of my understanding and would like to ask for a review before moving out of staging. Signed-off-by: Gilad Ben-Yossef Changes from v2: - Revert to SPDX-2.0 license tags as the kernel tools are not ready yet for 3.0 Changes from v1: -

Re: [PATCH] staging: ccree: shorten lengthy lines with breaks

2018-01-07 Thread Gilad Ben-Yossef
Hi George, On Sat, Jan 6, 2018 at 5:47 PM, George Edward Bulmer wrote: > This fixes five instances of checkpatch warning: > WARNING: line over 80 characters > Thank you for the patch. > Signed-off-by: George Edward Bulmer > --- > drivers/staging/ccree/ssi_sysfs.c | 21 - >

Re: [PATCH v2 01/27] staging: ccree: SPDXify driver

2018-01-07 Thread Gilad Ben-Yossef
On Wed, Jan 3, 2018 at 5:01 PM, Philippe Ombredanne wrote: > Gilad, > > On Wed, Jan 3, 2018 at 2:35 PM, Gilad Ben-Yossef wrote: >> Replace verbatim GPL v2 copy with SPDX tag. >> >> Signed-off-by: Gilad Ben-Yossef > > > >> --- a/drivers/staging/ccre

[PATCH v2 27/27] staging: ccree: add missing include

2018-01-03 Thread Gilad Ben-Yossef
Add the missing include of include file with function declarations. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_debugfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/ccree/cc_debugfs.c b/drivers/staging/ccree/cc_debugfs.c index 363a0ef..e07cbb1 100644

[PATCH v2 26/27] staging: ccree: update TODO

2018-01-03 Thread Gilad Ben-Yossef
Update TODO to reflect work done Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/TODO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/TODO b/drivers/staging/ccree/TODO index 6d8702b..b8e163d 100644 --- a/drivers/staging/ccree/TODO +++ b

[PATCH v2 25/27] staging: ccree: remove unneeded includes

2018-01-03 Thread Gilad Ben-Yossef
Remove include files not needed for compilation. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_aead.c| 7 --- drivers/staging/ccree/cc_buffer_mgr.c | 6 -- drivers/staging/ccree/cc_cipher.c | 4 drivers/staging/ccree/cc_driver.c | 31

[PATCH v2 23/27] stating: ccree: fix allocation of void sized buf

2018-01-03 Thread Gilad Ben-Yossef
We were allocating buffers using sizeof(*struct->field) where field was type void. Fix it by having a local variable with the real type. Cc: sta...@vger.kernel.org Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_ivgen.c| 9 - drivers/staging/ccree/ssi_sram_mgr.c

[PATCH v2 22/27] staging: ccree: put pointer next to var name

2018-01-03 Thread Gilad Ben-Yossef
Put pointer next to var name as per coding style. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_request_mgr.c b/drivers/staging/ccree/ssi_request_mgr.c index 01f4756

[PATCH v2 21/27] staging: ccree: fold common code into service func

2018-01-03 Thread Gilad Ben-Yossef
Fold common code in hash call into service functions. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 339 ++- 1 file changed, 116 insertions(+), 223 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree

[PATCH v2 20/27] staging: ccree: fix indentation of func params

2018-01-03 Thread Gilad Ben-Yossef
Fix indentation of some function params in hash code for better readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 46 +--- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c b

[PATCH v2 19/27] staging: ccree: do not map bufs in ahash_init

2018-01-03 Thread Gilad Ben-Yossef
API op. This also properly deals with hash_import() not knowing if hash_init was called or not as it now no longer matters. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 192 +-- 1 file changed, 103 insertions(+), 89 deletions(-) diff

[PATCH v2 18/27] staging: ccree: allocate hash bufs inside req ctx

2018-01-03 Thread Gilad Ben-Yossef
Move to allocating the buffers needed for requests as part of the request structure instead of malloc'ing each one on it's own, making for simpler (and more efficient) code. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_h

[PATCH v2 17/27] staging: ccree: use array for double buffer

2018-01-03 Thread Gilad Ben-Yossef
The ccree hash code is using a double buffer to hold data for processing but manages the buffers and their associated data count in two separate fields and uses a predicate to chose which to use. Move to using a proper 2 members array for a much cleaner code. Signed-off-by: Gilad Ben-Yossef

[PATCH v2 16/27] staging: ccree: remove unused field

2018-01-03 Thread Gilad Ben-Yossef
Remove unused struct field. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c index e05c87d..4e11b5d 100644 --- a/drivers/staging/ccree/ssi_hash.c +++ b

[PATCH v2 15/27] staging: ccree: use Makefile to include PM code

2018-01-03 Thread Gilad Ben-Yossef
Replace ugly ifdefs with some inline macros and Makefile magic for optionally including power management related code for better readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/Makefile | 3 ++- drivers/staging/ccree/ssi_pm.c | 9 +--- drivers

[PATCH v2 11/27] stating: ccree: revert "staging: ccree: fix leak of import() after init()"

2018-01-03 Thread Gilad Ben-Yossef
me at the time. Cc: sta...@vger.kernel.org Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c index ffcd1f0..e05c87d 100644 -

[PATCH v2 13/27] staging: ccree: check DMA pool buf !NULL before free

2018-01-03 Thread Gilad Ben-Yossef
If we ran out of DMA pool buffers, we get into the unmap code path with a NULL before. Deal with this by checking the virtual mapping is not NULL. Cc: sta...@vger.kernel.org Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH v2 14/27] staging: ccree: handle end of sg list gracefully

2018-01-03 Thread Gilad Ben-Yossef
If we are asked for number of entries of an offset bigger than the sg list we should not crash. Cc: sta...@vger.kernel.org Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree

[PATCH v2 10/27] staging: ccree: add backlog processing

2018-01-03 Thread Gilad Ben-Yossef
Crypto API tfm providers are required to provide a backlog service, if so indicated, that queues up requests in the case of the provider being busy and processing them later. The ccree driver did not provide this facility. Add it now. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree

[PATCH v2 12/27] staging: ccree: failing the suspend is not an error

2018-01-03 Thread Gilad Ben-Yossef
PM suspend returning a none zero value is not an error. It simply indicates a suspend is not advised right now so don't treat it as an error. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --

[PATCH v2 09/27] staging: ccree: break send_request and fix ret val

2018-01-03 Thread Gilad Ben-Yossef
common internal service function and return error instead of sleeping for the asynchronous case. The next patch will complete the fix by implementing proper backlog handling. Fixes: abefd6741d ("staging: ccree: introduce CryptoCell HW driver"). Signed-off-by: Gilad Ben-Yossef --- drive

[PATCH v2 07/27] staging: ccree: tag debugfs init/exit func properly

2018-01-03 Thread Gilad Ben-Yossef
The debugfs global init and exit functions were missing __init and __exit tags, potentially wasting memory. Fix it by properly tagging them. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH v2 08/27] staging: ccree: remove unused leftover field

2018-01-03 Thread Gilad Ben-Yossef
Remove the unused monitor_desc field. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_request_mgr.c b/drivers/staging/ccree/ssi_request_mgr.c index ac6846f..18e2e1d 100644 --- a/drivers

[PATCH v2 06/27] staging: ccree: copy larval digest from RAM

2018-01-03 Thread Gilad Ben-Yossef
The ccree driver was using a DMA operation to copy larval digest from the ccree SRAM to RAM. Replace it with a simple memcpy. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_driver.c | 2 + drivers/staging/ccree/ssi_hash.c | 121 - drivers

[PATCH v2 04/27] staging: ccree: remove GFP_DMA flag from mem allocs

2018-01-03 Thread Gilad Ben-Yossef
Remove bogus GFP_DMA flag from memory allocations. ccree driver does not operate over an ISA or similar limited bus. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_cipher.c | 2 +- drivers/staging/ccree/ssi_hash.c | 15 ++- 2 files changed, 7 insertions(+), 10

[PATCH v2 05/27] staging: ccree: pick alloc mem flags based on req flags

2018-01-03 Thread Gilad Ben-Yossef
The ccree driver was allocating memory using GFP_KERNEL flag always, ignoring the flags set in the crypto request. Fix it by choosing gfp flags based on crypto request flags. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 19 +++-- drivers/staging/ccree

[PATCH v2 02/27] staging: ccree: fold hash defs into queue defs

2018-01-03 Thread Gilad Ben-Yossef
Fold the two remaining enum in hash defs into the queue defs that are using them and delete the hash defs include file. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_hw_queue_defs.h | 13 + drivers/staging/ccree/hash_defs.h| 23 --- drivers

[PATCH v2 03/27] staging: ccree: fold reg common defines into driver

2018-01-03 Thread Gilad Ben-Yossef
Fold the 2 macro defined in dx_reg_common.h into the file they are used in and delete the file. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_crypto_ctx.h | 4 ++-- drivers/staging/ccree/dx_reg_common.h | 13 - drivers/staging/ccree/ssi_driver.h| 5 +++-- 3

[PATCH v2 01/27] staging: ccree: SPDXify driver

2018-01-03 Thread Gilad Ben-Yossef
Replace verbatim GPL v2 copy with SPDX tag. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/Kconfig| 2 ++ drivers/staging/ccree/Makefile | 2 ++ drivers/staging/ccree/cc_crypto_ctx.h| 17 ++--- drivers/staging/ccree/cc_debugfs.c | 17

[PATCH v2 00/27] staging: ccree: fixes and cleanups

2018-01-03 Thread Gilad Ben-Yossef
know about that keeps it from moving out of staging to the best of my understanding and would like to ask for a review before moving out of staging. Thanks and happy new year ;-) Signed-off-by: Gilad Ben-Yossef Changes from v1: - Fixed wrong use of CPP style comments in SPDX include file heade

Re: [PATCH] staging: ccree: mark debug_regs[] as static

2018-01-03 Thread Gilad Ben-Yossef
ic struct debugfs_reg32 debug_regs[] = { > CC_DEBUG_REG(HOST_SIGNATURE), > CC_DEBUG_REG(HOST_IRR), > CC_DEBUG_REG(HOST_POWER_DOWN_EN), > -- > 2.9.0 > Thank you Arnd. I ran into this issue myself via a sparse check (I did not have s3cmci compiled in) and was sur

Re: [PATCH 01/26] staging: ccree: SPDXify driver

2018-01-01 Thread Gilad Ben-Yossef
On Mon, Jan 1, 2018 at 3:53 PM, Philippe Ombredanne wrote: > Gilad, > > On Mon, Jan 1, 2018 at 1:06 PM, Gilad Ben-Yossef wrote: >> Replace verbatim GPL v2 copy with SPDX tag. >> >> Signed-off-by: Gilad Ben-Yossef > > > >> --- a/drivers/staging/ccre

[PATCH 26/26] staging: ccree: update TODO

2018-01-01 Thread Gilad Ben-Yossef
Update TODO to reflect work done Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/TODO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/TODO b/drivers/staging/ccree/TODO index 6d8702b..b8e163d 100644 --- a/drivers/staging/ccree/TODO +++ b

[PATCH 25/26] staging: ccree: remove unneeded includes

2018-01-01 Thread Gilad Ben-Yossef
Remove include files not needed for compilation. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_aead.c| 7 --- drivers/staging/ccree/cc_buffer_mgr.c | 6 -- drivers/staging/ccree/cc_cipher.c | 4 drivers/staging/ccree/cc_driver.c | 31

[PATCH 22/26] staging: ccree: put pointer next to var name

2018-01-01 Thread Gilad Ben-Yossef
Put pointer next to var name as per coding style. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_request_mgr.c b/drivers/staging/ccree/ssi_request_mgr.c index b71200a

[PATCH 23/26] stating: ccree: fix allocation of void sized buf

2018-01-01 Thread Gilad Ben-Yossef
We were allocating buffers using sizeof(*struct->field) where field was type void. Fix it by having a local variable with the real type. Cc: sta...@vger.kernel.org Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_debugfs.c | 3 ++- drivers/staging/ccree/ssi_ivgen.c

[PATCH 21/26] staging: ccree: fold common code into service func

2018-01-01 Thread Gilad Ben-Yossef
Fold common code in hash call into service functions. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 339 ++- 1 file changed, 116 insertions(+), 223 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree

  1   2   3   4   5   6   >