[PATCH next 1/2] crypto: atmel-sha: fix missing "return" instructions

2017-02-09 Thread Cyrille Pitchen
le call of "atmel_sha_complete(dd, -EINVAL);". Hence all "return" instructions were missing. Reported-by: Dan Carpenter Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/cry

[PATCH next 0/2] crypto: atmel-sha: fix error management

2017-02-09 Thread Cyrille Pitchen
sha_hw_init(dd); if (err) goto err1; [...] err1: if (err != -EINPROGRESS) /* done_task will not finish it, so do it here */ atmel_sha_finish_req(req, err); Best regards, Cyrille Cyrille Pitchen (2): crypto: atmel-sha: fix

[PATCH next 2/2] crypto: atmel-sha: fix error management in atmel_sha_start()

2017-02-09 Thread Cyrille Pitchen
te() would be called a second time. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 27 ++- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index d6c3d9529d36..0d207dac9aa2 100644

Re: [bug report] crypto: atmel-sha - update request queue management to make it more generic

2017-02-07 Thread Cyrille Pitchen
Hi Dan, Le 07/02/2017 à 11:56, Dan Carpenter a écrit : > Hello Cyrille Pitchen, > > The patch a29af939b24d: "crypto: atmel-sha - update request queue > management to make it more generic" from Jan 26, 2017, leads to the > following static checker warning: > >

[PATCH v3 09/12] crypto: atmel-sha: add support to hmac(shaX)

2017-01-26 Thread Cyrille Pitchen
This patch adds support to the hmac(shaX) algorithms. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha-regs.h | 4 + drivers/crypto/atmel-sha.c | 598 +++- 2 files changed, 601 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/atmel

[PATCH v3 08/12] crypto: atmel-sha: add simple DMA transfers

2017-01-26 Thread Cyrille Pitchen
This patch adds a simple function to perform data transfer with the DMA controller. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 116 + 1 file changed, 116 insertions(+) diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto

[PATCH v3 10/12] crypto: atmel-aes: fix atmel_aes_handle_queue()

2017-01-26 Thread Cyrille Pitchen
This patch fixes the value returned by atmel_aes_handle_queue(), which could have been wrong previously when the crypto request was started synchronously but became asynchronous during the ctx->start() call. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 7 +-- 1 f

[PATCH v3 02/12] crypto: atmel-sha: update request queue management to make it more generic

2017-01-26 Thread Cyrille Pitchen
pto request is handled synchronously. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 74 +- 1 file changed, 54 insertions(+), 20 deletions(-) diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index 33a36e667547..2dbed8bb8

[PATCH v3 11/12] crypto: atmel-authenc: add support to authenc(hmac(shaX),Y(aes)) modes

2017-01-26 Thread Cyrille Pitchen
available before we can start to process the data blocks. Hence we use their crypto request queue to synchronize both drivers. Signed-off-by: Cyrille Pitchen --- drivers/crypto/Kconfig | 12 ++ drivers/crypto/atmel-aes-regs.h | 16 ++ drivers/crypto/atmel-aes.c | 448

[PATCH v3 12/12] crypto: atmel-sha: add verbose debug facilities to print hw register names

2017-01-26 Thread Cyrille Pitchen
When VERBOSE_DEBUG is defined and SHA_FLAGS_DUMP_REG flag is set in dd->flags, this patch prints the register names and values when performing IO accesses. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 110 - 1 file changed,

[PATCH v3 01/12] crypto: atmel-sha: create function to get an Atmel SHA device

2017-01-26 Thread Cyrille Pitchen
This is a transitional patch: it creates the atmel_sha_find_dev() function, which will be used in further patches to share the source code responsible for finding a Atmel SHA device. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 15 +++ 1 file changed, 11

[PATCH v3 04/12] crypto: atmel-sha: redefine SHA_FLAGS_SHA* flags to match SHA_MR_ALGO_SHA*

2017-01-26 Thread Cyrille Pitchen
bitfield of the SHA_MR register could simply be set with: mr = (mr & ~SHA_FLAGS_ALGO_MASK) | (ctx->flags & SHA_FLAGS_ALGO_MASK) Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha-regs.h | 1 + drivers/crypto/atmel-sha.c | 45 + 2 fi

[PATCH v3 06/12] crypto: atmel-sha: add SHA_MR_MODE_IDATAR0

2017-01-26 Thread Cyrille Pitchen
This patch defines an alias macro to SHA_MR_MODE_PDC, which is not suited for DMA usage. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha-regs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/atmel-sha-regs.h b/drivers/crypto/atmel-sha-regs.h index deb0b0b15096

[PATCH v3 05/12] crypto: atmel-sha: add atmel_sha_wait_for_data_ready()

2017-01-26 Thread Cyrille Pitchen
ly avoid the latency of the 'Data Ready' interrupt. When the 'Data Ready' flag has not been set yet, we enable the associated interrupt and resume processing the crypto request asynchronously from the 'done' task just as before. Signed-off-by: Cyrille Pitchen --- dri

[PATCH v3 07/12] crypto: atmel-sha: add atmel_sha_cpu_start()

2017-01-26 Thread Cyrille Pitchen
This patch adds a simple function to perform data transfer with PIO, hence handled by the CPU. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 90 ++ 1 file changed, 90 insertions(+) diff --git a/drivers/crypto/atmel-sha.c b/drivers

[PATCH v3 03/12] crypto: atmel-sha: make atmel_sha_done_task more generic

2017-01-26 Thread Cyrille Pitchen
This patch is a transitional patch. It updates atmel_sha_done_task() to make it more generic. Indeed, it adds a new .resume() member in the atmel_sha_dev structure. This hook is called from atmel_sha_done_task() to resume processing an asynchronous request. Signed-off-by: Cyrille Pitchen

[PATCH v3 00/12] crypto: atmel-authenc: add support to authenc(hmac(shaX),Y(aes)) modes

2017-01-26 Thread Cyrille Pitchen
case req->src == req->dst. v1 -> v2: - add missing drivers/crypto/atmel-authenc.h file in patch 11. Cyrille Pitchen (12): crypto: atmel-sha: create function to get an Atmel SHA device crypto: atmel-sha: update request queue management to make it more generic crypto: atmel-sha:

Re: [PATCH 00/13] crypto: copy AAD during encrypt for AEAD ciphers

2017-01-20 Thread Cyrille Pitchen
Hi all, Le 13/01/2017 à 12:39, Herbert Xu a écrit : > On Fri, Jan 13, 2017 at 12:36:56PM +0100, Stephan Müller wrote: >> >> I thought I understood that you would not want to see it in any >> implementation. But, ok, if you want to leave it. > > If you remove it from authenc then authenc will be

Re: [PATCH 00/13] crypto: copy AAD during encrypt for AEAD ciphers

2017-01-18 Thread Cyrille Pitchen
Hi Stephan, this series of patches sounds like a good idea. I haven't tested it with the Atmel AES hardware yet but I have many dummy questions: Looking at some driver patches in the series, it seems you only add a call to crypto_aead_copy_ad() but I don't see any removal of the previous driver s

Re: [PATCH v2 11/12] crypto: atmel-authenc: add support to authenc(hmac(shaX),Y(aes)) modes

2017-01-09 Thread Cyrille Pitchen
Hi Stephan, Le 23/12/2016 à 12:34, Stephan Müller a écrit : > Am Donnerstag, 22. Dezember 2016, 17:38:00 CET schrieb Cyrille Pitchen: > > Hi Cyrille, > >> This patchs allows to combine the AES and SHA hardware accelerators on >> some Atmel SoCs. Doing so, AES blocks

[PATCH v2 00/12] crypto: atmel-authenc: add support to authenc(hmac(shaX),Y(aes)) modes

2016-12-22 Thread Cyrille Pitchen
2: - add missing drivers/crypto/atmel-authenc.h file in patch 11. Cyrille Pitchen (12): crypto: atmel-sha: create function to get an Atmel SHA device crypto: atmel-sha: update request queue management to make it more generic crypto: atmel-sha: make atmel_sha_done_task more generic crypt

[PATCH v2 01/12] crypto: atmel-sha: create function to get an Atmel SHA device

2016-12-22 Thread Cyrille Pitchen
This is a transitional patch: it creates the atmel_sha_find_dev() function, which will be used in further patches to share the source code responsible for finding a Atmel SHA device. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 15 +++ 1 file changed, 11

[PATCH v2 03/12] crypto: atmel-sha: make atmel_sha_done_task more generic

2016-12-22 Thread Cyrille Pitchen
This patch is a transitional patch. It updates atmel_sha_done_task() to make it more generic. Indeed, it adds a new .resume() member in the atmel_sha_dev structure. This hook is called from atmel_sha_done_task() to resume processing an asynchronous request. Signed-off-by: Cyrille Pitchen

[PATCH v2 02/12] crypto: atmel-sha: update request queue management to make it more generic

2016-12-22 Thread Cyrille Pitchen
pto request is handled synchronously. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 74 +- 1 file changed, 54 insertions(+), 20 deletions(-) diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index 33a36e667547..2dbed8bb8

[PATCH v2 05/12] crypto: atmel-sha: add atmel_sha_wait_for_data_ready()

2016-12-22 Thread Cyrille Pitchen
ly avoid the latency of the 'Data Ready' interrupt. When the 'Data Ready' flag has not been set yet, we enable the associated interrupt and resume processing the crypto request asynchronously from the 'done' task just as before. Signed-off-by: Cyrille Pitchen --- dri

[PATCH v2 08/12] crypto: atmel-sha: add simple DMA transfers

2016-12-22 Thread Cyrille Pitchen
This patch adds a simple function to perform data transfer with the DMA controller. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 116 + 1 file changed, 116 insertions(+) diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto

[PATCH v2 10/12] crypto: atmel-aes: fix atmel_aes_handle_queue()

2016-12-22 Thread Cyrille Pitchen
This patch fixes the value returned by atmel_aes_handle_queue(), which could have been wrong previously when the crypto request was started synchronously but became asynchronous during the ctx->start() call. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 7 +-- 1 f

[PATCH v2 06/12] crypto: atmel-sha: add SHA_MR_MODE_IDATAR0

2016-12-22 Thread Cyrille Pitchen
This patch defines an alias macro to SHA_MR_MODE_PDC, which is not suited for DMA usage. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha-regs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/atmel-sha-regs.h b/drivers/crypto/atmel-sha-regs.h index deb0b0b15096

[PATCH v2 12/12] crypto: atmel-sha: add verbose debug facilities to print hw register names

2016-12-22 Thread Cyrille Pitchen
When VERBOSE_DEBUG is defined and SHA_FLAGS_DUMP_REG flag is set in dd->flags, this patch prints the register names and values when performing IO accesses. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 110 - 1 file changed,

[PATCH v2 07/12] crypto: atmel-sha: add atmel_sha_cpu_start()

2016-12-22 Thread Cyrille Pitchen
This patch adds a simple function to perform data transfer with PIO, hence handled by the CPU. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 90 ++ 1 file changed, 90 insertions(+) diff --git a/drivers/crypto/atmel-sha.c b/drivers

[PATCH v2 04/12] crypto: atmel-sha: redefine SHA_FLAGS_SHA* flags to match SHA_MR_ALGO_SHA*

2016-12-22 Thread Cyrille Pitchen
bitfield of the SHA_MR register could simply be set with: mr = (mr & ~SHA_FLAGS_ALGO_MASK) | (ctx->flags & SHA_FLAGS_ALGO_MASK) Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha-regs.h | 1 + drivers/crypto/atmel-sha.c | 45 + 2 fi

[PATCH v2 11/12] crypto: atmel-authenc: add support to authenc(hmac(shaX),Y(aes)) modes

2016-12-22 Thread Cyrille Pitchen
available before we can start to process the data blocks. Hence we use their crypto request queue to synchronize both drivers. Signed-off-by: Cyrille Pitchen --- drivers/crypto/Kconfig | 12 + drivers/crypto/atmel-aes-regs.h | 16 ++ drivers/crypto/atmel-aes.c | 471

[PATCH v2 09/12] crypto: atmel-sha: add support to hmac(shaX)

2016-12-22 Thread Cyrille Pitchen
This patch adds support to the hmac(shaX) algorithms. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha-regs.h | 4 + drivers/crypto/atmel-sha.c | 598 +++- 2 files changed, 601 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/atmel

[PATCH 05/12] crypto: atmel-sha: add atmel_sha_wait_for_data_ready()

2016-12-22 Thread Cyrille Pitchen
ly avoid the latency of the 'Data Ready' interrupt. When the 'Data Ready' flag has not been set yet, we enable the associated interrupt and resume processing the crypto request asynchronously from the 'done' task just as before. Signed-off-by: Cyrille Pitchen --- dri

[PATCH 01/12] crypto: atmel-sha: create function to get an Atmel SHA device

2016-12-22 Thread Cyrille Pitchen
This is a transitional patch: it creates the atmel_sha_find_dev() function, which will be used in further patches to share the source code responsible for finding a Atmel SHA device. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 15 +++ 1 file changed, 11

[PATCH 11/12] crypto: atmel-authenc: add support to authenc(hmac(shaX),Y(aes)) modes

2016-12-22 Thread Cyrille Pitchen
available before we can start to process the data blocks. Hence we use their crypto request queue to synchronize both drivers. Signed-off-by: Cyrille Pitchen --- drivers/crypto/Kconfig | 12 + drivers/crypto/atmel-aes-regs.h | 16 ++ drivers/crypto/atmel-aes.c | 471

[PATCH 03/12] crypto: atmel-sha: make atmel_sha_done_task more generic

2016-12-22 Thread Cyrille Pitchen
This patch is a transitional patch. It updates atmel_sha_done_task() to make it more generic. Indeed, it adds a new .resume() member in the atmel_sha_dev structure. This hook is called from atmel_sha_done_task() to resume processing an asynchronous request. Signed-off-by: Cyrille Pitchen

[PATCH 10/12] crypto: atmel-aes: fix atmel_aes_handle_queue()

2016-12-22 Thread Cyrille Pitchen
This patch fixes the value returned by atmel_aes_handle_queue(), which could have been wrong previously when the crypto request was started synchronously but became asynchronous during the ctx->start() call. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 7 +-- 1 f

[PATCH 12/12] crypto: atmel-sha: add verbose debug facilities to print hw register names

2016-12-22 Thread Cyrille Pitchen
When VERBOSE_DEBUG is defined and SHA_FLAGS_DUMP_REG flag is set in dd->flags, this patch prints the register names and values when performing IO accesses. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 110 - 1 file changed,

[PATCH 07/12] crypto: atmel-sha: add atmel_sha_cpu_start()

2016-12-22 Thread Cyrille Pitchen
This patch adds a simple function to perform data transfer with PIO, hence handled by the CPU. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 90 ++ 1 file changed, 90 insertions(+) diff --git a/drivers/crypto/atmel-sha.c b/drivers

[PATCH 04/12] crypto: atmel-sha: redefine SHA_FLAGS_SHA* flags to match SHA_MR_ALGO_SHA*

2016-12-22 Thread Cyrille Pitchen
bitfield of the SHA_MR register could simply be set with: mr = (mr & ~SHA_FLAGS_ALGO_MASK) | (ctx->flags & SHA_FLAGS_ALGO_MASK) Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha-regs.h | 1 + drivers/crypto/atmel-sha.c | 45 + 2 fi

[PATCH 06/12] crypto: atmel-sha: add SHA_MR_MODE_IDATAR0

2016-12-22 Thread Cyrille Pitchen
This patch defines an alias macro to SHA_MR_MODE_PDC, which is not suited for DMA usage. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha-regs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/atmel-sha-regs.h b/drivers/crypto/atmel-sha-regs.h index deb0b0b15096

[PATCH 09/12] crypto: atmel-sha: add support to hmac(shaX)

2016-12-22 Thread Cyrille Pitchen
This patch adds support to the hmac(shaX) algorithms. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha-regs.h | 4 + drivers/crypto/atmel-sha.c | 598 +++- 2 files changed, 601 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/atmel

[PATCH 08/12] crypto: atmel-sha: add simple DMA transfers

2016-12-22 Thread Cyrille Pitchen
This patch adds a simple function to perform data transfer with the DMA controller. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 116 + 1 file changed, 116 insertions(+) diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto

[PATCH 02/12] crypto: atmel-sha: update request queue management to make it more generic

2016-12-22 Thread Cyrille Pitchen
pto request is handled synchronously. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 74 +- 1 file changed, 54 insertions(+), 20 deletions(-) diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index 33a36e667547..2dbed8bb8

[PATCH 00/12] crypto: atmel-authenc: add support to authenc(hmac(shaX),Y(aes)) modes

2016-12-22 Thread Cyrille Pitchen
-authenc-hmac-sha1-cbc-aes HW hW yes 38.8 SPLIP: Secure Protocol Layers Improved Performances (AES+SHA combined). Some patches of this series are purely transitional: I've split the modifications into many patches to ease the review. Best regards, Cyrille Cyrille Pitchen (12): c

crypto regression?

2016-12-08 Thread Cyrille Pitchen
Hi Herbert, Let me report a potential regression I've noticed this morning when testing linux-next. I've set CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=n when compiling both kernel images. On 4.9.0-rc2-next-20161028, /proc/crypto displays: driver : atmel-xts-aes module : kernel priority

[PATCH v2 1/1] crypto: atmel-aes: add support to the XTS mode

2016-10-03 Thread Cyrille Pitchen
This patch adds the xts(aes) algorithm, which is supported from hardware version 0x500 and above (sama5d2x). Signed-off-by: Cyrille Pitchen --- ChangeLog: v1 -> v2: - fix typo in comment inside atmel_aes_xts_process_data(): s/reverted/reversed/ - use xts_check_key() from atmel_aes_xts_set

Re: [BUG] crypto: atmel-aes - erro when compiling with VERBOSE_DEBUG enable

2016-10-03 Thread Cyrille Pitchen
Hi all, Le 02/10/2016 à 16:38, Herbert Xu a écrit : > On Tue, Sep 27, 2016 at 06:45:18PM +0200, Cyrille Pitchen wrote: >> Hi Levent, >> >> there is a typo in the subject line: erroR. >> Also it would be better to start the summary phrase of the subject line with >&g

[PATCH 1/1] crypto: atmel-aes: add support to the XTS mode

2016-09-29 Thread Cyrille Pitchen
This patch adds the xts(aes) algorithm, which is supported from hardware version 0x500 and above (sama5d2x). Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes-regs.h | 4 + drivers/crypto/atmel-aes.c | 186 ++-- 2 files changed, 184

[PATCH 1/1] crypto: atmel-aes: fix compiler error when VERBOSE_DEBUG is defined

2016-09-29 Thread Cyrille Pitchen
This patch fixes a compiler error when VERBOSE_DEBUG is defined. Indeed, in atmel_aes_write(), the 3rd argument of atmel_aes_reg_name() was missing. Signed-off-by: Cyrille Pitchen Reported-by: Levent Demir --- drivers/crypto/atmel-aes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

Re: [BUG] crypto: atmel-aes - erro when compiling with VERBOSE_DEBUG enable

2016-09-27 Thread Cyrille Pitchen
Hi Levent, there is a typo in the subject line: erroR. Also it would be better to start the summary phrase of the subject line with a verb: crypto: atmel-aes: fix compiler error when VERBODE_DEBUG is defined Le 22/09/2016 à 14:45, levent demir a écrit : > Fix debug function call in atmel_aes_wri

[PATCH 1/2] crypto: atmel-sha - fix .import()/.export() implementation

2016-02-08 Thread Cyrille Pitchen
Using only the digest, digcnt[], bufcnt and buffer[] fields of the struct atmel_sha_reqctx was not enough to import/export the request state, so now we use the whole structure. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 44 ++-- 1

[PATCH 2/2] crypto: atmel-sha - fix race in atmel_sha_final()

2016-02-08 Thread Cyrille Pitchen
_final() should be delayed by queueing this request, the same way as done for the (ctx->bufcnt != 0) case. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 24 ++-- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/crypto/atmel-sha.c b/drive

[PATCH 0/2] crypto: atmel-sha - fix .import()/.export() implementation

2016-02-08 Thread Cyrille Pitchen
. The second patch fixes a race condition if acquiring the hardware when it is already busy. Cyrille Pitchen (2): crypto: atmel-sha - fix .import()/.export() implementation crypto: atmel-sha - fix race in atmel_sha_final() drivers/crypto/atmel-sha.c | 68

[PATCH 2/2] crypto: atmel-sha - remove calls of clk_prepare() from atomic contexts

2016-02-05 Thread Cyrille Pitchen
(). Signed-off-by: Cyrille Pitchen Reported-by: Matthias Mayr --- drivers/crypto/atmel-sha.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index b827c99b17c1..f8407dc7dd38 100644 --- a/drivers/crypto

[PATCH 1/2] crypto: atmel-sha: fix atmel_sha_remove()

2016-02-05 Thread Cyrille Pitchen
Since atmel_sha_probe() uses devm_xxx functions to allocate resources, atmel_sha_remove() should no longer explicitly release them. Signed-off-by: Cyrille Pitchen Fixes: b0e8b3417a62 ("crypto: atmel - use devm_xxx() managed function") --- drivers/crypto/atmel-sha.c | 7 --- 1 fi

[PATCH 0/2] crypto: atmel-sha - fix resource management

2016-02-05 Thread Cyrille Pitchen
Hi all, these two small patches fix resource release and clock management in atomic context. Best regards, Cyrille Cyrille Pitchen (2): crypto: atmel-sha: fix atmel_sha_remove() crypto: atmel-sha - remove calls of clk_prepare() from atomic contexts drivers/crypto/atmel-sha.c | 23

[PATCH] crypto: atmel-aes - remove calls of clk_prepare() from atomic contexts

2016-01-29 Thread Cyrille Pitchen
(). Signed-off-by: Cyrille Pitchen Reported-by: Matthias Mayr --- drivers/crypto/atmel-aes.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 6dd3317ca365..3eb3f1279fb7 100644 --- a/drivers/crypto

[PATCH v2] crypto: atmel-sha: fix algorihtm registration

2016-01-29 Thread Cyrille Pitchen
registered. Signed-off-by: Cyrille Pitchen --- ChangeLog v2: deal with unaligned in/out pointers in atmel_sha_import/atmel_sha_export drivers/crypto/atmel-sha.c | 61 +- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/atmel-sha.c b

Re: [PATCH 0/5] crypto: atmel-sha: fix registration issue and other bugs

2016-01-25 Thread Cyrille Pitchen
Hi Herbert, Le 25/01/2016 15:48, Herbert Xu a écrit : > On Fri, Jan 15, 2016 at 03:49:30PM +0100, Cyrille Pitchen wrote: >> Hi all, >> >> This series of patches fixes many issues such as the algo registration >> failure >> or the broken support of context switch

[PATCH 20/24] crypto: atmel-aes: fix atmel-ctr-aes driver for RFC 3686

2015-12-17 Thread Cyrille Pitchen
crypto_rfc3686_alloc() in crypto/ctr.c expects to be used with a stream cipher (alg->cra_blocksize == 1). Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-ae

[PATCH 23/24] crypto: atmel-aes: add support to GCM mode

2015-12-17 Thread Cyrille Pitchen
This patch adds support to the GCM mode. Signed-off-by: Cyrille Pitchen --- drivers/crypto/Kconfig | 1 + drivers/crypto/atmel-aes-regs.h | 10 + drivers/crypto/atmel-aes.c | 453 +++- 3 files changed, 462 insertions(+), 2 deletions(-) diff

[PATCH 24/24] crypto: atmel-aes: add debug facilities to monitor register accesses.

2015-12-17 Thread Cyrille Pitchen
This feature should not be enabled in release but can be usefull for developers who need to monitor register accesses at some specific places. Set the AES_FLAGS_DUMP_REG flag inside dd->flags to start monitoring the I/O accesses, clear it to stop monitoring. Signed-off-by: Cyrille Pitc

[PATCH 21/24] crypto: atmel-aes: fix the counter overflow in CTR mode

2015-12-17 Thread Cyrille Pitchen
Depending on its hardware version, the AES IP provides either a 16 or a 32 bit counter. However the CTR mode expects the size of the counter to be the same as the size of the cipher block, ie 128 bits for AES. This patch detects and handles counter overflows. Signed-off-by: Cyrille Pitchen

[PATCH 22/24] crypto: atmel-aes: change the DMA threshold

2015-12-17 Thread Cyrille Pitchen
Increase the DMA threshold to 256: PIO accesses offer better performances than the DMA when processing small amounts of data. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers

[PATCH 19/24] crypto: atmel-aes: create sections to regroup functions by usage

2015-12-17 Thread Cyrille Pitchen
transfer: handles transfers monitored by the CPU (PIO accesses). - DMA transfer: handles transfers monitored by the DMA controller. - AES async block ciphers: dedicated to the already supported block ciphers - Probe functions: used to register all crypto algorithms. Signed-off-by: Cyrille Pitchen

[PATCH 18/24] crypto: atmel-aes: fix typo and indentation

2015-12-17 Thread Cyrille Pitchen
Dummy patch to fix typo and indentation. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 56 +- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 176ab3878583

[PATCH 17/24] crypto: atmel-aes: use SIZE_IN_WORDS() helper macro

2015-12-17 Thread Cyrille Pitchen
This is a dummy cosmetic patch. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 9ef38eca4ae7..176ab3878583 100644 --- a/drivers/crypto/atmel-aes.c

[PATCH 16/24] crypto: atmel-aes: improve performances of data transfer

2015-12-17 Thread Cyrille Pitchen
eady. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 764 +++-- 1 file changed, 386 insertions(+), 378 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 343199cfed23..9ef38eca4ae7 100644 --- a/drivers/cryp

[PATCH 06/24] crypto: atmel-aes: propagate error from atmel_aes_hw_version_init()

2015-12-17 Thread Cyrille Pitchen
Before this patch atmel_aes_hw_version_init() had no returned value. However it calls atmel_aes_hw_init(), which may fail. So check the returned code of atmel_aes_hw_init() and propagate error if needed. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 16 +++- 1 file

[PATCH 01/24] crypto: atmel-aes: add new version

2015-12-17 Thread Cyrille Pitchen
From: Leilei Zhao Add new version of atmel-aes available with SAMA5D2 devices. Signed-off-by: Leilei Zhao --- drivers/crypto/atmel-aes.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index bfb1f799bf56..854e2813b2bb 100644 ---

[PATCH 14/24] crypto: atmel-aes: remove useless AES_FLAGS_DMA flag

2015-12-17 Thread Cyrille Pitchen
Since the 'done' task code was split into atmel_aes_cpu_complete() and atmel_aes_dma_complete(), the AES_FLAGS_DMA flag has become useless. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 37 +++-- 1 file changed, 15 insertions(+), 22

[PATCH 13/24] crypto: atmel-aes: reduce latency of DMA completion

2015-12-17 Thread Cyrille Pitchen
atmel_aes_dma_callback() now directly calls the 'resume' callback instead of scheduling the done task, which in turn only calls the very same 'resume' callback. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deleti

[PATCH 02/24] crypto: atmel-aes: constify value argument of atmel_aes_write_n()

2015-12-17 Thread Cyrille Pitchen
atmel_aes_write_n() should not modify its value argument. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 854e2813b2bb..1d3997a45610 100644 --- a

[PATCH 15/24] crypto: atmel-aes: fix atmel_aes_remove()

2015-12-17 Thread Cyrille Pitchen
Add missing call to atmel_aes_buff_cleanup(). Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 68e4177ad61b..343199cfed23 100644 --- a/drivers/crypto/atmel-aes.c +++ b

[PATCH 12/24] crypto: atmel-aes: remove unused 'err' member of struct atmel_aes_dev

2015-12-17 Thread Cyrille Pitchen
This 'err' member was initialized to 0 but its value never changed. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index ac551ee2d624..25dc7bd73532 100644 ---

[PATCH 11/24] crypto: atmel-aes: rework crypto request completion

2015-12-17 Thread Cyrille Pitchen
in further patches. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 74 +- 1 file changed, 47 insertions(+), 27 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index c10c54ccc606..ac551ee2d624 100644 ---

[PATCH 09/24] crypto: atmel-aes: remove useless write in the Control Register

2015-12-17 Thread Cyrille Pitchen
As claimed by the datasheet, writing 0 into the Control Register has no effet. So we remove this useless register access. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers

[PATCH 10/24] crypto: atmel-aes: simplify the configuration of the AES IP

2015-12-17 Thread Cyrille Pitchen
This patch reworks the AES_FLAGS_* to simplify the configuration of the AES IP. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 216 +++-- 1 file changed, 93 insertions(+), 123 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b

[PATCH 04/24] crypto: atmel-aes: fix unregistration order of crypto algorithms

2015-12-17 Thread Cyrille Pitchen
This dummy patch fixes atmel_aes_unregister_algs() so crypto algorithms are unregistered in the reverse order they were registered by atmel_aes_register_algs(). Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a

[PATCH 07/24] crypto: atmel-aes: change atmel_aes_write_ctrl() signature

2015-12-17 Thread Cyrille Pitchen
() many times, still initializing the hardware only once. Indeed, the support of GCM will require to update the Mode Register and the IV when processing a single request. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 24 ++-- 1 file changed, 10 insertions(+), 14

[PATCH 08/24] crypto: atmel-aes: make crypto request queue management more generic

2015-12-17 Thread Cyrille Pitchen
base of all the transformation contexts. Hence the very same queue will be used to manage both block cipher and AEAD requests (such as gcm and authenc implemented in further patches). Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 75

[PATCH 05/24] crypto: atmel-aes: remove unused header includes

2015-12-17 Thread Cyrille Pitchen
Hash headers have nothing to do with AES block ciphers. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index e948bf2b8a8e..7d1b055811c4 100644 --- a/drivers/crypto/atmel

[PATCH 03/24] crypto: atmel-aes: change algorithm priorities

2015-12-17 Thread Cyrille Pitchen
Increase the algorithm priorities so the hardware acceleration is now preferred to the software computation: the "aes-generice" driver uses 100 as priority. Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-aes.c | 20 +++- 1 file changed, 11 insertions(+), 9

[PATCH 00/24] crypto: atmel-aes: global rework of the driver

2015-12-17 Thread Cyrille Pitchen
an IPSEC/L2TP tunnel using the rfc4106(gcm(aes)) cipher suite. Changelog: v1: initial version Cyrille Pitchen (23): crypto: atmel-aes: constify value argument of atmel_aes_write_n() crypto: atmel-aes: change algorithm priorities crypto: atmel-aes: fix unregistration order of crypto

[PATCH 1/1] crypto: tcrypt: fix keysize argument of test_aead_speed for gcm(aes)

2015-11-17 Thread Cyrille Pitchen
The key sizes used by AES in GCM mode should be 128, 192 or 256 bits (16, 24 or 32 bytes). There is no additional 4byte nonce as for RFC 4106. Signed-off-by: Cyrille Pitchen --- crypto/tcrypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c

Re: [PATCH] crypto: atmel: fix 64-bit warnings

2015-11-17 Thread Cyrille Pitchen
dma_len(), the type of the result depends > on CONFIG_NEED_SG_DMA_LENGTH, so we have to use min_t to get it to > work in all configurations. > > Signed-off-by: Arnd Bergmann Acked-by: Cyrille Pitchen > > diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c > in