aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/pxa.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/pxa.c')
-rw-r--r--drivers/tty/serial/pxa.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
index 5847a4b855f7..9033fc6e0e4e 100644
--- a/drivers/tty/serial/pxa.c
+++ b/drivers/tty/serial/pxa.c
@@ -670,9 +670,19 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
670{ 670{
671 struct uart_pxa_port *up = serial_pxa_ports[co->index]; 671 struct uart_pxa_port *up = serial_pxa_ports[co->index];
672 unsigned int ier; 672 unsigned int ier;
673 unsigned long flags;
674 int locked = 1;
673 675
674 clk_prepare_enable(up->clk); 676 clk_prepare_enable(up->clk);
675 677
678 local_irq_save(flags);
679 if (up->port.sysrq)
680 locked = 0;
681 else if (oops_in_progress)
682 locked = spin_trylock(&up->port.lock);
683 else
684 spin_lock(&up->port.lock);
685
676 /* 686 /*
677 * First save the IER then disable the interrupts 687 * First save the IER then disable the interrupts
678 */ 688 */
@@ -688,6 +698,10 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
688 wait_for_xmitr(up); 698 wait_for_xmitr(up);
689 serial_out(up, UART_IER, ier); 699 serial_out(up, UART_IER, ier);
690 700
701 if (locked)
702 spin_unlock(&up->port.lock);
703 local_irq_restore(flags);
704
691 clk_disable_unprepare(up->clk); 705 clk_disable_unprepare(up->clk);
692} 706}
693 707