[PATCH] tty/serial: at91: handle IRQ status more safely

2015-04-08 Thread Leilei Zhao
. Signed-off-by: Leilei Zhao Acked-by: Nicolas Ferre --- drivers/tty/serial/atmel_serial.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index d58fe47..d536d31 100644 --- a/drivers/tty/serial

[PATCH] tty/serial: at91: handle IRQ status more safely

2015-04-08 Thread Leilei Zhao
. Signed-off-by: Leilei Zhao leilei.z...@atmel.com Acked-by: Nicolas Ferre nicolas.fe...@atmel.com --- drivers/tty/serial/atmel_serial.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index

[PATCH 10/10] crypto: atmel-aes: correct usage of dma_sync_* API

2015-04-07 Thread Leilei Zhao
The output buffer is used for CPU access, so the API should be dma_sync_single_for_cpu which makes the cache line invalid in order to reload the value in memory. Signed-off-by: Leilei Zhao Acked-by: Nicolas Ferre --- drivers/crypto/atmel-aes.c |2 +- 1 file changed, 1 insertion(+), 1

[PATCH 08/10] crypto: atmel-aes: initialize spinlock in probe

2015-04-07 Thread Leilei Zhao
Kernel will report "BUG: spinlock lockup suspected on CPU#0" when CONFIG_DEBUG_SPINLOCK is enabled in kernel config and the spinlock is used at the first time. It's caused by uninitialized spinlock, so just initialize it in probe. Signed-off-by: Leilei Zhao Acked-by: Nicolas Ferre --

[PATCH 09/10] crypto: atmel-aes: sync the buf used in DMA or CPU

2015-04-07 Thread Leilei Zhao
test with OpenSSH. Signed-off-by: Leilei Zhao Acked-by: Nicolas Ferre --- 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 f0532ab..9bd3437 100644 --- a/drivers/crypto

[PATCH 07/10] crypto: atmel-tdes: initialize spinlock in probe

2015-04-07 Thread Leilei Zhao
Kernel will report "BUG: spinlock lockup suspected on CPU#0" when CONFIG_DEBUG_SPINLOCK is enabled in kernel config and the spinlock is used at the first time. It's caused by uninitialized spinlock, so just initialize it in probe. Signed-off-by: Leilei Zhao Acked-by: Nicolas Ferre --

[PATCH 06/10] crypto: atmel-sha: correct the max burst size

2015-04-07 Thread Leilei Zhao
and the program will wait forever. So here change the max burst size of all the cases to 16 in order to make SHA384 and SHA512 work and keep consistent with DMA driver and datasheet. Signed-off-by: Leilei Zhao Acked-by: Nicolas Ferre --- drivers/crypto/atmel-sha.c | 10 ++ 1 file changed

[PATCH 04/10] crypto: atmel-sha: fix sg list management

2015-04-07 Thread Leilei Zhao
Having a zero length sg doesn't mean it is the end of the sg list. This case happens when calculating HMAC of IPSec packet. Signed-off-by: Leilei Zhao Signed-off-by: Ludovic Desroches Acked-by: Nicolas Ferre --- drivers/crypto/atmel-sha.c | 16 ++-- 1 file changed, 14 insertions

[PATCH 05/10] crypto: atmel-sha: initialize spinlock in probe

2015-04-07 Thread Leilei Zhao
Kernel will report "BUG: spinlock lockup suspected on CPU#0" when CONFIG_DEBUG_SPINLOCK is enabled in kernel config and the spinlock is used at the first time. It's caused by uninitialized spinlock, so just initialize it in probe. Signed-off-by: Leilei Zhao Acked-by: Nicolas Ferre --

[PATCH 03/10] crypto: atmel-sha: correct the way data are split

2015-04-07 Thread Leilei Zhao
performed when the buffer is full or when there is no more data. So it removes the transfer whose size is equal the update size after the full buffer transmission. Signed-off-by: Ludovic Desroches Signed-off-by: Leilei Zhao Acked-by: Nicolas Ferre --- drivers/crypto/atmel-sha.c |2 +- 1 file

[PATCH 02/10] crypto: atmel-sha: add new version

2015-04-07 Thread Leilei Zhao
Add new version of atmel-sha available with SAMA5D4 devices. Signed-off-by: Leilei Zhao Signed-off-by: Ludovic Desroches Acked-by: Nicolas Ferre --- drivers/crypto/atmel-sha.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c

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

2015-04-07 Thread Leilei Zhao
Add new version of atmel-aes available with SAMA5D4 devices. Signed-off-by: Leilei Zhao Signed-off-by: Ludovic Desroches Acked-by: Nicolas Ferre --- 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

[PATCH 00/10] crypto: at91: add support for SAMA5D4 and fix related bugs

2015-04-07 Thread Leilei Zhao
on SAMA5D3EK. Leilei Zhao (9): crypto: atmel-aes: add new version crypto: atmel-sha: add new version crypto: atmel-sha: fix sg list management crypto: atmel-sha: initialize spinlock in probe crypto: atmel-sha: correct the max burst size crypto: atmel-tdes: initialize spinlock in probe crypto

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

2015-04-07 Thread Leilei Zhao
Add new version of atmel-aes available with SAMA5D4 devices. Signed-off-by: Leilei Zhao leilei.z...@atmel.com Signed-off-by: Ludovic Desroches ludovic.desroc...@atmel.com Acked-by: Nicolas Ferre nicolas.fe...@atmel.com --- drivers/crypto/atmel-aes.c |5 + 1 file changed, 5 insertions

[PATCH 02/10] crypto: atmel-sha: add new version

2015-04-07 Thread Leilei Zhao
Add new version of atmel-sha available with SAMA5D4 devices. Signed-off-by: Leilei Zhao leilei.z...@atmel.com Signed-off-by: Ludovic Desroches ludovic.desroc...@atmel.com Acked-by: Nicolas Ferre nicolas.fe...@atmel.com --- drivers/crypto/atmel-sha.c |6 ++ 1 file changed, 6 insertions

[PATCH 08/10] crypto: atmel-aes: initialize spinlock in probe

2015-04-07 Thread Leilei Zhao
Kernel will report BUG: spinlock lockup suspected on CPU#0 when CONFIG_DEBUG_SPINLOCK is enabled in kernel config and the spinlock is used at the first time. It's caused by uninitialized spinlock, so just initialize it in probe. Signed-off-by: Leilei Zhao leilei.z...@atmel.com Acked-by: Nicolas

[PATCH 06/10] crypto: atmel-sha: correct the max burst size

2015-04-07 Thread Leilei Zhao
and the program will wait forever. So here change the max burst size of all the cases to 16 in order to make SHA384 and SHA512 work and keep consistent with DMA driver and datasheet. Signed-off-by: Leilei Zhao leilei.z...@atmel.com Acked-by: Nicolas Ferre nicolas.fe...@atmel.com --- drivers/crypto

[PATCH 09/10] crypto: atmel-aes: sync the buf used in DMA or CPU

2015-04-07 Thread Leilei Zhao
test with OpenSSH. Signed-off-by: Leilei Zhao leilei.z...@atmel.com Acked-by: Nicolas Ferre nicolas.fe...@atmel.com --- 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

[PATCH 07/10] crypto: atmel-tdes: initialize spinlock in probe

2015-04-07 Thread Leilei Zhao
Kernel will report BUG: spinlock lockup suspected on CPU#0 when CONFIG_DEBUG_SPINLOCK is enabled in kernel config and the spinlock is used at the first time. It's caused by uninitialized spinlock, so just initialize it in probe. Signed-off-by: Leilei Zhao leilei.z...@atmel.com Acked-by: Nicolas

[PATCH 00/10] crypto: at91: add support for SAMA5D4 and fix related bugs

2015-04-07 Thread Leilei Zhao
on SAMA5D3EK. Leilei Zhao (9): crypto: atmel-aes: add new version crypto: atmel-sha: add new version crypto: atmel-sha: fix sg list management crypto: atmel-sha: initialize spinlock in probe crypto: atmel-sha: correct the max burst size crypto: atmel-tdes: initialize spinlock in probe crypto

[PATCH 10/10] crypto: atmel-aes: correct usage of dma_sync_* API

2015-04-07 Thread Leilei Zhao
The output buffer is used for CPU access, so the API should be dma_sync_single_for_cpu which makes the cache line invalid in order to reload the value in memory. Signed-off-by: Leilei Zhao leilei.z...@atmel.com Acked-by: Nicolas Ferre nicolas.fe...@atmel.com --- drivers/crypto/atmel-aes.c |2

[PATCH 03/10] crypto: atmel-sha: correct the way data are split

2015-04-07 Thread Leilei Zhao
, dma transfers are only performed when the buffer is full or when there is no more data. So it removes the transfer whose size is equal the update size after the full buffer transmission. Signed-off-by: Ludovic Desroches ludovic.desroc...@atmel.com Signed-off-by: Leilei Zhao leilei.z...@atmel.com

[PATCH 05/10] crypto: atmel-sha: initialize spinlock in probe

2015-04-07 Thread Leilei Zhao
Kernel will report BUG: spinlock lockup suspected on CPU#0 when CONFIG_DEBUG_SPINLOCK is enabled in kernel config and the spinlock is used at the first time. It's caused by uninitialized spinlock, so just initialize it in probe. Signed-off-by: Leilei Zhao leilei.z...@atmel.com Acked-by: Nicolas

[PATCH 04/10] crypto: atmel-sha: fix sg list management

2015-04-07 Thread Leilei Zhao
Having a zero length sg doesn't mean it is the end of the sg list. This case happens when calculating HMAC of IPSec packet. Signed-off-by: Leilei Zhao leilei.z...@atmel.com Signed-off-by: Ludovic Desroches ludovic.desroc...@atmel.com Acked-by: Nicolas Ferre nicolas.fe...@atmel.com --- drivers

[PATCH v2 5/5] tty/serial: at91: correct the usage of tasklet

2015-02-27 Thread Leilei Zhao
, tasklet_kill can only clear the current scheduling out, so tasklet should be disabled to prevent being executed in later scheduling. Otherwise, the tasklet executed after serial port was shutdown can lead to kernel crash. Signed-off-by: Leilei Zhao Acked-by: Nicolas Ferre --- drivers/tty/serial

[PATCH v2 4/5] tty/serial: at91: set ops in property init each time

2015-02-27 Thread Leilei Zhao
when switching to PIO mode due to DMA channel is not available. Signed-off-by: Leilei Zhao Acked-by: Nicolas Ferre --- drivers/tty/serial/atmel_serial.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 2667656

[PATCH v2 3/5] tty/serial: at91: revise the return type of atmel_init_property

2015-02-27 Thread Leilei Zhao
in this function. It's actually a procedure. So changing the return type from int to void. Signed-off-by: Leilei Zhao Acked-by: Nicolas Ferre --- drivers/tty/serial/atmel_serial.c |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty

[PATCH v2 2/5] tty/serial: at91: correct buffer size used in DMA

2015-02-27 Thread Leilei Zhao
The buffer size set in DMA is inconsistent with its allocation. So keep them consistent here. The structure atmel_uart_char is used in PIO mode with its meaning. But here in DMA, all of the buffer is treated as general char. Signed-off-by: Leilei Zhao Acked-by: Nicolas Ferre --- drivers/tty

[PATCH v2 1/5] tty/serial: at91: correct check of buf used in DMA

2015-02-27 Thread Leilei Zhao
We only use buf of ring In DMA rx function while using buf of xmit in DMA tx function. So in DMA rx we need definitively to check the buf of ring which is corresponding to DMA rx function. And use macro PAGE_ALIGNED to simplify the expression. Signed-off-by: Leilei Zhao Acked-by: Nicolas Ferre

[PATCH v2 0/5] tty/serial: at91: fix bugs when using multiple serials

2015-02-27 Thread Leilei Zhao
PAGE_ALIGNED to simplify the expression. Leilei Zhao (5): tty/serial: at91: correct check of buf used in DMA tty/serial: at91: correct buffer size used in DMA tty/serial: at91: revise the return type of atmel_init_property tty/serial: at91: set ops in property init each time tty/serial: at91

[PATCH v2 0/5] tty/serial: at91: fix bugs when using multiple serials

2015-02-27 Thread Leilei Zhao
PAGE_ALIGNED to simplify the expression. Leilei Zhao (5): tty/serial: at91: correct check of buf used in DMA tty/serial: at91: correct buffer size used in DMA tty/serial: at91: revise the return type of atmel_init_property tty/serial: at91: set ops in property init each time tty/serial: at91

[PATCH v2 2/5] tty/serial: at91: correct buffer size used in DMA

2015-02-27 Thread Leilei Zhao
The buffer size set in DMA is inconsistent with its allocation. So keep them consistent here. The structure atmel_uart_char is used in PIO mode with its meaning. But here in DMA, all of the buffer is treated as general char. Signed-off-by: Leilei Zhao leilei.z...@atmel.com Acked-by: Nicolas Ferre

[PATCH v2 1/5] tty/serial: at91: correct check of buf used in DMA

2015-02-27 Thread Leilei Zhao
We only use buf of ring In DMA rx function while using buf of xmit in DMA tx function. So in DMA rx we need definitively to check the buf of ring which is corresponding to DMA rx function. And use macro PAGE_ALIGNED to simplify the expression. Signed-off-by: Leilei Zhao leilei.z...@atmel.com

[PATCH v2 3/5] tty/serial: at91: revise the return type of atmel_init_property

2015-02-27 Thread Leilei Zhao
in this function. It's actually a procedure. So changing the return type from int to void. Signed-off-by: Leilei Zhao leilei.z...@atmel.com Acked-by: Nicolas Ferre nicolas.fe...@atmel.com --- drivers/tty/serial/atmel_serial.c |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git

[PATCH v2 4/5] tty/serial: at91: set ops in property init each time

2015-02-27 Thread Leilei Zhao
when switching to PIO mode due to DMA channel is not available. Signed-off-by: Leilei Zhao leilei.z...@atmel.com Acked-by: Nicolas Ferre nicolas.fe...@atmel.com --- drivers/tty/serial/atmel_serial.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers

[PATCH v2 5/5] tty/serial: at91: correct the usage of tasklet

2015-02-27 Thread Leilei Zhao
, tasklet_kill can only clear the current scheduling out, so tasklet should be disabled to prevent being executed in later scheduling. Otherwise, the tasklet executed after serial port was shutdown can lead to kernel crash. Signed-off-by: Leilei Zhao leilei.z...@atmel.com Acked-by: Nicolas Ferre nicolas.fe

[PATCH 4/5] tty/serial: at91: set ops in property init each time

2015-02-25 Thread Leilei Zhao
when switching to PIO mode due to DMA channel is not available. Signed-off-by: Leilei Zhao Acked-by: Nicolas Ferre --- drivers/tty/serial/atmel_serial.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 30a62cd

[PATCH 3/5] tty/serial: at91: revise the return type of atmel_init_property

2015-02-25 Thread Leilei Zhao
in this function. It's actually a procedure. So changing the return type from int to void. Signed-off-by: Leilei Zhao Acked-by: Nicolas Ferre --- drivers/tty/serial/atmel_serial.c |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty

[PATCH 2/5] tty/serial: at91: correct buffer size used in DMA

2015-02-25 Thread Leilei Zhao
The buffer size set in DMA is inconsistent with its allocation. So keep them consistent here. The structure atmel_uart_char is used in PIO mode with its meaning. But here in DMA, all of the buffer is treated as general char. Signed-off-by: Leilei Zhao Acked-by: Nicolas Ferre --- drivers/tty

[PATCH 5/5] tty/serial: at91: correct the usage of tasklet

2015-02-25 Thread Leilei Zhao
, tasklet_kill can only clear the current scheduling out, so tasklet should be disabled to prevent being executed in later scheduling. Otherwise, the tasklet executed after serial port was shutdown can lead to kernel crash. Signed-off-by: Leilei Zhao Acked-by: Nicolas Ferre --- drivers/tty/serial

[PATCH 1/5] tty/serial: at91: correct check of buf used in DMA

2015-02-25 Thread Leilei Zhao
We only use buf of ring In DMA rx function while using buf of xmit in DMA tx function. So here we need definitively to check the buf of ring which is corresponding to DMA rx function. Signed-off-by: Leilei Zhao Acked-by: Nicolas Ferre --- drivers/tty/serial/atmel_serial.c |2 +- 1 file

[PATCH 0/5] tty/serial: at91: fix bugs when using multiple serials

2015-02-25 Thread Leilei Zhao
is not available. - The serial port can lead to kernel crash when data is sending and receiving and the program is killed. The patches were made from branch tty-next of gregkh/tty.git repository, and tested on a SAMA5D36 VB boards with 5 serial ports enabled. Leilei Zhao (5): tty/serial: at91

[PATCH 2/5] tty/serial: at91: correct buffer size used in DMA

2015-02-25 Thread Leilei Zhao
The buffer size set in DMA is inconsistent with its allocation. So keep them consistent here. The structure atmel_uart_char is used in PIO mode with its meaning. But here in DMA, all of the buffer is treated as general char. Signed-off-by: Leilei Zhao leilei.z...@atmel.com Acked-by: Nicolas Ferre

[PATCH 5/5] tty/serial: at91: correct the usage of tasklet

2015-02-25 Thread Leilei Zhao
, tasklet_kill can only clear the current scheduling out, so tasklet should be disabled to prevent being executed in later scheduling. Otherwise, the tasklet executed after serial port was shutdown can lead to kernel crash. Signed-off-by: Leilei Zhao leilei.z...@atmel.com Acked-by: Nicolas Ferre nicolas.fe

[PATCH 1/5] tty/serial: at91: correct check of buf used in DMA

2015-02-25 Thread Leilei Zhao
We only use buf of ring In DMA rx function while using buf of xmit in DMA tx function. So here we need definitively to check the buf of ring which is corresponding to DMA rx function. Signed-off-by: Leilei Zhao leilei.z...@atmel.com Acked-by: Nicolas Ferre nicolas.fe...@atmel.com --- drivers/tty

[PATCH 0/5] tty/serial: at91: fix bugs when using multiple serials

2015-02-25 Thread Leilei Zhao
is not available. - The serial port can lead to kernel crash when data is sending and receiving and the program is killed. The patches were made from branch tty-next of gregkh/tty.git repository, and tested on a SAMA5D36 VB boards with 5 serial ports enabled. Leilei Zhao (5): tty/serial: at91

[PATCH 4/5] tty/serial: at91: set ops in property init each time

2015-02-25 Thread Leilei Zhao
when switching to PIO mode due to DMA channel is not available. Signed-off-by: Leilei Zhao leilei.z...@atmel.com Acked-by: Nicolas Ferre nicolas.fe...@atmel.com --- drivers/tty/serial/atmel_serial.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers

[PATCH 3/5] tty/serial: at91: revise the return type of atmel_init_property

2015-02-25 Thread Leilei Zhao
in this function. It's actually a procedure. So changing the return type from int to void. Signed-off-by: Leilei Zhao leilei.z...@atmel.com Acked-by: Nicolas Ferre nicolas.fe...@atmel.com --- drivers/tty/serial/atmel_serial.c |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git

[PATCH 2/2] crypto: atmel-aes: check alignment of cfb64 mode

2014-04-22 Thread Leilei Zhao
The length shoule be 64 bit alignment and the block size shoule be 64 bit in aes cfb64 mode. Signed-off-by: Leilei Zhao --- drivers/crypto/atmel-aes.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 12628a7..a083474

[PATCH 1/2] crypto: atmel-aes: correct block size of cfb8 mode

2014-04-22 Thread Leilei Zhao
The block size of aes cfb8 mode shoule be 8 bit. Signed-off-by: Leilei Zhao --- 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 d7c9e31..12628a7 100644 --- a/drivers/crypto/atmel

[PATCH 0/2] crypto: atmel-aes: fixes on block size of aes cfb mode

2014-04-22 Thread Leilei Zhao
Hi: These two patches correct the block size in atmel-aes driver while processing cfb8 and cfb64 mode of aes. Thanks Leilei Zhao (2): crypto: atmel-aes: correct block size of cfb8 mode crypto: atmel-aes: check alignment of cfb64 mode drivers/crypto/atmel-aes.c |8 +++- 1 file

[PATCH 0/2] crypto: atmel-aes: fixes on block size of aes cfb mode

2014-04-22 Thread Leilei Zhao
Hi: These two patches correct the block size in atmel-aes driver while processing cfb8 and cfb64 mode of aes. Thanks Leilei Zhao (2): crypto: atmel-aes: correct block size of cfb8 mode crypto: atmel-aes: check alignment of cfb64 mode drivers/crypto/atmel-aes.c |8 +++- 1 file

[PATCH 1/2] crypto: atmel-aes: correct block size of cfb8 mode

2014-04-22 Thread Leilei Zhao
The block size of aes cfb8 mode shoule be 8 bit. Signed-off-by: Leilei Zhao leilei.z...@atmel.com --- 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 d7c9e31..12628a7 100644

[PATCH 2/2] crypto: atmel-aes: check alignment of cfb64 mode

2014-04-22 Thread Leilei Zhao
The length shoule be 64 bit alignment and the block size shoule be 64 bit in aes cfb64 mode. Signed-off-by: Leilei Zhao leilei.z...@atmel.com --- drivers/crypto/atmel-aes.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index