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

2017-03-29 Thread Sebastian Andrzej Siewior
On 2017-03-22 18:12:31 [+0100], Lionel Debieve wrote:
> 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 

Acked-by: Sebastian Andrzej Siewior 

This is how serial8250_console_write() looks upstream, too.

Sebastian


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

2017-03-29 Thread Sebastian Andrzej Siewior
On 2017-03-22 18:12:31 [+0100], Lionel Debieve wrote:
> 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 

Acked-by: Sebastian Andrzej Siewior 

This is how serial8250_console_write() looks upstream, too.

Sebastian


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

2017-03-23 Thread Patrice CHOTARD
Hi Lionel

On 03/22/2017 06:12 PM, Lionel Debieve wrote:
> 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 

Acked-by: Patrice Chotard 


> ---
>  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 c334bcc..4889396 100644
> --- a/drivers/tty/serial/st-asc.c
> +++ b/drivers/tty/serial/st-asc.c
> @@ -887,13 +887,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(>lock);
> + locked = spin_trylock_irqsave(>lock, flags);
>   else
> - spin_lock(>lock);
> + spin_lock_irqsave(>lock, flags);
>
>   /*
>* Disable interrupts so we don't get the IRQ line bouncing
> @@ -911,8 +910,7 @@ static void asc_console_write(struct console *co, const 
> char *s, unsigned count)
>   asc_out(port, ASC_INTEN, intenable);
>
>   if (locked)
> - spin_unlock(>lock);
> - local_irq_restore(flags);
> + spin_unlock_irqrestore(>lock, flags);
>  }
>
>  static int asc_console_setup(struct console *co, char *options)
>


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

2017-03-23 Thread Patrice CHOTARD
Hi Lionel

On 03/22/2017 06:12 PM, Lionel Debieve wrote:
> 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 

Acked-by: Patrice Chotard 


> ---
>  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 c334bcc..4889396 100644
> --- a/drivers/tty/serial/st-asc.c
> +++ b/drivers/tty/serial/st-asc.c
> @@ -887,13 +887,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(>lock);
> + locked = spin_trylock_irqsave(>lock, flags);
>   else
> - spin_lock(>lock);
> + spin_lock_irqsave(>lock, flags);
>
>   /*
>* Disable interrupts so we don't get the IRQ line bouncing
> @@ -911,8 +910,7 @@ static void asc_console_write(struct console *co, const 
> char *s, unsigned count)
>   asc_out(port, ASC_INTEN, intenable);
>
>   if (locked)
> - spin_unlock(>lock);
> - local_irq_restore(flags);
> + spin_unlock_irqrestore(>lock, flags);
>  }
>
>  static int asc_console_setup(struct console *co, char *options)
>


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

2017-03-22 Thread 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 c334bcc..4889396 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -887,13 +887,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(>lock);
+   locked = spin_trylock_irqsave(>lock, flags);
else
-   spin_lock(>lock);
+   spin_lock_irqsave(>lock, flags);
 
/*
 * Disable interrupts so we don't get the IRQ line bouncing
@@ -911,8 +910,7 @@ static void asc_console_write(struct console *co, const 
char *s, unsigned count)
asc_out(port, ASC_INTEN, intenable);
 
if (locked)
-   spin_unlock(>lock);
-   local_irq_restore(flags);
+   spin_unlock_irqrestore(>lock, flags);
 }
 
 static int asc_console_setup(struct console *co, char *options)
-- 
2.7.4



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

2017-03-22 Thread 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 c334bcc..4889396 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -887,13 +887,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(>lock);
+   locked = spin_trylock_irqsave(>lock, flags);
else
-   spin_lock(>lock);
+   spin_lock_irqsave(>lock, flags);
 
/*
 * Disable interrupts so we don't get the IRQ line bouncing
@@ -911,8 +910,7 @@ static void asc_console_write(struct console *co, const 
char *s, unsigned count)
asc_out(port, ASC_INTEN, intenable);
 
if (locked)
-   spin_unlock(>lock);
-   local_irq_restore(flags);
+   spin_unlock_irqrestore(>lock, flags);
 }
 
 static int asc_console_setup(struct console *co, char *options)
-- 
2.7.4