|
@@ -433,13 +433,10 @@ static void sunhv_console_write_paged(struct console *con, const char *s, unsign
|
|
|
unsigned long flags;
|
|
|
int locked = 1;
|
|
|
|
|
|
- local_irq_save(flags);
|
|
|
- if (port->sysrq) {
|
|
|
- locked = 0;
|
|
|
- } else if (oops_in_progress) {
|
|
|
- locked = spin_trylock(&port->lock);
|
|
|
- } else
|
|
|
- spin_lock(&port->lock);
|
|
|
+ if (port->sysrq || oops_in_progress)
|
|
|
+ locked = spin_trylock_irqsave(&port->lock, flags);
|
|
|
+ else
|
|
|
+ spin_lock_irqsave(&port->lock, flags);
|
|
|
|
|
|
while (n > 0) {
|
|
|
unsigned long ra = __pa(con_write_page);
|
|
@@ -470,8 +467,7 @@ static void sunhv_console_write_paged(struct console *con, const char *s, unsign
|
|
|
}
|
|
|
|
|
|
if (locked)
|
|
|
- spin_unlock(&port->lock);
|
|
|
- local_irq_restore(flags);
|
|
|
+ spin_unlock_irqrestore(&port->lock, flags);
|
|
|
}
|
|
|
|
|
|
static inline void sunhv_console_putchar(struct uart_port *port, char c)
|
|
@@ -492,7 +488,10 @@ static void sunhv_console_write_bychar(struct console *con, const char *s, unsig
|
|
|
unsigned long flags;
|
|
|
int i, locked = 1;
|
|
|
|
|
|
- local_irq_save(flags);
|
|
|
+ if (port->sysrq || oops_in_progress)
|
|
|
+ locked = spin_trylock_irqsave(&port->lock, flags);
|
|
|
+ else
|
|
|
+ spin_lock_irqsave(&port->lock, flags);
|
|
|
if (port->sysrq) {
|
|
|
locked = 0;
|
|
|
} else if (oops_in_progress) {
|
|
@@ -507,8 +506,7 @@ static void sunhv_console_write_bychar(struct console *con, const char *s, unsig
|
|
|
}
|
|
|
|
|
|
if (locked)
|
|
|
- spin_unlock(&port->lock);
|
|
|
- local_irq_restore(flags);
|
|
|
+ spin_unlock_irqrestore(&port->lock, flags);
|
|
|
}
|
|
|
|
|
|
static struct console sunhv_console = {
|