diff options
-rw-r--r-- | drivers/tty/serial/8250/8250_core.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c index 747073b8c38a..81f909c2101f 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c | |||
@@ -2886,14 +2886,10 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count) | |||
2886 | 2886 | ||
2887 | touch_nmi_watchdog(); | 2887 | touch_nmi_watchdog(); |
2888 | 2888 | ||
2889 | local_irq_save(flags); | 2889 | if (port->sysrq || oops_in_progress) |
2890 | if (port->sysrq) { | 2890 | locked = spin_trylock_irqsave(&port->lock, flags); |
2891 | /* serial8250_handle_irq() already took the lock */ | 2891 | else |
2892 | locked = 0; | 2892 | spin_lock_irqsave(&port->lock, flags); |
2893 | } else if (oops_in_progress) { | ||
2894 | locked = spin_trylock(&port->lock); | ||
2895 | } else | ||
2896 | spin_lock(&port->lock); | ||
2897 | 2893 | ||
2898 | /* | 2894 | /* |
2899 | * First save the IER then disable the interrupts | 2895 | * First save the IER then disable the interrupts |
@@ -2925,8 +2921,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count) | |||
2925 | serial8250_modem_status(up); | 2921 | serial8250_modem_status(up); |
2926 | 2922 | ||
2927 | if (locked) | 2923 | if (locked) |
2928 | spin_unlock(&port->lock); | 2924 | spin_unlock_irqrestore(&port->lock, flags); |
2929 | local_irq_restore(flags); | ||
2930 | } | 2925 | } |
2931 | 2926 | ||
2932 | static int __init serial8250_console_setup(struct console *co, char *options) | 2927 | static int __init serial8250_console_setup(struct console *co, char *options) |