lkml.org 
[lkml]   [2018]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] serial: sh-sci: Use spin_{try}lock_irqsave instead of open coding version
On 2018-05-04 18:30:41 [+0200], Daniel Wagner wrote:
> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c
> @@ -2890,16 +2890,16 @@ static void serial_console_write(struct console *co, const char *s,
> unsigned long flags;
> int locked = 1;
>
> - local_irq_save(flags);
> #if defined(SUPPORT_SYSRQ)
> - if (port->sysrq)
> + if (port->sysrq) {
> locked = 0;
> - else
> + local_irq_save(flags);

how is this helping? You should see a splat after a sysrq request.

> + } else
> #endif
> 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);
>
> /* first save SCSCR then disable interrupts, keep clock source */
> ctrl = serial_port_in(port, SCSCR);

Sebastian

\
 
 \ /
  Last update: 2018-05-07 14:53    [W:0.062 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site