Re: [PATCH 2/5] omap-aes: DMA initialization fixes for OMAP off mode

2010-11-10 Thread Felipe Balbi
Hi, On Wed, 2010-11-10 at 19:26 +0200, Dmitry Kasatkin wrote: > diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c > index 9d65611..04cab70 100644 > --- a/drivers/crypto/omap-aes.c > +++ b/drivers/crypto/omap-aes.c > @@ -99,7 +99,7 @@ struct omap_aes_reqctx { > struct omap_aes_dev

Re: Linux 2.6.37-rc1 (pcrypt fault)

2010-11-10 Thread Randy Dunlap
On 11/10/10 03:21, Steffen Klassert wrote: > On Wed, Nov 03, 2010 at 02:15:19PM -0700, Randy Dunlap wrote: >> >> modprobe pcrypt; rmmod pcrypt ==> >> >> >> [ 76.081639] calling pcrypt_init+0x0/0x107 [pcrypt] @ 3016 >> Nov 3 13:02:15 control kernel: [ 76.089883] initcall >> pcrypt_init+0x0/0x

[PATCH 3/4] omap-sham: error handling improved

2010-11-10 Thread Dmitry Kasatkin
Introduces DMA error handling. DMA error is returned as a result code of the hash request. Clients needs to handle error codes and may repeat hash calculation attempt. Also in the case of DMA error, SHAM module is set to be re-initialized again. It significantly improves stability against possibl

[PATCH 4/4] omap-sham: removed redundunt locking

2010-11-10 Thread Dmitry Kasatkin
Locking for queuing and dequeuing is combined. test_and_set_bit() is also replaced with checking under dd->lock. Signed-off-by: Dmitry Kasatkin --- drivers/crypto/omap-sham.c | 47 +++ 1 files changed, 21 insertions(+), 26 deletions(-) diff --git a/driv

[PATCH 2/4] omap-sham: DMA initialization fixes for off mode

2010-11-10 Thread Dmitry Kasatkin
DMA parameters for constant data were initialized during driver probe(). It seems that those settings sometimes are lost when devices goes to off mode. This patch makes DMA initialization just before use. It solves off mode problems. Fixes: NB#202786 - Aegis & SHA1 block off mode changes Signed-o

[PATCH 1/4] omap-sham: uses digest buffer in request context

2010-11-10 Thread Dmitry Kasatkin
Currently driver storred digest results in req->results provided by the client. But some clients do not set it until final() call. It leads to crash. Changed to use internal buffer to store temporary digest results. Signed-off-by: Dmitry Kasatkin --- drivers/crypto/omap-sham.c | 11 ---

[PATCH 0/4]v2 omap-sham off mode and error handling fixes.

2010-11-10 Thread Dmitry Kasatkin
Please ignore previous patch set. Some old patches appeared there... Dmitry Kasatkin (4): omap-sham: uses digest buffer in request context omap-sham: DMA initialization fixes for off mode omap-sham: error handling improved omap-sham: removed redundunt locking drivers/crypto/omap-sham.c |

[PATCH 7/7] omap-sham: removed redundunt locking

2010-11-10 Thread Dmitry Kasatkin
Locking for queuing and dequeuing is combined. test_and_set_bit() is also replaced with checking under dd->lock. Signed-off-by: Dmitry Kasatkin --- drivers/crypto/omap-sham.c | 47 +++ 1 files changed, 21 insertions(+), 26 deletions(-) diff --git a/driv

[PATCH 6/7] omap-sham: error handling improved

2010-11-10 Thread Dmitry Kasatkin
Introduces DMA error handling. DMA error is returned as a result code of the hash request. Clients needs to handle error codes and may repeat hash calculation attempt. Also in the case of DMA error, SHAM module is set to be re-initialized again. It significantly improves stability against possibl

[PATCH 5/7] omap-sham: DMA initialization fixes for off mode

2010-11-10 Thread Dmitry Kasatkin
DMA parameters for constant data were initialized during driver probe(). It seems that those settings sometimes are lost when devices goes to off mode. This patch makes DMA initialization just before use. It solves off mode problems. Fixes: NB#202786 - Aegis & SHA1 block off mode changes Signed-o

[PATCH 4/7] omap-sham: uses digest buffer in request context

2010-11-10 Thread Dmitry Kasatkin
Currently driver storred digest results in req->results provided by the client. But some clients do not set it until final() call. It leads to crash. Changed to use internal buffer to store temporary digest results. Signed-off-by: Dmitry Kasatkin --- drivers/crypto/omap-sham.c | 11 ---

[PATCH 3/7] omap-sham: OMAP macros corrected

2010-11-10 Thread Dmitry Kasatkin
Signed-off-by: Dmitry Kasatkin --- arch/arm/mach-omap2/devices.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index beac46c..79dbf04 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/de

[PATCH 2/7] crypto: omap-sham - omap sha1 & md5 driver

2010-11-10 Thread Dmitry Kasatkin
Earlier kernel contained omap sha1 and md5 driver, which was not maintained, was not ported to new crypto APIs and removed from the source tree. - implements async crypto API using dma and cpu. - supports multiple sham instances if available - hmac - concurrent requests Signed-off-by: Dmitry Kas

[PATCH 1/7] crypto: updates omap sham device related platform code

2010-11-10 Thread Dmitry Kasatkin
- registration with multi OMAP kernels support - clocks Signed-off-by: Dmitry Kasatkin --- arch/arm/mach-omap2/clock2420_data.c |2 +- arch/arm/mach-omap2/clock2430_data.c |2 +- arch/arm/mach-omap2/clock3xxx_data.c |2 +- arch/arm/mach-omap2/devices.c

[PATCH 0/7] omap-sham off mode and error handling fixes.

2010-11-10 Thread Dmitry Kasatkin
Dmitry Kasatkin (7): crypto: updates omap sham device related platform code crypto: omap-sham - omap sha1 & md5 driver omap-sham: OMAP macros corrected omap-sham: uses digest buffer in request context omap-sham: DMA initialization fixes for off mode omap-sham: error handling improved

[PATCH 4/5] omap-aes: error handling implementation improved

2010-11-10 Thread Dmitry Kasatkin
Previous version had not error handling. Request could remain uncompleted. Also in the case of DMA error, FLAGS_INIT is unset and accelerator will be initialized again. Buffer size allignment is checked. Signed-off-by: Dmitry Kasatkin --- drivers/crypto/omap-aes.c | 135 ++

[PATCH 5/5] omap-aes: unnecessary code removed

2010-11-10 Thread Dmitry Kasatkin
Key and IV should always be set before AES operation. So no need to check if it has changed or not. Signed-off-by: Dmitry Kasatkin --- drivers/crypto/omap-aes.c | 64 +++- 1 files changed, 16 insertions(+), 48 deletions(-) diff --git a/drivers/crypto/om

[PATCH 2/5] omap-aes: DMA initialization fixes for OMAP off mode

2010-11-10 Thread Dmitry Kasatkin
DMA parameters for constant data were initialized during driver probe(). It seems that those settings sometimes are lost when devices goes to off mode. This patch makes DMA initialization just before use. It solves off mode problems. Signed-off-by: Dmitry Kasatkin --- drivers/crypto/omap-aes.c |

[PATCH 3/5] omap-aes: redundant locking is removed

2010-11-10 Thread Dmitry Kasatkin
Submitting request involved double locking for enqueuing and dequeuing. Now it is done under the same lock. FLAGS_BUSY is now handled under the same lock. Signed-off-by: Dmitry Kasatkin --- drivers/crypto/omap-aes.c | 68 1 files changed, 31 insert

[PATCH 1/5] crypto: omap-aes: change in prevention of OCP bus error

2010-11-10 Thread Dmitry Kasatkin
Suggested to use udelay() instead of nop as on the higher core frequencies it might not be enough time. Signed-off-by: Dmitry Kasatkin --- drivers/crypto/omap-aes.c | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-a

[PATCH 0/5] omap-aes off mode and error handling fixes

2010-11-10 Thread Dmitry Kasatkin
Dmitry Kasatkin (5): crypto: omap-aes: change in prevention of OCP bus error omap-aes: DMA initialization fixes for OMAP off mode omap-aes: redundant locking is removed omap-aes: error handling implementation improved omap-aes: unnecessary code removed drivers/crypto/omap-aes.c | 269 +

[PATCH v1.3 3/4] keys: add new trusted key-type

2010-11-10 Thread Mimi Zohar
Defines a new kernel key-type called 'trusted'. Trusted keys are random number symmetric keys, generated and RSA-sealed by the TPM. The TPM only unseals the keys, if the boot PCRs and other criteria match. Userspace can only ever see encrypted blobs. Based on suggestions by Jason Gunthorpe, sever

[PATCH v1.3 2/4] key: add tpm_send command

2010-11-10 Thread Mimi Zohar
Add internal kernel tpm_send() command used to seal/unseal keys. Signed-off-by: David Safford Reviewd-by: Mimi Zohar Acked-by: Rajiv Andrade Acked-by: Serge E. Hallyn --- drivers/char/tpm/tpm.c | 17 + include/linux/tpm.h|3 +++ 2 files changed, 20 insertions(+), 0 d

[PATCH v1.3 4/4] keys: add new key-type encrypted

2010-11-10 Thread Mimi Zohar
Defines a new kernel key-type called 'encrypted'. Encrypted keys are kernel generated random numbers, which are encrypted/decrypted with a 'trusted' symmetric key. Encrypted keys are created/encrypted/decrypted in the kernel. Userspace only ever sees/stores encrypted blobs. Changelog: - allocate

[PATCH v1.3 0/4] keys: trusted and encrypted keys

2010-11-10 Thread Mimi Zohar
The previous posting added serveral new trusted-key options (migratable, pcrlock, keyhandle, keyauth, blobauth), described below, based on suggestions by Jason Gunthorpe. This patch requires the pcrlock option be executed with CAP_SYS_ADMIN privileges. By default, trusted keys work as previously d

[PATCH v1.3 1/4] lib: hex2bin converts ascii hexadecimal string to binary

2010-11-10 Thread Mimi Zohar
Similar to the kgdb_hex2mem() code, hex2bin converts a string to binary using the hex_to_bin() library call. Signed-off-by: Mimi Zohar Acked-by: Serge E. Hallyn --- include/linux/kernel.h |1 + lib/hexdump.c | 16 2 files changed, 17 insertions(+), 0 deletions(-)

Re: crypto ahash error handling

2010-11-10 Thread Dmitry Kasatkin
This is not good. Driver might allocate some resources, which needs to be released. crypto_ahash_final() should do some kind of "cleanup" task. - Dmitry On 10/11/10 14:27, ext Herbert Xu wrote: > Dmitry Kasatkin wrote: > >> Hello, >> >> When using crypto ahash API, is it necessary/mandatory

Re: Linux 2.6.37-rc1 (pcrypt fault)

2010-11-10 Thread Steffen Klassert
On Wed, Nov 03, 2010 at 02:15:19PM -0700, Randy Dunlap wrote: > > modprobe pcrypt; rmmod pcrypt ==> > > > [ 76.081639] calling pcrypt_init+0x0/0x107 [pcrypt] @ 3016 > Nov 3 13:02:15 control kernel: [ 76.089883] initcall pcrypt_init+0x0/0x107 > [pcrypt] returned 0 after 2476 usecs > [ 76

Re: crypto ahash error handling

2010-11-10 Thread Herbert Xu
Dmitry Kasatkin wrote: > Hello, > > When using crypto ahash API, is it necessary/mandatory to call > crypto_ahash_final() if crypto_ahash_update() returns error... > > Basically it might happen after several calls while calculating hash if > HW error happens. > It is not possible to continue has