aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/sunsu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/sunsu.c')
-rw-r--r--drivers/serial/sunsu.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
index 2a63cdba3208..26d720baf88c 100644
--- a/drivers/serial/sunsu.c
+++ b/drivers/serial/sunsu.c
@@ -1288,7 +1288,17 @@ static void sunsu_console_write(struct console *co, const char *s,
1288 unsigned int count) 1288 unsigned int count)
1289{ 1289{
1290 struct uart_sunsu_port *up = &sunsu_ports[co->index]; 1290 struct uart_sunsu_port *up = &sunsu_ports[co->index];
1291 unsigned long flags;
1291 unsigned int ier; 1292 unsigned int ier;
1293 int locked = 1;
1294
1295 local_irq_save(flags);
1296 if (up->port.sysrq) {
1297 locked = 0;
1298 } else if (oops_in_progress) {
1299 locked = spin_trylock(&up->port.lock);
1300 } else
1301 spin_lock(&up->port.lock);
1292 1302
1293 /* 1303 /*
1294 * First save the UER then disable the interrupts 1304 * First save the UER then disable the interrupts
@@ -1304,6 +1314,10 @@ static void sunsu_console_write(struct console *co, const char *s,
1304 */ 1314 */
1305 wait_for_xmitr(up); 1315 wait_for_xmitr(up);
1306 serial_out(up, UART_IER, ier); 1316 serial_out(up, UART_IER, ier);
1317
1318 if (locked)
1319 spin_unlock(&up->port.lock);
1320 local_irq_restore(flags);
1307} 1321}
1308 1322
1309/* 1323/*