[PATCH v2 1/1] crypto: stm32/hash - Fix return issue on update

2017-11-06 Thread lionel.debieve
From: Lionel Debieve 

When data append reached the threshold for processing,
we must inform that processing is on going to wait before
managing the next request.

Signed-off-by: Lionel Debieve 
---
 drivers/crypto/stm32/stm32-hash.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/crypto/stm32/stm32-hash.c 
b/drivers/crypto/stm32/stm32-hash.c
index c462be7..4ca4a26 100644
--- a/drivers/crypto/stm32/stm32-hash.c
+++ b/drivers/crypto/stm32/stm32-hash.c
@@ -895,7 +895,6 @@ static int stm32_hash_enqueue(struct ahash_request *req, 
unsigned int op)
 static int stm32_hash_update(struct ahash_request *req)
 {
struct stm32_hash_request_ctx *rctx = ahash_request_ctx(req);
-   int ret;
 
if (!req->nbytes || !(rctx->flags & HASH_FLAGS_CPU))
return 0;
@@ -909,12 +908,7 @@ static int stm32_hash_update(struct ahash_request *req)
return 0;
}
 
-   ret = stm32_hash_enqueue(req, HASH_OP_UPDATE);
-
-   if (rctx->flags & HASH_FLAGS_FINUP)
-   return ret;
-
-   return 0;
+   return stm32_hash_enqueue(req, HASH_OP_UPDATE);
 }
 
 static int stm32_hash_final(struct ahash_request *req)
-- 
2.7.4



[PATCH RT] tty: serial: st-asc: Make the locking RT aware

2017-03-21 Thread lionel.debieve
From: Lionel Debieve 

The lock is a sleeping lock and local_irq_save() is not the
standard implementation now. Working for both -RT and non
RT.

Signed-off-by: Lionel Debieve 
---
 drivers/tty/serial/st-asc.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index 379e5bd..1815423 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -803,13 +803,12 @@ static void asc_console_write(struct console *co, const 
char *s, unsigned count)
int locked = 1;
u32 intenable;
 
-   local_irq_save(flags);
if (port->sysrq)
locked = 0; /* asc_interrupt has already claimed the lock */
else if (oops_in_progress)
-   locked = spin_trylock(&port->lock);
+   locked = spin_trylock_irqsave(&port->lock, flags);
else
-   spin_lock(&port->lock);
+   spin_lock_irqsave(&port->lock, flags);
 
/*
 * Disable interrupts so we don't get the IRQ line bouncing
@@ -827,8 +826,7 @@ static void asc_console_write(struct console *co, const 
char *s, unsigned count)
asc_out(port, ASC_INTEN, intenable);
 
if (locked)
-   spin_unlock(&port->lock);
-   local_irq_restore(flags);
+   spin_unlock_irqrestore(&port->lock, flags);
 }
 
 static int asc_console_setup(struct console *co, char *options)
-- 
2.7.4