Re: CAAM: kernel BUG at drivers/crypto/caam/jr.c:230! (and dma-coherent query)

2021-03-03 Thread Sascha Hauer
On Wed, Mar 03, 2021 at 12:26:32PM +0200, Horia Geantă wrote: > Adding some people in the loop, maybe they could help in understanding > why lack of "dma-coherent" property for a HW-coherent device could lead to > unexpected / strange side effects. > > On 3/1/2021 5:

CAAM: kernel BUG at drivers/crypto/caam/jr.c:230!

2021-03-01 Thread Sascha Hauer
Hi All, I am on a Layerscape LS1046a using Linux-5.11. The CAAM driver sometimes crashes during the run-time self tests with: > kernel BUG at drivers/crypto/caam/jr.c:247! > Internal error: Oops - BUG: 0 [#1] PREEMPT SMP > Modules linked in: > CPU: 0 PID: 0 Comm: swapper/0 Not tainted > 5.11.0-2

Re: [PATCH] ubifs: fix wrong use of crypto_shash_descsize()

2020-05-04 Thread Sascha Hauer
f65f9573 ("ubifs: Authenticate replayed journal") > Cc: # v4.20+ > Cc: Sascha Hauer > Signed-off-by: Eric Biggers Looks better that way, thanks. Acked-by: Sascha Hauer Sascha -- Pengutronix e.K. | | Steuerwalder Str.

Re: ctr(aes) broken in CAAM driver

2019-06-17 Thread Sascha Hauer
On Wed, Jun 12, 2019 at 01:35:36PM +0200, Sascha Hauer wrote: > On Wed, Jun 12, 2019 at 10:33:56AM +, Horia Geanta wrote: > > On 6/12/2019 12:40 PM, Sascha Hauer wrote: > > > Hi Horia, > > > > > > On Wed, May 15, 2019 at 01:35:16PM +, Horia Geanta wrote

Re: ctr(aes) broken in CAAM driver

2019-06-12 Thread Sascha Hauer
On Wed, Jun 12, 2019 at 10:33:56AM +, Horia Geanta wrote: > On 6/12/2019 12:40 PM, Sascha Hauer wrote: > > Hi Horia, > > > > On Wed, May 15, 2019 at 01:35:16PM +, Horia Geanta wrote: > >> For talitos, the problem is the lack of IV update. > >> >

Re: ctr(aes) broken in CAAM driver

2019-06-12 Thread Sascha Hauer
Hi Horia, On Wed, May 15, 2019 at 01:35:16PM +, Horia Geanta wrote: > For talitos, the problem is the lack of IV update. > > For caam, the problem is incorrect IV update (output IV is equal to last > ciphertext block, which is correect for cbc, but not for ctr mode). > > I am working at a fi

[PATCH v2 0/4] crypto: CAAM: Print debug messages at debug level

2019-05-23 Thread Sascha Hauer
following lines when converting print_hex_dump to print_hex_dump_debug - Add 1/4 to avoid crash when debugging is enabled Sascha Hauer (4): crypto: caam: print IV only when non NULL crypto: caam: remove unused defines crypto: caam: print debug messages at debug level crypto: caam: print messages

[PATCH 1/4] crypto: caam: print IV only when non NULL

2019-05-23 Thread Sascha Hauer
Since eaed71a44ad9 ("crypto: caam - add ecb(*) support") the IV can be NULL, so only dump it when it's non NULL as designated by the ivsize variable. Fixes: eaed71a44ad9 ("crypto: caam - add ecb(*) support") Signed-off-by: Sascha Hauer --- drivers/crypto/caam/caam

[PATCH 3/4] crypto: caam: print debug messages at debug level

2019-05-23 Thread Sascha Hauer
...) inside #ifdef DEBUG with print_hex_dump_debug(...) - dev_err() inside #ifdef DEBUG with dev_dbg() - printk(KERN_ERR ...) inside #ifdef DEBUG with dev_dbg() Some parts of the driver use these functions already, so it is only consequent to use the debug function consistently. Signed-off-by: Sascha

[PATCH 4/4] crypto: caam: print messages in caam_dump_sg at debug level

2019-05-23 Thread Sascha Hauer
caam_dump_sg() is only compiled in when DEBUG is defined, hence the messages are debug messages. Remove the @level argument from caam_dump_sg() and print all messages at debug level. Signed-off-by: Sascha Hauer --- drivers/crypto/caam/caamalg.c | 8 drivers/crypto/caam/caamalg_qi.c

[PATCH 2/4] crypto: caam: remove unused defines

2019-05-23 Thread Sascha Hauer
The CAAM driver defines its own debug() macro, but it is unused. Remove it. Signed-off-by: Sascha Hauer Reviewed-by: Horia Geantă --- drivers/crypto/caam/caamalg.c | 7 --- drivers/crypto/caam/caamhash.c | 8 2 files changed, 15 deletions(-) diff --git a/drivers/crypto/caam

Re: [PATCH 2/3] crypto: caam: print debug messages at debug level

2019-05-17 Thread Sascha Hauer
On Fri, May 17, 2019 at 11:29:04AM +0200, Sascha Hauer wrote: > The CAAM driver used to put its debug messages inside #ifdef DEBUG and > then prints the messages at KERN_ERR level. Replace this with proper > functions printing at KERN_DEBUG level. The #ifdef DEBUG gets > unnecessary wh

[PATCH 2/3] crypto: caam: print debug messages at debug level

2019-05-17 Thread Sascha Hauer
...) inside #ifdef DEBUG with print_hex_dump_debug(...) - dev_err() inside #ifdef DEBUG with dev_dbg() - printk(KERN_ERR ...) inside #ifdef DEBUG with dev_dbg() Some parts of the driver use these functions already, so it is only consequent to use the debug function consistently. Signed-off-by: Sascha

[PATCH 3/3] crypto: caam: print messages in caam_dump_sg at debug level

2019-05-17 Thread Sascha Hauer
caam_dump_sg() is only compiled in when DEBUG is defined, hence the messages are debug messages. Remove the @level argument from caam_dump_sg() and print all messages at debug level. Signed-off-by: Sascha Hauer --- drivers/crypto/caam/caamalg.c | 8 drivers/crypto/caam/caamalg_qi.c

[PATCH 1/3] crypto: caam: remove unused defines

2019-05-17 Thread Sascha Hauer
The CAAM driver defines its own debug() macro, but it is unused. Remove it. Signed-off-by: Sascha Hauer --- drivers/crypto/caam/caamalg.c | 7 --- drivers/crypto/caam/caamhash.c | 8 2 files changed, 15 deletions(-) diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam

[PATCH 0/3] crypto: CAAM: Print debug messages at debug level

2019-05-17 Thread Sascha Hauer
The CAAM driver has most of its debug messages inside #ifdef DEBUG and then prints them at KERN_ERR level. Do this properly and print the messages at DEBUG_LEVEL as they are supposed to. With this we can get rid of a lot of ifdefs in the code. Sascha Sascha Hauer (3): crypto: caam: remove

Re: ctr(aes) broken in CAAM driver

2019-05-17 Thread Sascha Hauer
On Wed, May 15, 2019 at 01:35:16PM +, Horia Geanta wrote: > On 5/15/2019 4:22 PM, Sascha Hauer wrote: > > Hi Fabio, > > > > On Wed, May 15, 2019 at 10:17:19AM -0300, Fabio Estevam wrote: > >> Hi Sascha, > >> > >> On Wed, May 15, 2019 at 10

[PATCH] crypto: caam: print debugging hex dumps after unmapping

2019-05-16 Thread Sascha Hauer
hex dumps consistenly after the buffers have been unmapped and in case of IV copied to their final destination. Signed-off-by: Sascha Hauer --- drivers/crypto/caam/caamalg.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/crypto/caam/caamalg.c b

Re: [PATCH] crypto: caam: print debugging hex dumps after unmapping

2019-05-16 Thread Sascha Hauer
On Wed, May 15, 2019 at 04:27:51PM +, Horia Geanta wrote: > On 5/15/2019 4:13 PM, Sascha Hauer wrote: > > The debugging hex dumps in skcipher_encrypt_done() and > > skcipher_decrypt_done() are printed while the request is still DMA > > mapped. This results in bogus hex d

Re: ctr(aes) broken in CAAM driver

2019-05-15 Thread Sascha Hauer
Hi Fabio, On Wed, May 15, 2019 at 10:17:19AM -0300, Fabio Estevam wrote: > Hi Sascha, > > On Wed, May 15, 2019 at 10:09 AM Sascha Hauer wrote: > > > > Hi, > > > > ctr(aes) is broken in current kernel (v5.1+). It may have been broken > > for longer, but t

[PATCH] crypto: caam: print debugging hex dumps after unmapping

2019-05-15 Thread Sascha Hauer
The debugging hex dumps in skcipher_encrypt_done() and skcipher_decrypt_done() are printed while the request is still DMA mapped. This results in bogus hex dumps with things like mixtures between plain text and cipher text. Unmap first before printing. Signed-off-by: Sascha Hauer --- drivers

ctr(aes) broken in CAAM driver

2019-05-15 Thread Sascha Hauer
Hi, ctr(aes) is broken in current kernel (v5.1+). It may have been broken for longer, but the crypto tests now check for a correct output IV. The testmgr answers with: alg: skcipher: ctr-aes-caam encryption test failed (wrong output IV) on test vector 0, cfg="in-place" output IV is this, which

Re: [PATCH] crypto: caam - Do not overwrite IV

2019-02-05 Thread Sascha Hauer
Hi Horia, On Mon, Feb 04, 2019 at 12:26:26PM +, Horia Geanta wrote: > On 1/31/2019 8:12 AM, Sascha Hauer wrote: > > In skcipher_decrypt() the IV passed in by the caller is overwritten and > > the tcrypt module fails with: > > > > alg: aead: decryption failed on t

[PATCH] crypto: caam - Do not overwrite IV

2019-01-30 Thread Sascha Hauer
: 115957bb3e59 ("crypto: caam - fix IV DMA mapping and updating") Signed-off-by: Sascha Hauer --- drivers/crypto/caam/caamalg.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c index 80ae69f906fb..493fa4169382 10

Re: [PATCH] crypto: caam - fix setting IV after decrypt

2019-01-23 Thread Sascha Hauer
Horia, On Fri, Dec 07, 2018 at 12:31:23PM +0100, Sascha Hauer wrote: > The crypto API wants the updated IV in req->info after decryption. The > updated IV used to be copied correctly to req->info after running the > decryption job. Since 115957bb3e59 this is done before runni

[PATCH] crypto: caam - fix setting IV after decrypt

2018-12-07 Thread Sascha Hauer
crypto API. This was observed running the gcm(aes) selftest which internally uses ctr(aes) implemented by the CAAM engine. Fixes: 115957bb3e59 ("crypto: caam - fix IV DMA mapping and updating") Signed-off-by: Sascha Hauer Cc: sta...@vger.kernel.org --- drivers/crypto/caa

Re: [PATCH 6/6] crypto: vf-crc - Add new driver for Freescale Vybrid CRC

2018-08-31 Thread Sascha Hauer
On Fri, Aug 31, 2018 at 01:07:39PM +0200, Krzysztof Kozlowski wrote: > On Fri, 31 Aug 2018 at 09:39, Sascha Hauer wrote: > > > > Hi Krzysztof, > > > > Some comments inline. > > > > On Thu, Aug 30, 2018 at 07:15:39PM +0200, Krzysztof Kozlowski wrote: >

Re: [PATCH 6/6] crypto: vf-crc - Add new driver for Freescale Vybrid CRC

2018-08-31 Thread Sascha Hauer
Hi Krzysztof, Some comments inline. On Thu, Aug 30, 2018 at 07:15:39PM +0200, Krzysztof Kozlowski wrote: > Add driver for using the Freescale/NXP Vybrid processor CRC block for > CRC16 and CRC32 offloading. The driver implements shash_alg and was > tested using internal testmgr tests and libkcap

Re: [PATCH 03/12] crypto: caam - Enable and disable clocks on Freescale i.MX platforms

2015-07-30 Thread Sascha Hauer
On Thu, Jul 30, 2015 at 11:32:44PM -0700, Victoria Milhoan wrote: > Hi Sascha, > > Thank you for the responses. Comments inline. Changes will be > in the next version of the patch set. > > -Victoria > > On Thu, 30 Jul 2015 08:02:14 +0200 > Sascha Hauer

Re: [PATCH 08/12] ARM: clk-imx6q: Add CAAM clock support

2015-07-29 Thread Sascha Hauer
On Wed, Jul 29, 2015 at 08:58:25PM -0700, Victoria Milhoan wrote: > Add CAAM clock support to the i.MX6 clocking infrastructure. > > Signed-off-by: Victoria Milhoan > --- > drivers/clk/imx/clk-imx6q.c | 3 +++ > include/dt-bindings/clock/imx6qdl-clock.h | 5 - > 2 files changed

Re: [PATCH 09/12] ARM: dts: mx6qdl: Add CAAM device node

2015-07-29 Thread Sascha Hauer
On Wed, Jul 29, 2015 at 08:58:26PM -0700, Victoria Milhoan wrote: > Add CAAM device node to the i.MX6 device tree. > > Signed-off-by: Victoria Milhoan > --- > arch/arm/boot/dts/imx6qdl.dtsi | 30 ++ > 1 file changed, 26 insertions(+), 4 deletions(-) > > diff --git a/

Re: [PATCH 03/12] crypto: caam - Enable and disable clocks on Freescale i.MX platforms

2015-07-29 Thread Sascha Hauer
Hi Victoria, comments inline. On Wed, Jul 29, 2015 at 08:58:20PM -0700, Victoria Milhoan wrote: > ARM-based systems may disable clocking to the CAAM device on the > Freescale i.MX platform for power management purposes. This patch > enables the required clocks when the CAAM module is initialized

Re: [PATCH v3 1/2] i.MX27: Add clock support for SAHARA2.

2013-03-11 Thread Sascha Hauer
On Mon, Mar 11, 2013 at 09:19:26AM +0800, Herbert Xu wrote: > On Mon, Mar 11, 2013 at 12:08:56AM +0100, Sascha Hauer wrote: > > On Sun, Mar 10, 2013 at 04:34:01PM +0800, Herbert Xu wrote: > > > > > > > > > > https://patchwork.kernel.org/patch/1817741/

Re: [PATCH v3 1/2] i.MX27: Add clock support for SAHARA2.

2013-03-10 Thread Sascha Hauer
On Sun, Mar 10, 2013 at 04:34:01PM +0800, Herbert Xu wrote: > > > > > > https://patchwork.kernel.org/patch/1817741/ > > > > > > So the change above becomes unnecessary > > > > Very good. Then this patch can be safely dropped. > > So should I take this patch or not? This clk patch, no. The sahara

Re: [PATCH v3 1/2] i.MX27: Add clock support for SAHARA2.

2013-03-03 Thread Sascha Hauer
On Fri, Mar 01, 2013 at 12:37:52PM +0100, Javier Martin wrote: > > Signed-off-by: Javier Martin > --- > arch/arm/mach-imx/clk-imx27.c |2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c > index 4c1d1e4..0b9664a 100644 > ---

Re: [PATCH v2 3/3] crypto: sahara: Add device tree binding for SAHARA2.

2013-02-27 Thread Sascha Hauer
Hi Javier, On Wed, Feb 27, 2013 at 11:41:51AM +0100, Javier Martin wrote: > > Signed-off-by: Javier Martin > --- > .../devicetree/bindings/crypto/fsl-imx-sahara.txt | 14 ++ > 1 file changed, 14 insertions(+) > create mode 100644 > Documentation/devicetree/bindings/crypto/fsl-i

Re: [PATCH 0/3] crypto: sahara: Add support for SAHARA in i.MX27.

2013-02-21 Thread Sascha Hauer
On Thu, Feb 21, 2013 at 02:40:59PM +, Arnd Bergmann wrote: > On Thursday 21 February 2013, javier Martin wrote: > > We know about the existence of DT and the constant migration process > > that is taking place towards it. > > > > Moreover we are strongly interested in converting the Visstrim S

Re: [PATCH 0/3] crypto: sahara: Add support for SAHARA in i.MX27.

2013-02-21 Thread Sascha Hauer
On Thu, Feb 21, 2013 at 03:18:36PM +0100, javier Martin wrote: > Hi Arnd, > > On 21 February 2013 13:59, Arnd Bergmann wrote: > > On Thursday 21 February 2013, Javier Martin wrote: > >> This series of patches provide AES-ECB and AES-CBC support > >> for the SAHARA2 cryptographic accelerator which