diff options
-rw-r--r-- | drivers/tty/serial/amba-pl011.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index ce843d058e02..6800f5f26241 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c | |||
@@ -1751,9 +1751,19 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) | |||
1751 | { | 1751 | { |
1752 | struct uart_amba_port *uap = amba_ports[co->index]; | 1752 | struct uart_amba_port *uap = amba_ports[co->index]; |
1753 | unsigned int status, old_cr, new_cr; | 1753 | unsigned int status, old_cr, new_cr; |
1754 | unsigned long flags; | ||
1755 | int locked = 1; | ||
1754 | 1756 | ||
1755 | clk_enable(uap->clk); | 1757 | clk_enable(uap->clk); |
1756 | 1758 | ||
1759 | local_irq_save(flags); | ||
1760 | if (uap->port.sysrq) | ||
1761 | locked = 0; | ||
1762 | else if (oops_in_progress) | ||
1763 | locked = spin_trylock(&uap->port.lock); | ||
1764 | else | ||
1765 | spin_lock(&uap->port.lock); | ||
1766 | |||
1757 | /* | 1767 | /* |
1758 | * First save the CR then disable the interrupts | 1768 | * First save the CR then disable the interrupts |
1759 | */ | 1769 | */ |
@@ -1773,6 +1783,10 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) | |||
1773 | } while (status & UART01x_FR_BUSY); | 1783 | } while (status & UART01x_FR_BUSY); |
1774 | writew(old_cr, uap->port.membase + UART011_CR); | 1784 | writew(old_cr, uap->port.membase + UART011_CR); |
1775 | 1785 | ||
1786 | if (locked) | ||
1787 | spin_unlock(&uap->port.lock); | ||
1788 | local_irq_restore(flags); | ||
1789 | |||
1776 | clk_disable(uap->clk); | 1790 | clk_disable(uap->clk); |
1777 | } | 1791 | } |
1778 | 1792 | ||