Re: [7/7] crypto: caam/qi - add ablkcipher and authenc algorithms

2017-04-04 Thread Horia Geantă
On 4/4/2017 8:03 AM, Michael Ellerman wrote: > Horia Geantă <horia.gea...@nxp.com> writes: > >> Add support to submit ablkcipher and authenc algorithms >> via the QI backend: >> -ablkcipher: >> cbc({aes,des,des3_ede}) >> ctr(aes), rfc3686(ctr(aes)) &g

[PATCH] crypto: caam - fix invalid dereference in caam_rsa_init_tfm()

2017-04-03 Thread Horia Geantă
In case caam_jr_alloc() fails, ctx->dev carries the error code, thus accessing it with dev_err() is incorrect. Cc: <sta...@vger.kernel.org> # 4.8+ Fixes: 8c419778ab57e ("crypto: caam - add support for RSA algorithm") Signed-off-by: Horia Geantă <horia.gea...@nxp.com>

[PATCH] crypto: caam - fix JR platform device subsequent (re)creations

2017-04-03 Thread Horia Geantă
somewhere else - not the case for now Fixes: 313ea293e9c4d ("crypto: caam - Add Platform driver for Job Ring") Reported-by: Russell King <rmk+ker...@armlinux.org.uk> Suggested-by: Rob Herring <robh...@kernel.org> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- Not sen

Re: [PATCH] OF: mark released devices as no longer populated

2017-03-31 Thread Horia Geantă
On 3/31/2017 1:40 PM, Russell King - ARM Linux wrote: > Ping, this issue still exists with 4.11-rc4 - and there's been no > reaction from the alleged CAAM maintainers. > Sorry, this somehow slipped through (Cc vs. To, no linux-crypto). > On Tue, Aug 09, 2016 at 11:48:38AM -0500, Rob Herring

[PATCH v2] arm64: dts: ls1012a: add crypto node

2017-03-28 Thread Horia Geantă
LS1012A has a SEC v5.4 security engine. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- v2: move aliases from board specific files into the shared dtsi. arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi | 100 - 1 file changed, 99 insertions(+), 1 deletion(-)

Re: [PATCH] arm64: dts: ls1012a: add crypto node

2017-03-28 Thread Horia Geantă
On 3/24/2017 4:04 PM, Shawn Guo wrote: > On Fri, Mar 24, 2017 at 08:29:17AM +0000, Horia Geantă wrote: >> On 3/24/2017 9:35 AM, Shawn Guo wrote: >>> On Fri, Mar 24, 2017 at 07:17:50AM +, Horia Geantă wrote: >>>>>> +sec_mon: sec_mon@1e9 {

Re: [PATCH] arm64: dts: ls1012a: add crypto node

2017-03-24 Thread Horia Geantă
On 3/24/2017 9:35 AM, Shawn Guo wrote: > On Fri, Mar 24, 2017 at 07:17:50AM +0000, Horia Geantă wrote: >>>> + sec_mon: sec_mon@1e9 { >>> >>> Hyphen is more preferred to be used in node name than underscore. >>> >> This would imply c

Re: [PATCH] arm64: dts: ls1012a: add crypto node

2017-03-24 Thread Horia Geantă
On 3/24/2017 3:56 AM, Shawn Guo wrote: > On Wed, Mar 22, 2017 at 02:29:39PM +0200, Horia Geantă wrote: >> LS1012A has a SEC v5.4 security engine. >> >> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> >> --- >> arch/arm64/boot/dts/freescale/fsl-ls1012a-fr

[PATCH] arm64: dts: ls1012a: add crypto node

2017-03-22 Thread Horia Geantă
LS1012A has a SEC v5.4 security engine. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts | 9 +++ arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts | 9 +++ arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts | 9 +++ arch/arm6

[PATCH 6/7] crypto: caam - add Queue Interface (QI) backend support

2017-03-17 Thread Horia Geantă
ed-off-by: Alex Porosanu <alexandru.poros...@nxp.com> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/Makefile | 4 + drivers/crypto/caam/ctrl.c | 58 ++-- drivers/crypto/caam/intern.h | 24 ++ drivers/crypto/c

[PATCH 7/7] crypto: caam/qi - add ablkcipher and authenc algorithms

2017-03-17 Thread Horia Geantă
dru.poros...@nxp.com> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/Kconfig| 20 +- drivers/crypto/caam/Makefile |1 + drivers/crypto/caam/caamalg.c |9 +- drivers/crypto/caam/caamalg_desc.c | 77 +- drivers/crypto/caam/caamalg_desc.h

[PATCH 5/7] crypto: caam - avoid double inclusion in desc_constr.h

2017-03-17 Thread Horia Geantă
Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/desc_constr.h | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/crypto/caam/desc_constr.h b/drivers/crypto/caam/desc_constr.h index b9c8d98ef826..d8e83ca104e0 100644 --- a/drivers/crypto/caam/desc_co

[PATCH 4/7] soc/qman: add macros needed by caam/qi driver

2017-03-17 Thread Horia Geantă
A few other things need to be added in soc/qman, such that caam/qi won't open-code them. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- include/soc/fsl/qman.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/soc/fsl/qman.h b/include/soc/fsl/qman.h index 0252c3

[PATCH 2/7] soc/qman: add dedicated channel ID for CAAM

2017-03-17 Thread Horia Geantă
Add and export the ID of the channel serviced by the CAAM (Cryptographic Acceleration and Assurance Module) DCP. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/soc/fsl/qbman/qman_ccsr.c | 6 +- include/soc/fsl/qman.h| 3 +++ 2 files changed, 8 insertions

[PATCH 3/7] soc/qman: export non-programmable FQD fields query

2017-03-17 Thread Horia Geantă
Export qman_query_fq_np() function and related structures. This will be needed in the caam/qi driver, where "queue empty" condition will be decided based on the frm_cnt. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/soc/fsl/qbman/qman.c | 4 +-- drive

[PATCH 1/7] soc/qman: export volatile dequeue related structs

2017-03-17 Thread Horia Geantă
Since qman_volatile_dequeue() is already exported, move the related structures into the public header too. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/soc/fsl/qbman/qman_priv.h | 36 include/soc/fsl/qman.h

[PATCH 0/7] crypto: caam - add Queue Interface (QI) support

2017-03-17 Thread Horia Geantă
heir priority is set lower than caam/jr. Thanks, Horia Horia Geantă (7): soc/qman: export volatile dequeue related structs soc/qman: add dedicated channel ID for CAAM soc/qman: export non-programmable FQD fields query soc/qman: add macros needed by caam/qi driver crypto: caam - avoid dou

Re: [RFC 0/7] crypto: caam - add Queue Interface (QI) support

2017-03-16 Thread Horia Geantă
On 3/16/2017 10:43 AM, Herbert Xu wrote: > On Fri, Mar 03, 2017 at 04:52:06PM +0200, Horia Geantă wrote: >> The patchset adds support for CAAM Queue Interface (QI), the additional >> interface (besides job ring) available for submitting jobs to the engine >> on platforms

Re: [PATCH] crypto: testmgr - don't DMA map IV from stack in test_skcipher()

2017-03-08 Thread Horia Geantă
On 1/13/2017 10:46 AM, Herbert Xu wrote: > On Fri, Jan 13, 2017 at 08:59:16AM +0200, Horia Geantă wrote: >> Fix the "DMA-API: device driver maps memory from stack" warning >> generated when crypto accelerators map the IV. >> >> Signed-off-by: Horia Geantă &l

[RFC 1/7] soc/qman: export volatile dequeue related structs

2017-03-03 Thread Horia Geantă
Since qman_volatile_dequeue() is already exported, move the related structures into the public header too. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/soc/fsl/qbman/qman_priv.h | 36 include/soc/fsl/qman.h

[RFC 4/7] soc/qman: add helper functions needed by caam/qi driver

2017-03-03 Thread Horia Geantă
Add helper functions, macros, #defines for accessing / enabling qman functionality from caam/qi driver, such that this driver is not aware of the need for data conversion to big endian. qman is updated to use these helpers internally. Signed-off-by: Horia Geantă <horia.gea...@nxp.

[RFC 3/7] soc/qman: export non-programmable FQD fields query

2017-03-03 Thread Horia Geantă
Export qman_query_fq_np() function and related structures. This will be needed in the caam/qi driver, where "queue empty" condition will be decided based on the frm_cnt. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/soc/fsl/qbman/qman.c | 4 +-- drive

[RFC 2/7] soc/qman: add dedicated channel ID for CAAM

2017-03-03 Thread Horia Geantă
Add and export the ID of the channel serviced by the CAAM (Cryptographic Acceleration and Assurance Module) DCP. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/soc/fsl/qbman/qman_ccsr.c | 6 +- include/soc/fsl/qman.h| 3 +++ 2 files changed, 8 insertions

[RFC 0/7] crypto: caam - add Queue Interface (QI) support

2017-03-03 Thread Horia Geantă
, but I am open to suggestions. Patch 5 adds a missing double inclusion guard in desc_constr.h. Patch 6 adds the caam/qi job submission backend. Patch 7 adds algorithms (ablkcipher and authenc) that run on top of caam/qi. For now, their priority is set lower than caam/jr. Thanks, Horia Horia

[RFC 5/7] crypto: caam - avoid double inclusion in desc_constr.h

2017-03-03 Thread Horia Geantă
Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/desc_constr.h | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/crypto/caam/desc_constr.h b/drivers/crypto/caam/desc_constr.h index b9c8d98ef826..d8e83ca104e0 100644 --- a/drivers/crypto/caam/desc_co

[RFC 7/7] crypto: caam/qi - add ablkcipher and authenc algorithms

2017-03-03 Thread Horia Geantă
dru.poros...@nxp.com> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/Kconfig| 20 +- drivers/crypto/caam/Makefile |1 + drivers/crypto/caam/caamalg.c |9 +- drivers/crypto/caam/caamalg_desc.c | 77 +- drivers/crypto/caam/caamalg_desc.h

[RFC 6/7] crypto: caam - add Queue Interface (QI) backend support

2017-03-03 Thread Horia Geantă
ed-off-by: Alex Porosanu <alexandru.poros...@nxp.com> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/Makefile | 4 + drivers/crypto/caam/ctrl.c | 58 ++-- drivers/crypto/caam/intern.h | 24 ++ drivers/crypto/c

[PATCH 03/12] crypto: caam - fix JR IO mapping if one fails

2017-02-10 Thread Horia Geantă
From: Tudor Ambarus <tudor-dan.amba...@nxp.com> If one of the JRs failed at init, the next JR used the failed JR's IO space. The patch fixes this bug. Signed-off-by: Tudor Ambarus <tudor-dan.amba...@nxp.com> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypt

[PATCH 02/12] crypto: caam - check return code of dma_set_mask_and_coherent()

2017-02-10 Thread Horia Geantă
Setting the dma mask could fail, thus make sure it succeeds before going further. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/ctrl.c | 15 ++- drivers/crypto/caam/jr.c | 19 ++- 2 files changed, 24 insertions(+), 10 deletions(-)

[PATCH 10/12] crypto: caam - fix error path for ctx_dma mapping failure

2017-02-10 Thread Horia Geantă
to: caam - ensure that we clean up after an error") Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamhash.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index 2ad83

[PATCH 11/12] crypto: caam - abstract ahash request double buffering

2017-02-10 Thread Horia Geantă
caamhash uses double buffering for holding previous/current and next chunks (data smaller than block size) to be hashed. Add (inline) functions to abstract this mechanism. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamhash.

[PATCH 06/12] crypto: caam - replace sg_count() with sg_nents_for_len()

2017-02-10 Thread Horia Geantă
in a visible way. req->src is no longer (un)mapped, pointer address is set to 0 in SEQ IN PTR command. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg.c| 189 ++- drivers/crypto/caam/sg_sw_sec4.h | 11 --- 2 file

[PATCH 05/12] crypto: caam - check sg_count() return value

2017-02-10 Thread Horia Geantă
sg_count() internally calls sg_nents_for_len(), which could fail in case the required number of bytes is larger than the total bytes in the S/G. Thus, add checks to validate the input. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg.

[PATCH 09/12] crypto: caam - fix DMA API leaks for multiple setkey() calls

2017-02-10 Thread Horia Geantă
() callbacks and sync_for_device in the setkey() tfm callback. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg.c | 275 +++-- drivers/crypto/caam/caamhash.c | 79 +--- 2 files changed, 102 insertions(+), 252 del

[PATCH 08/12] crypto: caam - don't dma_map key for hash algorithms

2017-02-10 Thread Horia Geantă
Shared descriptors for hash algorithms are small enough for (split) keys to be inlined in all cases. Since driver already does this, all what's left is to remove unused ctx->key_dma. Fixes: 045e36780f115 ("crypto: caam - ahash hmac support") Signed-off-by: Horia Geantă <hori

[PATCH 12/12] crypto: caam - fix state buffer DMA (un)mapping

2017-02-10 Thread Horia Geantă
in most ahash_fin* callbacks (due to current back-to-back implementation of buf_dma unmapping/mapping) Fix these by: -calling dma_mapping_error() on buf_dma right after the mapping and providing an error code if needed -unmapping buf_dma during the "job done" (ahash_done_*) callbacks Signe

[PATCH 07/12] crypto: caam - use dma_map_sg() return code

2017-02-10 Thread Horia Geantă
dma_map_sg() might coalesce S/G entries, so use the number of S/G entries returned by it instead of what sg_nents_for_len() initially returns. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg.c | 133 ++ 1 file chang

[PATCH 00/12] crypto: caam - fixes

2017-02-10 Thread Horia Geantă
I did that for testing purposes, I could notice quite a few problems in caam driver. Thanks, Horia Horia Geantă (11): crypto: caam - don't include unneeded headers crypto: caam - check return code of dma_set_mask_and_coherent() crypto: caam - fix HW S/G in ablkcipher_giv_edesc_alloc

[PATCH] crypto: caam - fix pointer size for AArch64 boot loader, AArch32 kernel

2016-12-05 Thread Horia Geantă
n Wang <alison.w...@nxp.com> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/ctrl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index be62a7f482ac..0a6ca3919270 100644 --- a/d

[PATCH] crypto: caam - fix key pointer size warning

2016-11-29 Thread Horia Geantă
ypto: caam - refactor encryption descriptors generation") Reported-by: kbuild test robot <fengguang...@intel.com> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg_desc.c | 64 +- 1 file changed, 35 insertions(+), 29 del

[PATCH 06/10] crypto: caam - remove unneded dependencies on CRYPTO_DEV_FSL_CAAM

2016-11-22 Thread Horia Geantă
Remove dependency on CRYPTO_DEV_FSL_CAAM where superfluous: depends on CRYPTO_DEV_FSL_CAAM && CRYPTO_DEV_FSL_CAAM_JR is equivalent to depends on CRYPTO_DEV_FSL_CAAM_JR since CRYPTO_DEV_FSL_CAAM_JR depends on CRYPTO_DEV_FSL_CAAM. Signed-off-by: Horia Geantă <horia.gea...@nxp.com>

[PATCH 08/10] crypto: caam - consolidate split key length computation

2016-11-22 Thread Horia Geantă
Move split key length and padded length computation from caamalg.c and caamhash.c to key_gen.c. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg.c | 24 +++-- drivers/crypto/caam/caamhash.c | 24 ++--- drivers/crypt

[PATCH 02/10] crypto: caam - group algorithm related params

2016-11-22 Thread Horia Geantă
In preparation of factoring out the shared descriptors, struct alginfo is introduced to group the algorithm related parameters. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg.c | 394 +- drivers/crypto/caam/caam

[PATCH 10/10] MAINTAINERS: add maintainers for caam crypto driver

2016-11-22 Thread Horia Geantă
Add myself and Dan as maintainers of the caam crypto driver. Cc: Dan Douglass <dan.dougl...@nxp.com> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 1cd38a7e0064..e28aab4

[PATCH 01/10] crypto: caam - move append_key_aead() into init_sh_desc_key_aead()

2016-11-22 Thread Horia Geantă
append_key_aead() is used in only one place, thus inline it. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg.c | 30 -- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/drivers/crypto/caam/caamalg.c b/drivers/

[PATCH 00/10] crypto: caam - shared descriptor generation refactoring

2016-11-22 Thread Horia Geantă
In preparation for the caam/qi (Queue Interface) driver, the generation of the shared descriptors is abstracted and exported. This way the existing caam/jr (Job Ring) and caam/qi drivers will have a common base of descriptors. Thanks, Horia Horia Geantă (10): crypto: caam - move

[PATCH 09/10] crypto: caam - refactor ahash shared descriptor generation

2016-11-22 Thread Horia Geantă
Move ahash shared descriptor generation into a single function. Currently there is no plan to support ahash on any other interface besides the Job Ring, thus for now the functionality is not exported. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamhash.c

[PATCH 04/10] crypto: caam - improve key inlining

2016-11-22 Thread Horia Geantă
, compute only once per tfm the remaining available bytes and decide whether key inlining is possible based on this. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg.c | 130 ++ drivers/crypto/caam/desc_constr.h

[PATCH 05/10] crypto: caam - rewrite some generic inline append cmds

2016-11-22 Thread Horia Geantă
A few descriptor commands are generated using generic inline append "append_cmd" function. Rewrite them using specific inline append functions. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg.c | 20 ++-- drivers/crypto/caam

[PATCH 13/14] crypto: caam - constify pointer to descriptor buffer

2016-11-09 Thread Horia Geantă
The pointer to the descriptor buffer is not touched, it always points to start of the descriptor buffer. Thus, make it const. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/desc_constr.h | 72 +-- 1 file changed, 38 inse

[PATCH 09/14] crypto: caam - remove unreachable code in report_ccb_status()

2016-11-09 Thread Horia Geantă
ERRID is a 4-bit field. Since err_id values are in [0..15] and err_id_list array size is 16, the condition "err_id < ARRAY_SIZE(err_id_list)" is always true. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/error.c | 5 ++--- 1 file changed, 2 inserti

[PATCH 14/14] crypto: caam - merge identical ahash_final/finup shared desc

2016-11-09 Thread Horia Geantă
Shared descriptors used by ahash_final() and ahash_finup() are identical, thus get rid of one of them (sh_desc_finup). Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamhash.c | 26 +- 1 file changed, 1 insertion(+), 25 deletions(-)

[PATCH 08/14] crypto: caam - trivial code clean-up

2016-11-09 Thread Horia Geantă
-replace offsetof with container_of -remove unused "assoc_nents", "iv_dma" from aead_edesc and fix comments -remove unused CAAM_MAX_IV_LENGTH #define Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg.c | 16 drivers/c

[PATCH 06/14] crypto: caam - remove unused may_sleep in dbg_dump_sg()

2016-11-09 Thread Horia Geantă
Fixes: 5ecf8ef9103cb "crypto: caam - fix sg dump" Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam

[PATCH 05/14] crypto: caam - fix smatch warnings

2016-11-09 Thread Horia Geantă
Fix the following smatch warnings: drivers/crypto/caam/caamalg.c:2350 aead_edesc_alloc() warn: we tested 'src_nents' before and it was 'true' drivers/crypto/caam/caamrng.c:351 caam_rng_init() error: no modifiers for allocation. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- d

[PATCH 07/14] crypto: caam - remove unused command from aead givencrypt

2016-11-09 Thread Horia Geantă
REG3 no longer needs to be updated, since it's not used after that. This shared descriptor command is a leftover of the conversion to AEAD interface. Fixes: 479bcc7c5b9e1 "crypto: caam - Convert authenc to new AEAD interface" Signed-off-by: Horia Geantă <horia.gea...@nxp.com> ---

[PATCH 12/14] crypto: caam - move sec4_sg_entry to sg_sw_sec4.h

2016-11-09 Thread Horia Geantă
sec4_sg_entry structure is used only by helper functions in sg_sw_sec4.h. Since SEC HW S/G entries are to be manipulated only indirectly, via these functions, move sec4_sg_entry to the corresponding header. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/

[PATCH 00/14] crypto: caam - fixes, clean-up

2016-11-09 Thread Horia Geantă
This is a batch of fixes and clean-up for caam driver. Only the fix for the givencrypt shared descriptors is high-impact and thus sent to -stable. Thanks, Horia Alex Porosanu (1): crypto: caam - fix AEAD givenc descriptors Horia Geantă (13): crypto: caam - completely remove error

[PATCH 02/14] crypto: caam - completely remove error propagation handling

2016-11-09 Thread Horia Geantă
Commit 4464a7d4f53d756101291da26563f37f7fce40f3 ("crypto: caam - remove error propagation handling") removed error propagation handling only from caamalg. Do this in all other places: caamhash, caamrng. Update descriptors' lengths appropriately. Signed-off-by: Horia Geantă <horia.g

[PATCH 10/14] crypto: caam - fix DMA API mapping leak in ablkcipher code

2016-11-09 Thread Horia Geantă
alkcipher_edesc_alloc() and ablkcipher_giv_edesc_alloc() don't free / unmap resources on error path: - dmap_map_sg() could fail, thus make sure the return value is checked - unmap DMA mappings in case of error Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caa

[PATCH 03/14] crypto: caam - desc.h fixes

2016-11-09 Thread Horia Geantă
N pkha modular arithmetic source mask 5. rename LDST_SRCDST_WORD_CLASS1_ICV_SZ to LDST_SRCDST_WORD_CLASS1_IV_SZ (it refers to IV, not ICV). Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/desc.h | 16 1 file changed, 8 insertions(+), 8 deletions(-)

[PATCH 11/14] Revert "crypto: caam - get rid of tasklet"

2016-11-09 Thread Horia Geantă
t this patch needs to be reverted due to the performance regression, and that there _is_ most definitely a deterimental effect of switching from tasklets to threaded IRQs. [/quote] Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/intern.h | 1 + drivers/crypto/

[PATCH 01/14] crypto: caam - fix AEAD givenc descriptors

2016-11-09 Thread Horia Geantă
: Alex Porosanu <alexandru.poros...@nxp.com> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c index 8de85dfb1b04..5

[PATCH 04/14] crypto: caam - fix sparse warnings

2016-11-09 Thread Horia Geantă
drivers/crypto/caam/jr.c:492:23:got struct caam_job_ring * drivers/crypto/caam/caampkc.c:398:35: warning: Using plain integer as NULL pointer drivers/crypto/caam/caampkc.c:444:35: warning: Using plain integer as NULL pointer Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/

[RFC PATCH] crypto: caam - convert from ablkcipher -> skcipher

2016-08-29 Thread Horia Geantă
(a)blkcipher is being deprecated in favcur of skcipher. The main difference is that IV generation is moved out of crypto algorithms. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- Herbert, The handling of IV generation is blindly following the lines of previous commit: 479bcc

[PATCH v3] crypto: caam - fix IV loading for authenc (giv)decryption

2016-08-29 Thread Horia Geantă
d_givdecrypt() is no longer needed and goes away. Cc: <sta...@vger.kernel.org> # 4.3+ Fixes: 479bcc7c5b9e ("crypto: caam - Convert authenc to new AEAD interface") Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg.c | 77 +

[PATCH v2] crypto: caam - fix IV loading for authenc (giv)decryption

2016-08-26 Thread Horia Geantă
d_givdecrypt() is no longer needed and goes away. Cc: <sta...@vger.kernel.org> # 4.3+ Fixes: 479bcc7c5b9e ("crypto: caam - Convert authenc to new AEAD interface") Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg.c | 77 +

[PATCH] crypto: caam - fix IV loading for authenc (giv)decryption

2016-08-26 Thread Horia Geantă
o: caam - Convert authenc to new AEAD interface") Suggested-by: Herbert Xu <herb...@gondor.apana.org.au> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- Herbert, as you suggested, aead_givdecrypt() is now setting the IV. In terms of optimizations, would it be safe to ass

[PATCH 2/2] crypto: caam - defer aead_set_sh_desc in case of zero authsize

2016-08-04 Thread Horia Geantă
check was incorrectly removed when converting the driver to the new AEAD interface. Cc: <sta...@vger.kernel.org> # 4.3+ Fixes: 479bcc7c5b9e ("crypto: caam - Convert authenc to new AEAD interface") Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caa

[PATCH 1/2] crypto: caam - fix echainiv(authenc) encrypt shared descriptor

2016-08-04 Thread Horia Geantă
ert authenc to new AEAD interface") Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c index ea8189f4b021..e356005a721

[PATCH 0/2] crypto: caam - authenc fixes

2016-08-04 Thread Horia Geantă
. Thanks, Horia Horia Geantă (2): crypto: caam - fix echainiv(authenc) encrypt shared descriptor crypto: caam - defer aead_set_sh_desc in case of zero authsize drivers/crypto/caam/caamalg.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) -- 2.4.4 -- To unsubscribe from

[PATCH v3 0/8] crypto: caam - add support for LS1043A SoC

2016-05-19 Thread Horia Geantă
d, but lead to a bigger performance drop.) Thanks, Horia Cristian Stoica (1): crypto: caam - fix offset field in hw sg entries Horia Geantă (7): asm-generic/io.h: allow barriers in io{read,write}{16,32}be asm-generic/io.h: add io{read,write}64 accessors arm64: add io{read,write}64be accessors

[PATCH v3 2/8] asm-generic/io.h: add io{read,write}64 accessors

2016-05-19 Thread Horia Geantă
This will allow device drivers to consistently use io{read,write}XX also for 64-bit accesses. Acked-by: Arnd Bergmann <a...@arndb.de> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- include/asm-generic/io.h| 63 + include/asm-gen

[PATCH v3 3/8] arm64: add io{read,write}64be accessors

2016-05-19 Thread Horia Geantă
This will allow device drivers to consistently use io{read,write}XXbe also for 64-bit accesses. Acked-by: Catalin Marinas <catalin.mari...@arm.com> Signed-off-by: Alex Porosanu <alexandru.poros...@nxp.com> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- arch/arm64/in

[PATCH v3 7/8] crypto: caam - add ARCH_LAYERSCAPE to supported architectures

2016-05-19 Thread Horia Geantă
This basically adds support for ls1043a platform. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/caam/Kconfig b/drivers/crypto/caam/Kconfig index d2c2909a4020..ff54c4

[PATCH v3 4/8] powerpc: add io{read,write}64 accessors

2016-05-19 Thread Horia Geantă
This will allow device drivers to consistently use io{read,write}XX also for 64-bit accesses. Acked-by: Michael Ellerman <m...@ellerman.id.au> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- arch/powerpc/kernel/iomap.c | 24 1 file changed, 24 inserti

[PATCH v3 5/8] crypto: caam - fix offset field in hw sg entries

2016-05-19 Thread Horia Geantă
From: Cristian Stoica <cristian.sto...@freescale.com> The offset field is 13 bits wide; make sure we don't overwrite more than that in the caam hardware scatter gather structure. Signed-off-by: Cristian Stoica <cristian.sto...@freescale.com> Signed-off-by: Horia Geantă <horia

[PATCH v3 8/8] arm64: dts: ls1043a: add crypto node

2016-05-19 Thread Horia Geantă
LS1043A has a SEC v5.4 security engine. For now don't add rtic or sec_mon subnodes, since these features haven't been tested yet. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- To go into kernel 4.8 via crypto tree. arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts | 4 +++ arch

[PATCH v3 1/8] asm-generic/io.h: allow barriers in io{read,write}{16,32}be

2016-05-19 Thread Horia Geantă
n architectures that don't override the io{read,write}{16,32}be accessors, but it will work correctly on all architectures without them having to override these accessors." Suggested-by: Arnd Bergmann <a...@arndb.de> Acked-by: Arnd Bergmann <a...@arndb.de> Signed-off-by: Horia Geantă <

[RESEND PATCH v2 1/8] asm-generic/io.h: allow barriers in io{read,write}{16,32}be

2016-05-06 Thread Horia Geantă
n architectures that don't override the io{read,write}{16,32}be accessors, but it will work correctly on all architectures without them having to override these accessors." Suggested-by: Arnd Bergmann <a...@arndb.de> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- Herbert, I forgo

[PATCH v2 6/8] crypto: caam - handle core endianness != caam endianness

2016-05-05 Thread Horia Geantă
to take into consideration the endianness of the core when displaying data. Add the necessary glue code so the entries remain the same, but they are properly read, regardless of the core and/or SEC endianness. Note: pdb.h fixes only what is currently being used (IPsec). Signed-off-by: Horia Geantă

[PATCH v2 7/8] crypto: caam - add ARCH_LAYERSCAPE to supported architectures

2016-05-05 Thread Horia Geantă
This basically adds support for ls1043a platform. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/caam/Kconfig b/drivers/crypto/caam/Kconfig index d2c2909a4020..ff54c4

[PATCH v2 8/8] arm64: dts: ls1043a: add crypto node

2016-05-05 Thread Horia Geantă
LS1043A has a SEC v5.4 security engine. For now don't add rtic or sec_mon subnodes, since these features haven't been tested yet. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts | 4 +++ arch/arm64/boot/dts/freescale/fsl-ls1043

[PATCH v2 0/8] crypto: caam - add support for LS1043A SoC

2016-05-05 Thread Horia Geantă
uce device endianness. The performance drop due to the runtime detection is < 1.0%. (An alternative implementation using function pointers has been tried, but lead to a bigger performance drop.) Thanks, Horia Cristian Stoica (1): crypto: caam - fix offset field in hw sg entries Horia Gean

[PATCH v2 4/8] powerpc: add io{read,write}64 accessors

2016-05-05 Thread Horia Geantă
This will allow device drivers to consistently use io{read,write}XX also for 64-bit accesses. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- arch/powerpc/kernel/iomap.c | 24 1 file changed, 24 insertions(+) diff --git a/arch/powerpc/kernel/iomap.c

[PATCH v2 5/8] crypto: caam - fix offset field in hw sg entries

2016-05-05 Thread Horia Geantă
From: Cristian Stoica <cristian.sto...@freescale.com> The offset field is 13 bits wide; make sure we don't overwrite more than that in the caam hardware scatter gather structure. Signed-off-by: Cristian Stoica <cristian.sto...@freescale.com> Signed-off-by: Horia Geantă <horia

[PATCH v2 3/8] arm64: add io{read,write}64be accessors

2016-05-05 Thread Horia Geantă
This will allow device drivers to consistently use io{read,write}XXbe also for 64-bit accesses. Signed-off-by: Alex Porosanu <alexandru.poros...@nxp.com> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- arch/arm64/include/asm/io.h | 4 +++- 1 file changed, 3 insertions(+)

[PATCH v2 2/8] asm-generic/io.h: add io{read,write}64 accessors

2016-05-05 Thread Horia Geantă
This will allow device drivers to consistently use io{read,write}XX also for 64-bit accesses. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- include/asm-generic/io.h| 63 + include/asm-generic/iomap.h | 8 ++ 2 files chang

[PATCH 1/7] asm-generic/io.h: add io{read,write}64 accessors

2016-05-04 Thread Horia Geantă
This will allow device drivers to consistently use io{read,write}XX also for 64-bit accesses. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- include/asm-generic/io.h| 63 + include/asm-generic/iomap.h | 8 ++ 2 files chang

[PATCH 7/7] arm64: dts: ls1043a: add crypto node

2016-05-04 Thread Horia Geantă
LS1043A has a SEC v5.4 security engine. For now don't add rtic or sec_mon subnodes, since these features haven't been tested yet. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts | 4 +++ arch/arm64/boot/dts/freescale/fsl-ls1043

[PATCH 0/7] crypto: caam - add support for LS1043A SoC

2016-05-04 Thread Horia Geantă
ield in hw sg entries Horia Geantă (6): asm-generic/io.h: add io{read,write}64 accessors arm64: add io{read,write}64be accessors powerpc: add io{read,write}64 accessors crypto: caam - handle core endianness != caam endianness crypto: caam - add ARCH_LAYERSCAPE to supported architectures arm64:

[PATCH 6/7] crypto: caam - add ARCH_LAYERSCAPE to supported architectures

2016-05-04 Thread Horia Geantă
This basically adds support for ls1043a platform. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/caam/Kconfig b/drivers/crypto/caam/Kconfig index d2c2909a4020..ff54c4

[PATCH 5/7] crypto: caam - handle core endianness != caam endianness

2016-05-04 Thread Horia Geantă
to take into consideration the endianness of the core when displaying data. Add the necessary glue code so the entries remain the same, but they are properly read, regardless of the core and/or SEC endianness. Note: pdb.h fixes only what is currently being used (IPsec). Signed-off-by: Horia Geantă

[PATCH 4/7] crypto: caam - fix offset field in hw sg entries

2016-05-04 Thread Horia Geantă
From: Cristian Stoica <cristian.sto...@freescale.com> The offset field is 13 bits wide; make sure we don't overwrite more than that in the caam hardware scatter gather structure. Signed-off-by: Cristian Stoica <cristian.sto...@freescale.com> Signed-off-by: Horia Geantă <horia

[PATCH 2/7] arm64: add io{read,write}64be accessors

2016-05-04 Thread Horia Geantă
This will allow device drivers to consistently use io{read,write}XXbe also for 64-bit accesses. Signed-off-by: Alex Porosanu <alexandru.poros...@nxp.com> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- arch/arm64/include/asm/io.h | 4 +++- 1 file changed, 3 insertions(+)

[PATCH] crypto: talitos - fix ahash algorithms registration

2016-04-21 Thread Horia Geantă
Provide hardware state import/export functionality, as mandated by commit 8996eafdcbad ("crypto: ahash - ensure statesize is non-zero") Cc: <sta...@vger.kernel.org> # 4.3+ Reported-by: Jonas Eymann <j.eym...@gmx.net> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> -

[PATCH 1/2] crypto: talitos - fix crash in talitos_cra_init()

2016-04-19 Thread Horia Geantă
nel.org> # 4.3+ Fixes: aeb4c132f33d ("crypto: talitos - Convert to new AEAD interface") Signed-off-by: Jonas Eymann <j.eym...@gmx.net> Fix typo - replaced parameter of __crypto_ahash_alg(): s/tfm/alg Remove checkpatch warnings. Add commit message. Signed-off-by: Horia Geantă <horia.ge

[PATCH 2/2] crypto: talitos - fix AEAD tcrypt tests

2016-04-19 Thread Horia Geantă
nter to the table entries is set. Cc: <sta...@vger.kernel.org> # 4.3+ Fixes: aeb4c132f33d ("crypto: talitos - Convert to new AEAD interface") Reported-by: Jonas Eymann <j.eym...@gmx.net> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --

[PATCH 0/2] crypto: talitos - fix conversion to new AEAD interface

2016-04-19 Thread Horia Geantă
to -stable. (*) Proper fix for hash algorithms registration failures (implementation of import/export functionality) will be added separately. Thannks, Horia Horia Geantă (1): crypto: talitos - fix AEAD tcrypt tests Jonas Eymann (1): crypto: talitos - fix crash in talitos_cra_init() drivers

Re: [PATCH RFC 06/11] crypto: caam: ensure that we clean up after an error

2015-12-09 Thread Horia Geantă
On 12/7/2015 9:12 PM, Russell King wrote: > Ensure that we clean up allocations and DMA mappings after encountering > an error rather than just giving up and leaking memory and resources. > > Signed-off-by: Russell King I guess the error cleanup code should be

<    1   2   3   4   >